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 | 08be87bdfa834371299c590f6042671df3abfd8a (patch) | |
tree | 0f10d0ff37a4cf7ef0919437c54f7a0e4f89c007 /tools/opt | |
parent | b56749c3b7bd3867d5a500b9882decd957244620 (diff) | |
download | llvm-08be87bdfa834371299c590f6042671df3abfd8a.tar.gz llvm-08be87bdfa834371299c590f6042671df3abfd8a.tar.bz2 llvm-08be87bdfa834371299c590f6042671df3abfd8a.tar.xz |
[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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199005 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/opt')
-rw-r--r-- | tools/opt/Passes.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tools/opt/Passes.cpp b/tools/opt/Passes.cpp index d58acaf1f6..44b3acee59 100644 --- a/tools/opt/Passes.cpp +++ b/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(",)"); |