diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2014-03-09 11:49:53 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2014-03-09 11:49:53 +0000 |
commit | 15903b7dc5cc31c529010b659eab326fd7565671 (patch) | |
tree | 82d81575fa271917df863d8a10455deacc7e37e7 /tools/opt | |
parent | fee1963538a3148f3f31dd91dc9a2cc4ffb40a2d (diff) | |
download | llvm-15903b7dc5cc31c529010b659eab326fd7565671.tar.gz llvm-15903b7dc5cc31c529010b659eab326fd7565671.tar.bz2 llvm-15903b7dc5cc31c529010b659eab326fd7565671.tar.xz |
[PM] Switch new pass manager from polymorphic_ptr to unique_ptr now that
it is available. Also make the move semantics sufficiently correct to
tolerate move-only passes, as the PassManagers *are* move-only passes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203391 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/opt')
-rw-r--r-- | tools/opt/Passes.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tools/opt/Passes.cpp b/tools/opt/Passes.cpp index ca143042f6..ffdf9bfec1 100644 --- a/tools/opt/Passes.cpp +++ b/tools/opt/Passes.cpp @@ -101,7 +101,7 @@ static bool parseFunctionPassPipeline(FunctionPassManager &FPM, PipelineText = PipelineText.substr(1); // Add the nested pass manager with the appropriate adaptor. - FPM.addPass(NestedFPM); + FPM.addPass(std::move(NestedFPM)); } else { // Otherwise try to parse a pass name. size_t End = PipelineText.find_first_of(",)"); @@ -138,7 +138,7 @@ static bool parseModulePassPipeline(ModulePassManager &MPM, PipelineText = PipelineText.substr(1); // Now add the nested manager as a module pass. - MPM.addPass(NestedMPM); + MPM.addPass(std::move(NestedMPM)); } else if (PipelineText.startswith("function(")) { FunctionPassManager NestedFPM; @@ -151,7 +151,7 @@ static bool parseModulePassPipeline(ModulePassManager &MPM, PipelineText = PipelineText.substr(1); // Add the nested pass manager with the appropriate adaptor. - MPM.addPass(createModuleToFunctionPassAdaptor(NestedFPM)); + MPM.addPass(createModuleToFunctionPassAdaptor(std::move(NestedFPM))); } else { // Otherwise try to parse a pass name. size_t End = PipelineText.find_first_of(",)"); @@ -185,7 +185,7 @@ bool llvm::parsePassPipeline(ModulePassManager &MPM, StringRef PipelineText, if (!parseFunctionPassPipeline(FPM, PipelineText, VerifyEachPass) || !PipelineText.empty()) return false; - MPM.addPass(createModuleToFunctionPassAdaptor(FPM)); + MPM.addPass(createModuleToFunctionPassAdaptor(std::move(FPM))); return true; } @@ -201,7 +201,7 @@ bool llvm::parsePassPipeline(ModulePassManager &MPM, StringRef PipelineText, if (!parseFunctionPassPipeline(FPM, PipelineText, VerifyEachPass) || !PipelineText.empty()) return false; - MPM.addPass(createModuleToFunctionPassAdaptor(FPM)); + MPM.addPass(createModuleToFunctionPassAdaptor(std::move(FPM))); return true; } |