summaryrefslogtreecommitdiffstats
path: root/llvm/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
commitc3f3da3d214d8fe32f64bfb22060f20b026ca5e9 (patch)
tree374f63459b00967c6ac07917cdd6b87e2321e0e9 /llvm/lib/IR/PassManager.cpp
parenta3374446d46ccc9d15701a88a5d42a3303258e38 (diff)
downloadbcm5719-llvm-c3f3da3d214d8fe32f64bfb22060f20b026ca5e9.tar.gz
bcm5719-llvm-c3f3da3d214d8fe32f64bfb22060f20b026ca5e9.zip
[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
Diffstat (limited to 'llvm/lib/IR/PassManager.cpp')
-rw-r--r--llvm/lib/IR/PassManager.cpp6
1 files changed, 3 insertions, 3 deletions
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<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());
}
OpenPOWER on IntegriCloud