summaryrefslogtreecommitdiff
path: root/lib/IR/PassManager.cpp
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2014-03-09 11:49:53 +0000
committerChandler Carruth <chandlerc@gmail.com>2014-03-09 11:49:53 +0000
commit15903b7dc5cc31c529010b659eab326fd7565671 (patch)
tree82d81575fa271917df863d8a10455deacc7e37e7 /lib/IR/PassManager.cpp
parentfee1963538a3148f3f31dd91dc9a2cc4ffb40a2d (diff)
downloadllvm-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 'lib/IR/PassManager.cpp')
-rw-r--r--lib/IR/PassManager.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/IR/PassManager.cpp b/lib/IR/PassManager.cpp
index 288940b292..8d0044e7f9 100644
--- a/lib/IR/PassManager.cpp
+++ b/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<detail::AnalysisResultConcept<Module *> >()));
+ PassID, std::unique_ptr<detail::AnalysisResultConcept<Module *>>()));
// 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());
}