llvm.org GIT mirror llvm / 7e6723e
[PM] Simplify how we use the registry by including it only once. Still more verbose than I'd like, but the code really isn't that interesting, and this still seems vastly simpler than any other solutions I've come up with. =] Maybe if we get to the 10th IR unit, this will be a problem in practice. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225245 91177308-0d34-0410-b5e6-96231b3b80d8 Chandler Carruth 4 years ago
1 changed file(s) with 0 addition(s) and 18 deletion(s). Raw diff Collapse all Expand all
103103
104104 static bool isModulePassName(StringRef Name) {
105105 #define MODULE_PASS(NAME, CREATE_PASS) if (Name == NAME) return true;
106 #include "PassRegistry.def"
107
108 // We also support building a require pass around any analysis.
109106 #define MODULE_ANALYSIS(NAME, CREATE_PASS) \
110107 if (Name == "require<" NAME ">") \
111108 return true;
116113
117114 static bool isCGSCCPassName(StringRef Name) {
118115 #define CGSCC_PASS(NAME, CREATE_PASS) if (Name == NAME) return true;
119 #include "PassRegistry.def"
120
121 // We also support building a require pass around any analysis.
122116 #define CGSCC_ANALYSIS(NAME, CREATE_PASS) \
123117 if (Name == "require<" NAME ">") \
124118 return true;
129123
130124 static bool isFunctionPassName(StringRef Name) {
131125 #define FUNCTION_PASS(NAME, CREATE_PASS) if (Name == NAME) return true;
132 #include "PassRegistry.def"
133
134 // We also support building a require pass around any analysis.
135126 #define FUNCTION_ANALYSIS(NAME, CREATE_PASS) \
136127 if (Name == "require<" NAME ">") \
137128 return true;
146137 MPM.addPass(CREATE_PASS); \
147138 return true; \
148139 }
149 #include "PassRegistry.def"
150
151 // We also support building a require pass around any analysis.
152140 #define MODULE_ANALYSIS(NAME, CREATE_PASS) \
153141 if (Name == "require<" NAME ">") { \
154142 MPM.addPass(NoopAnalysisRequirementPass()); \
165153 CGPM.addPass(CREATE_PASS); \
166154 return true; \
167155 }
168 #include "PassRegistry.def"
169
170 // We also support building a require pass around any analysis.
171156 #define CGSCC_ANALYSIS(NAME, CREATE_PASS) \
172157 if (Name == "require<" NAME ">") { \
173158 CGPM.addPass(NoopAnalysisRequirementPass()); \
184169 FPM.addPass(CREATE_PASS); \
185170 return true; \
186171 }
187 #include "PassRegistry.def"
188
189 // We also support building a require pass around any analysis.
190172 #define FUNCTION_ANALYSIS(NAME, CREATE_PASS) \
191173 if (Name == "require<" NAME ">") { \
192174 FPM.addPass(NoopAnalysisRequirementPass()); \