From c3f3da3d214d8fe32f64bfb22060f20b026ca5e9 Mon Sep 17 00:00:00 2001 From: Chandler Carruth Date: Sun, 9 Mar 2014 11:49:53 +0000 Subject: [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. llvm-svn: 203391 --- llvm/lib/IR/PassManager.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'llvm/lib/IR/PassManager.cpp') diff --git a/llvm/lib/IR/PassManager.cpp b/llvm/lib/IR/PassManager.cpp index 288940b2923..8d0044e7f96 100644 --- a/llvm/lib/IR/PassManager.cpp +++ b/llvm/lib/IR/PassManager.cpp @@ -45,12 +45,12 @@ ModuleAnalysisManager::getResultImpl(void *PassID, Module *M) { ModuleAnalysisResultMapT::iterator RI; bool Inserted; std::tie(RI, Inserted) = ModuleAnalysisResults.insert(std::make_pair( - PassID, polymorphic_ptr >())); + PassID, std::unique_ptr>())); // If we don't have a cached result for this module, look up the pass and run // it to produce a result, which we then add to the cache. if (Inserted) - RI->second = lookupPass(PassID).run(M, this); + RI->second = std::move(lookupPass(PassID).run(M, this)); return *RI->second; } @@ -122,7 +122,7 @@ FunctionAnalysisManager::getResultImpl(void *PassID, Function *F) { // run it to produce a result, which we then add to the cache. if (Inserted) { FunctionAnalysisResultListT &ResultList = FunctionAnalysisResultLists[F]; - ResultList.push_back(std::make_pair(PassID, lookupPass(PassID).run(F, this))); + ResultList.emplace_back(PassID, lookupPass(PassID).run(F, this)); RI->second = std::prev(ResultList.end()); } -- cgit v1.2.3