diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2014-02-06 04:25:13 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2014-02-06 04:25:13 +0000 |
commit | c68d08241b6ca09abe48d4979eaf21f1b007116c (patch) | |
tree | d7cbf51242754dcc1df176ea8242eaaaac0a24c1 /llvm/tools | |
parent | fa0eba6c8b2b7abfd498476e65485e8c4f6a24af (diff) | |
download | bcm5719-llvm-c68d08241b6ca09abe48d4979eaf21f1b007116c.tar.gz bcm5719-llvm-c68d08241b6ca09abe48d4979eaf21f1b007116c.zip |
[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.
llvm-svn: 200901
Diffstat (limited to 'llvm/tools')
-rw-r--r-- | llvm/tools/opt/NewPMDriver.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/llvm/tools/opt/NewPMDriver.cpp b/llvm/tools/opt/NewPMDriver.cpp index f21a68fc8aa..313db544aba 100644 --- a/llvm/tools/opt/NewPMDriver.cpp +++ b/llvm/tools/opt/NewPMDriver.cpp @@ -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 Arg0, LLVMContext &Context, Module &M, 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) |