21 #ifndef LLVM_PASSSUPPORT_H 22 #define LLVM_PASSSUPPORT_H 34 #define INITIALIZE_PASS(passName, arg, name, cfg, analysis) \ 35 static void *initialize##passName##PassOnce(PassRegistry &Registry) { \ 36 PassInfo *PI = new PassInfo( \ 37 name, arg, &passName::ID, \ 38 PassInfo::NormalCtor_t(callDefaultCtor<passName>), cfg, analysis); \ 39 Registry.registerPass(*PI, true); \ 42 static llvm::once_flag Initialize##passName##PassFlag; \ 43 void llvm::initialize##passName##Pass(PassRegistry &Registry) { \ 44 llvm::call_once(Initialize##passName##PassFlag, \ 45 initialize##passName##PassOnce, std::ref(Registry)); \ 48 #define INITIALIZE_PASS_BEGIN(passName, arg, name, cfg, analysis) \ 49 static void *initialize##passName##PassOnce(PassRegistry &Registry) { 51 #define INITIALIZE_PASS_DEPENDENCY(depName) initialize##depName##Pass(Registry); 52 #define INITIALIZE_AG_DEPENDENCY(depName) \ 53 initialize##depName##AnalysisGroup(Registry); 55 #define INITIALIZE_PASS_END(passName, arg, name, cfg, analysis) \ 56 PassInfo *PI = new PassInfo( \ 57 name, arg, &passName::ID, \ 58 PassInfo::NormalCtor_t(callDefaultCtor<passName>), cfg, analysis); \ 59 Registry.registerPass(*PI, true); \ 62 static llvm::once_flag Initialize##passName##PassFlag; \ 63 void llvm::initialize##passName##Pass(PassRegistry &Registry) { \ 64 llvm::call_once(Initialize##passName##PassFlag, \ 65 initialize##passName##PassOnce, std::ref(Registry)); \ 68 #define INITIALIZE_PASS_WITH_OPTIONS(PassName, Arg, Name, Cfg, Analysis) \ 69 INITIALIZE_PASS_BEGIN(PassName, Arg, Name, Cfg, Analysis) \ 70 PassName::registerOptions(); \ 71 INITIALIZE_PASS_END(PassName, Arg, Name, Cfg, Analysis) 73 #define INITIALIZE_PASS_WITH_OPTIONS_BEGIN(PassName, Arg, Name, Cfg, Analysis) \ 74 INITIALIZE_PASS_BEGIN(PassName, Arg, Name, Cfg, Analysis) \ 75 PassName::registerOptions(); 94 bool is_analysis =
false)
123 const void *PassID =
nullptr,
bool isDefault =
false);
126 template <
typename Interface,
bool Default = false>
136 #define INITIALIZE_ANALYSIS_GROUP(agName, name, defaultPass) \ 137 static void *initialize##agName##AnalysisGroupOnce(PassRegistry &Registry) { \ 138 initialize##defaultPass##Pass(Registry); \ 139 PassInfo *AI = new PassInfo(name, &agName::ID); \ 140 Registry.registerAnalysisGroup(&agName::ID, 0, *AI, false, true); \ 143 static llvm::once_flag Initialize##agName##AnalysisGroupFlag; \ 144 void llvm::initialize##agName##AnalysisGroup(PassRegistry &Registry) { \ 145 llvm::call_once(Initialize##agName##AnalysisGroupFlag, \ 146 initialize##agName##AnalysisGroupOnce, \ 147 std::ref(Registry)); \ 150 #define INITIALIZE_AG_PASS(passName, agName, arg, name, cfg, analysis, def) \ 151 static void *initialize##passName##PassOnce(PassRegistry &Registry) { \ 153 initialize##agName##AnalysisGroup(Registry); \ 154 PassInfo *PI = new PassInfo( \ 155 name, arg, &passName::ID, \ 156 PassInfo::NormalCtor_t(callDefaultCtor<passName>), cfg, analysis); \ 157 Registry.registerPass(*PI, true); \ 159 PassInfo *AI = new PassInfo(name, &agName::ID); \ 160 Registry.registerAnalysisGroup(&agName::ID, &passName::ID, *AI, def, \ 164 static llvm::once_flag Initialize##passName##PassFlag; \ 165 void llvm::initialize##passName##Pass(PassRegistry &Registry) { \ 166 llvm::call_once(Initialize##passName##PassFlag, \ 167 initialize##passName##PassOnce, std::ref(Registry)); \ 170 #define INITIALIZE_AG_PASS_BEGIN(passName, agName, arg, n, cfg, analysis, def) \ 171 static void *initialize##passName##PassOnce(PassRegistry &Registry) { \ 173 initialize##agName##AnalysisGroup(Registry); 175 #define INITIALIZE_AG_PASS_END(passName, agName, arg, n, cfg, analysis, def) \ 176 PassInfo *PI = new PassInfo( \ 177 n, arg, &passName::ID, \ 178 PassInfo::NormalCtor_t(callDefaultCtor<passName>), cfg, analysis); \ 179 Registry.registerPass(*PI, true); \ 181 PassInfo *AI = new PassInfo(n, &agName::ID); \ 182 Registry.registerAnalysisGroup(&agName::ID, &passName::ID, *AI, def, true); \ 185 static llvm::once_flag Initialize##passName##PassFlag; \ 186 void llvm::initialize##passName##Pass(PassRegistry &Registry) { \ 187 llvm::call_once(Initialize##passName##PassFlag, \ 188 initialize##passName##PassOnce, std::ref(Registry)); \ 207 void enumeratePasses();
216 #endif // LLVM_PASSSUPPORT_H Pass interface - Implemented by all 'passes'.
RegisterPass<t> template - This template class is used to notify the system that a Pass is available ...
static PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
This class represents lattice values for constants.
RegisterPass(StringRef PassArg, StringRef Name, bool CFGOnly=false, bool is_analysis=false)
amdgpu Simplify well known AMD library false Value Value const Twine & Name
RegisterAnalysisGroup(const char *Name)
virtual void passRegistered(const PassInfo *)
Callback functions - These functions are invoked whenever a pass is loaded or removed from the curren...
const void * getTypeInfo() const
getTypeInfo - Return the id object for the pass...
virtual void passEnumerate(const PassInfo *)
passEnumerate - Callback function invoked when someone calls enumeratePasses on this PassRegistration...
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.
print lazy value Lazy Value Info Printer Pass
RegisterAnalysisGroup - Register a Pass as a member of an analysis group.
StringRef getPassName() const
getPassName - Return the friendly name for the pass, never returns null
PassRegistrationListener class - This class is meant to be derived from by clients that are intereste...
StringRef - Represent a constant reference to a string, i.e.
void registerPass(const PassInfo &PI, bool ShouldFree=false)
registerPass - Register a pass (by means of its PassInfo) with the registry.
RegisterAnalysisGroup(PassInfo &RPB)