diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2014-01-11 12:06:47 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2014-01-11 12:06:47 +0000 |
commit | 258dbb3b12af12293926c05a78ef2850d3f9e8fb (patch) | |
tree | 9aa9f385f44b62ff44ad99990abcbcdf7faa0fff /llvm/tools/opt/Passes.cpp | |
parent | a13f27cc3405c71e8e8b702e8f3ce19a2fa73cb5 (diff) | |
download | bcm5719-llvm-258dbb3b12af12293926c05a78ef2850d3f9e8fb.tar.gz bcm5719-llvm-258dbb3b12af12293926c05a78ef2850d3f9e8fb.zip |
[PM] Actually nest pass managers correctly when parsing the pass
pipeline string. Add tests that cover this now that we have execution
dumping in the pass managers.
llvm-svn: 199005
Diffstat (limited to 'llvm/tools/opt/Passes.cpp')
-rw-r--r-- | llvm/tools/opt/Passes.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/llvm/tools/opt/Passes.cpp b/llvm/tools/opt/Passes.cpp index d58acaf1f6d..44b3acee593 100644 --- a/llvm/tools/opt/Passes.cpp +++ b/llvm/tools/opt/Passes.cpp @@ -51,11 +51,17 @@ static bool parseModulePassPipeline(ModulePassManager &MPM, for (;;) { // Parse nested pass managers by recursing. if (PipelineText.startswith("module(")) { + ModulePassManager NestedMPM; + + // Parse the inner pipeline into the nested manager. PipelineText = PipelineText.substr(strlen("module(")); - if (!parseModulePassPipeline(MPM, PipelineText)) + if (!parseModulePassPipeline(NestedMPM, PipelineText)) return false; assert(!PipelineText.empty() && PipelineText[0] == ')'); PipelineText = PipelineText.substr(1); + + // Now add the nested manager as a module pass. + MPM.addPass(NestedMPM); } else { // Otherwise try to parse a pass name. size_t End = PipelineText.find_first_of(",)"); |