13 #ifndef LLVM_PASSINFO_H
14 #define LLVM_PASSINFO_H
32 typedef Pass* (*NormalCtor_t)();
36 const char *
const PassName;
37 const char *
const PassArgument;
39 const bool IsCFGOnlyPass;
40 const bool IsAnalysis;
41 const bool IsAnalysisGroup;
42 std::vector<const PassInfo*> ItfImpl;
53 : PassName(name), PassArgument(arg), PassID(pi),
54 IsCFGOnlyPass(isCFGOnly),
55 IsAnalysis(is_analysis), IsAnalysisGroup(
false), NormalCtor(normal),
56 TargetMachineCtor(machine) {}
61 : PassName(name), PassArgument(
""), PassID(pi),
63 IsAnalysis(
false), IsAnalysisGroup(
true), NormalCtor(nullptr),
64 TargetMachineCtor(nullptr) {}
82 return PassID == IDPtr;
113 TargetMachineCtor = Ctor;
119 "No default implementation found for analysis group!");
121 "Cannot call createPass on PassInfo without default ctor!");
130 ItfImpl.push_back(ItfPI);
141 void operator=(
const PassInfo &) =
delete;
Pass interface - Implemented by all 'passes'.
void setNormalCtor(NormalCtor_t Ctor)
const char * getPassName() const
getPassName - Return the friendly name for the pass, never returns null
TargetMachineCtor_t getTargetMachineCtor() const
getTargetMachineCtor - Return a pointer to a function, that when called with a TargetMachine, creates an instance of the pass and returns it.
const std::vector< const PassInfo * > & getInterfacesImplemented() const
getInterfacesImplemented - Return a list of all of the analysis group interfaces implemented by this ...
bool isCFGOnlyPass() const
isCFGOnlyPass - return true if this pass only looks at the CFG for the function.
const void * getTypeInfo() const
getTypeInfo - Return the id object for the pass...
Pass * createPass() const
createPass() - Use this method to create an instance of this pass.
void addInterfaceImplemented(const PassInfo *ItfPI)
addInterfaceImplemented - This method is called when this pass is registered as a member of an analys...
bool isAnalysisGroup() const
isAnalysisGroup - Return true if this is an analysis group, not a normal pass.
bool isPassID(const void *IDPtr) const
Return true if this PassID implements the specified ID pointer.
void setTargetMachineCtor(TargetMachineCtor_t Ctor)
NormalCtor_t getNormalCtor() const
getNormalCtor - Return a pointer to a function, that when called, creates an instance of the pass and...
PassInfo(const char *name, const void *pi)
PassInfo ctor - Do not call this directly, this should only be invoked through RegisterPass.
PassInfo(const char *name, const char *arg, const void *pi, NormalCtor_t normal, bool isCFGOnly, bool is_analysis, TargetMachineCtor_t machine=nullptr)
PassInfo ctor - Do not call this directly, this should only be invoked through RegisterPass.
PassInfo class - An instance of this class exists for every pass known by the system, and can be obtained from a live Pass by calling its getPassInfo() method.
Pass *(* TargetMachineCtor_t)(TargetMachine *)
const char * getPassArgument() const
getPassArgument - Return the command line option that may be passed to 'opt' that will cause this pas...
Primary interface to the complete machine description for the target machine.