[llvm] r200901 - [PM] Wire up the analysis managers in the opt driver. This isn't really
Chandler Carruth
chandlerc at gmail.com
Wed Feb 5 20:25:13 PST 2014
Author: chandlerc
Date: Wed Feb 5 22:25:13 2014
New Revision: 200901
URL: http://llvm.org/viewvc/llvm-project?rev=200901&view=rev
Log:
[PM] Wire up the analysis managers in the opt driver. This isn't really
necessary until we add analyses to the driver, but I have such an
analysis ready and wanted to split this out. This is actually exercised
by the existing tests of the new pass manager as the analysis managers
are cross-checked and validated by the function and module managers.
Modified:
llvm/trunk/tools/opt/NewPMDriver.cpp
Modified: llvm/trunk/tools/opt/NewPMDriver.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/opt/NewPMDriver.cpp?rev=200901&r1=200900&r2=200901&view=diff
==============================================================================
--- llvm/trunk/tools/opt/NewPMDriver.cpp (original)
+++ llvm/trunk/tools/opt/NewPMDriver.cpp Wed Feb 5 22:25:13 2014
@@ -32,8 +32,18 @@ using namespace opt_tool;
bool llvm::runPassPipeline(StringRef Arg0, LLVMContext &Context, Module &M,
tool_output_file *Out, StringRef PassPipeline,
OutputKind OK, VerifierKind VK) {
- ModulePassManager MPM;
+ FunctionAnalysisManager FAM;
+ ModuleAnalysisManager MAM;
+
+ // FIXME: Lift this registration of analysis passes into a .def file adjacent
+ // to the one used to associate names with passes.
+ MAM.registerPass(LazyCallGraphAnalysis());
+
+ // Cross register the analysis managers through their proxies.
+ MAM.registerPass(FunctionAnalysisManagerModuleProxy(FAM));
+ FAM.registerPass(ModuleAnalysisManagerFunctionProxy(MAM));
+ ModulePassManager MPM;
if (VK > VK_NoVerifier)
MPM.addPass(VerifierPass());
@@ -61,7 +71,7 @@ bool llvm::runPassPipeline(StringRef Arg
cl::PrintOptionValues();
// Now that we have all of the passes ready, run them.
- MPM.run(&M);
+ MPM.run(&M, &MAM);
// Declare success.
if (OK != OK_NoOutput)
More information about the llvm-commits
mailing list