20#if !defined(LLVM_PASS_H) || defined(LLVM_PASSSUPPORT_H)
21#error "Do not include <PassSupport.h>; include <Pass.h> instead"
24#ifndef LLVM_PASSSUPPORT_H
25#define LLVM_PASSSUPPORT_H
38#define INITIALIZE_PASS(passName, arg, name, cfg, analysis) \
39 static void *initialize##passName##PassOnce(PassRegistry &Registry) { \
40 PassInfo *PI = new PassInfo( \
41 name, arg, &passName::ID, \
42 PassInfo::NormalCtor_t(callDefaultCtor<passName>), cfg, analysis); \
43 Registry.registerPass(*PI, true); \
46 static llvm::once_flag Initialize##passName##PassFlag; \
47 void llvm::initialize##passName##Pass(PassRegistry &Registry) { \
48 llvm::call_once(Initialize##passName##PassFlag, \
49 initialize##passName##PassOnce, std::ref(Registry)); \
52#define INITIALIZE_PASS_BEGIN(passName, arg, name, cfg, analysis) \
53 static void *initialize##passName##PassOnce(PassRegistry &Registry) {
55#define INITIALIZE_PASS_DEPENDENCY(depName) initialize##depName##Pass(Registry);
57#define INITIALIZE_PASS_END(passName, arg, name, cfg, analysis) \
58 PassInfo *PI = new PassInfo( \
59 name, arg, &passName::ID, \
60 PassInfo::NormalCtor_t(callDefaultCtor<passName>), cfg, analysis); \
61 Registry.registerPass(*PI, true); \
64 static llvm::once_flag Initialize##passName##PassFlag; \
65 void llvm::initialize##passName##Pass(PassRegistry &Registry) { \
66 llvm::call_once(Initialize##passName##PassFlag, \
67 initialize##passName##PassOnce, std::ref(Registry)); \
70#define INITIALIZE_PASS_WITH_OPTIONS(PassName, Arg, Name, Cfg, Analysis) \
71 INITIALIZE_PASS_BEGIN(PassName, Arg, Name, Cfg, Analysis) \
72 PassName::registerOptions(); \
73 INITIALIZE_PASS_END(PassName, Arg, Name, Cfg, Analysis)
75#define INITIALIZE_PASS_WITH_OPTIONS_BEGIN(PassName, Arg, Name, Cfg, Analysis) \
76 INITIALIZE_PASS_BEGIN(PassName, Arg, Name, Cfg, Analysis) \
77 PassName::registerOptions();
81 std::enable_if_t<std::is_default_constructible<PassName>{},
bool> =
true>
88 std::enable_if_t<!std::is_default_constructible<PassName>{},
bool> =
true>
110 bool is_analysis =
false)
aarch64 AArch64 CCMP Pass
static cl::opt< bool > CFGOnly("dot-mcfg-only", cl::init(false), cl::Hidden, cl::desc("Print only the CFG without blocks body"))
static const char PassName[]
PassInfo class - An instance of this class exists for every pass known by the system,...
static PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
void registerPass(const PassInfo &PI, bool ShouldFree=false)
registerPass - Register a pass (by means of its PassInfo) with the registry.
Pass interface - Implemented by all 'passes'.
StringRef - Represent a constant reference to a string, i.e.
This is an optimization pass for GlobalISel generic memory operations.
void report_fatal_error(Error Err, bool gen_crash_diag=true)
Report a serious error, calling any installed error handler.
PassRegistrationListener class - This class is meant to be derived from by clients that are intereste...
virtual void passRegistered(const PassInfo *)
Callback functions - These functions are invoked whenever a pass is loaded or removed from the curren...
PassRegistrationListener()=default
virtual void passEnumerate(const PassInfo *)
passEnumerate - Callback function invoked when someone calls enumeratePasses on this PassRegistration...
void enumeratePasses()
enumeratePasses - Iterate over the registered passes, calling the passEnumerate callback on each Pass...
virtual ~PassRegistrationListener()=default
RegisterPass<t> template - This template class is used to notify the system that a Pass is available ...
RegisterPass(StringRef PassArg, StringRef Name, bool CFGOnly=false, bool is_analysis=false)