summaryrefslogtreecommitdiffstats
path: root/llvm/tools/opt/Passes.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/tools/opt/Passes.cpp')
-rw-r--r--llvm/tools/opt/Passes.cpp42
1 files changed, 42 insertions, 0 deletions
diff --git a/llvm/tools/opt/Passes.cpp b/llvm/tools/opt/Passes.cpp
index 6ac044a0d05..d20becbe5ea 100644
--- a/llvm/tools/opt/Passes.cpp
+++ b/llvm/tools/opt/Passes.cpp
@@ -54,6 +54,12 @@ static bool isModulePassName(StringRef Name) {
#define MODULE_PASS(NAME, CREATE_PASS) if (Name == NAME) return true;
#include "PassRegistry.def"
+ // We also support building a require pass around any analysis.
+#define MODULE_ANALYSIS(NAME, CREATE_PASS) \
+ if (Name == "require<" NAME ">") \
+ return true;
+#include "PassRegistry.def"
+
return false;
}
@@ -63,6 +69,12 @@ static bool isCGSCCPassName(StringRef Name) {
#define CGSCC_PASS(NAME, CREATE_PASS) if (Name == NAME) return true;
#include "PassRegistry.def"
+ // We also support building a require pass around any analysis.
+#define CGSCC_ANALYSIS(NAME, CREATE_PASS) \
+ if (Name == "require<" NAME ">") \
+ return true;
+#include "PassRegistry.def"
+
return false;
}
@@ -72,6 +84,12 @@ static bool isFunctionPassName(StringRef Name) {
#define FUNCTION_PASS(NAME, CREATE_PASS) if (Name == NAME) return true;
#include "PassRegistry.def"
+ // We also support building a require pass around any analysis.
+#define FUNCTION_ANALYSIS(NAME, CREATE_PASS) \
+ if (Name == "require<" NAME ">") \
+ return true;
+#include "PassRegistry.def"
+
return false;
}
@@ -88,6 +106,14 @@ static bool parseModulePassName(ModulePassManager &MPM, StringRef Name) {
}
#include "PassRegistry.def"
+ // We also support building a require pass around any analysis.
+#define MODULE_ANALYSIS(NAME, CREATE_PASS) \
+ if (Name == "require<" NAME ">") { \
+ MPM.addPass(NoopAnalysisRequirementPass<decltype(CREATE_PASS)>()); \
+ return true; \
+ }
+#include "PassRegistry.def"
+
return false;
}
@@ -104,6 +130,14 @@ static bool parseCGSCCPassName(CGSCCPassManager &CGPM, StringRef Name) {
}
#include "PassRegistry.def"
+ // We also support building a require pass around any analysis.
+#define CGSCC_ANALYSIS(NAME, CREATE_PASS) \
+ if (Name == "require<" NAME ">") { \
+ CGPM.addPass(NoopAnalysisRequirementPass<decltype(CREATE_PASS)>()); \
+ return true; \
+ }
+#include "PassRegistry.def"
+
return false;
}
@@ -120,6 +154,14 @@ static bool parseFunctionPassName(FunctionPassManager &FPM, StringRef Name) {
}
#include "PassRegistry.def"
+ // We also support building a require pass around any analysis.
+#define FUNCTION_ANALYSIS(NAME, CREATE_PASS) \
+ if (Name == "require<" NAME ">") { \
+ FPM.addPass(NoopAnalysisRequirementPass<decltype(CREATE_PASS)>()); \
+ return true; \
+ }
+#include "PassRegistry.def"
+
return false;
}
OpenPOWER on IntegriCloud