summaryrefslogtreecommitdiff
path: root/lib/IR
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2014-02-05 21:41:42 +0000
committerChandler Carruth <chandlerc@gmail.com>2014-02-05 21:41:42 +0000
commit77b655c1c9b155441e34813223f172fa5a57891b (patch)
tree88b6c32da39fba9b5a09765aa336fd2233d00176 /lib/IR
parentf39297678b212ab5ee7885474762fc8c3f6c370f (diff)
downloadllvm-77b655c1c9b155441e34813223f172fa5a57891b.tar.gz
llvm-77b655c1c9b155441e34813223f172fa5a57891b.tar.bz2
llvm-77b655c1c9b155441e34813223f172fa5a57891b.tar.xz
[PM] Don't require analysis results to be const in the new pass manager.
I think this was just over-eagerness on my part. The analysis results need to often be non-const because they need to (in some cases at least) be updated by the transformation pass in order to remain correct. It also makes lazy analyses (a common case) needlessly annoying to write in order to make their entire state mutable. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200881 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/IR')
-rw-r--r--lib/IR/PassManager.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/IR/PassManager.cpp b/lib/IR/PassManager.cpp
index 70533fef58..dbc27cbc50 100644
--- a/lib/IR/PassManager.cpp
+++ b/lib/IR/PassManager.cpp
@@ -40,7 +40,7 @@ PreservedAnalyses ModulePassManager::run(Module *M, ModuleAnalysisManager *AM) {
return PA;
}
-const ModuleAnalysisManager::ResultConceptT &
+ModuleAnalysisManager::ResultConceptT &
ModuleAnalysisManager::getResultImpl(void *PassID, Module *M) {
ModuleAnalysisResultMapT::iterator RI;
bool Inserted;
@@ -55,7 +55,7 @@ ModuleAnalysisManager::getResultImpl(void *PassID, Module *M) {
return *RI->second;
}
-const ModuleAnalysisManager::ResultConceptT *
+ModuleAnalysisManager::ResultConceptT *
ModuleAnalysisManager::getCachedResultImpl(void *PassID, Module *M) const {
ModuleAnalysisResultMapT::const_iterator RI = ModuleAnalysisResults.find(PassID);
return RI == ModuleAnalysisResults.end() ? 0 : &*RI->second;
@@ -111,7 +111,7 @@ void FunctionAnalysisManager::clear() {
FunctionAnalysisResultLists.clear();
}
-const FunctionAnalysisManager::ResultConceptT &
+FunctionAnalysisManager::ResultConceptT &
FunctionAnalysisManager::getResultImpl(void *PassID, Function *F) {
FunctionAnalysisResultMapT::iterator RI;
bool Inserted;
@@ -129,7 +129,7 @@ FunctionAnalysisManager::getResultImpl(void *PassID, Function *F) {
return *RI->second->second;
}
-const FunctionAnalysisManager::ResultConceptT *
+FunctionAnalysisManager::ResultConceptT *
FunctionAnalysisManager::getCachedResultImpl(void *PassID, Function *F) const {
FunctionAnalysisResultMapT::const_iterator RI =
FunctionAnalysisResults.find(std::make_pair(PassID, F));