LLVM  6.0.0svn
Public Member Functions | List of all members
llvm::IdentifyingPassPtr Class Reference

Discriminated union of Pass ID types. More...

#include "llvm/CodeGen/TargetPassConfig.h"

Collaboration diagram for llvm::IdentifyingPassPtr:
Collaboration graph

Public Member Functions

 IdentifyingPassPtr ()
 IdentifyingPassPtr (AnalysisID IDPtr)
 IdentifyingPassPtr (Pass *InstancePtr)
bool isValid () const
bool isInstance () const
AnalysisID getID () const
PassgetInstance () const

Detailed Description

Discriminated union of Pass ID types.

The PassConfig API prefers dealing with IDs because they are safer and more efficient. IDs decouple configuration from instantiation. This way, when a pass is overriden, it isn't unnecessarily instantiated. It is also unsafe to refer to a Pass pointer after adding it to a pass manager, which deletes redundant pass instances.

However, it is convient to directly instantiate target passes with non-default ctors. These often don't have a registered PassInfo. Rather than force all target passes to implement the pass registry boilerplate, allow the PassConfig API to handle either type.

AnalysisID is sadly char*, so PointerIntPair won't work.

Definition at line 52 of file TargetPassConfig.h.

Constructor & Destructor Documentation

◆ IdentifyingPassPtr() [1/3]

llvm::IdentifyingPassPtr::IdentifyingPassPtr ( )

Definition at line 60 of file TargetPassConfig.h.

◆ IdentifyingPassPtr() [2/3]

llvm::IdentifyingPassPtr::IdentifyingPassPtr ( AnalysisID  IDPtr)

Definition at line 61 of file TargetPassConfig.h.

◆ IdentifyingPassPtr() [3/3]

llvm::IdentifyingPassPtr::IdentifyingPassPtr ( Pass InstancePtr)

Definition at line 62 of file TargetPassConfig.h.

Member Function Documentation

◆ getID()

AnalysisID llvm::IdentifyingPassPtr::getID ( ) const

◆ getInstance()

Pass* llvm::IdentifyingPassPtr::getInstance ( ) const

◆ isInstance()

bool llvm::IdentifyingPassPtr::isInstance ( ) const

◆ isValid()

bool llvm::IdentifyingPassPtr::isValid ( ) const

Member Data Documentation

◆ ID

AnalysisID llvm::IdentifyingPassPtr::ID

Definition at line 54 of file TargetPassConfig.h.

◆ P

Pass* llvm::IdentifyingPassPtr::P

Definition at line 55 of file TargetPassConfig.h.

The documentation for this class was generated from the following file: