llvm.org GIT mirror llvm / 4d3682b
[PM] Wire the analysis passes (such as they are) into the registry, and teach the opt driver to use it rather than a manual list. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206739 91177308-0d34-0410-b5e6-96231b3b80d8 Chandler Carruth 6 years ago
2 changed file(s) with 18 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
3535 FunctionAnalysisManager FAM;
3636 ModuleAnalysisManager MAM;
3737
38 // FIXME: Lift this registration of analysis passes into a .def file adjacent
39 // to the one used to associate names with passes.
40 MAM.registerPass(LazyCallGraphAnalysis());
38 #define MODULE_ANALYSIS(NAME, CREATE_PASS) \
39 MAM.registerPass(CREATE_PASS);
40 #include "PassRegistry.def"
41
42 #define FUNCTION_ANALYSIS(NAME, CREATE_PASS) \
43 FAM.registerPass(CREATE_PASS);
44 #include "PassRegistry.def"
4145
4246 // Cross register the analysis managers through their proxies.
4347 MAM.registerPass(FunctionAnalysisManagerModuleProxy(FAM));
1515
1616 // NOTE: NO INCLUDE GUARD DESIRED!
1717
18 #ifndef MODULE_ANALYSIS
19 #define MODULE_ANALYSIS(NAME, CREATE_PASS)
20 #endif
21 MODULE_ANALYSIS("lcg", LazyCallGraphAnalysis())
22 #undef MODULE_ANALYSIS
23
1824 #ifndef MODULE_PASS
1925 #define MODULE_PASS(NAME, CREATE_PASS)
2026 #endif
2228 MODULE_PASS("print-cg", LazyCallGraphPrinterPass(dbgs()))
2329 #undef MODULE_PASS
2430
31 #ifndef FUNCTION_ANALYSIS
32 #define FUNCTION_ANALYSIS(NAME, CREATE_PASS)
33 #endif
34 #undef FUNCTION_ANALYSIS
35
2536 #ifndef FUNCTION_PASS
2637 #define FUNCTION_PASS(NAME, CREATE_PASS)
2738 #endif