summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2017-02-09 23:11:52 +0000
committerPeter Collingbourne <peter@pcc.me.uk>2017-02-09 23:11:52 +0000
commitcea1e4e79a76734bacbb76ab99ba267aca7e7499 (patch)
tree6f859607deed0df9b5f88be1494fc4fd371a82eb /llvm/lib/Transforms/IPO/ArgumentPromotion.cpp
parentf1e773cab5053b1d4907f940af7fdbcedad0e266 (diff)
downloadbcm5719-llvm-cea1e4e79a76734bacbb76ab99ba267aca7e7499.tar.gz
bcm5719-llvm-cea1e4e79a76734bacbb76ab99ba267aca7e7499.zip
De-duplicate some code for creating an AARGetter suitable for the legacy PM.
I'm about to use this in a couple more places. Differential Revision: https://reviews.llvm.org/D29793 llvm-svn: 294648
Diffstat (limited to 'llvm/lib/Transforms/IPO/ArgumentPromotion.cpp')
-rw-r--r--llvm/lib/Transforms/IPO/ArgumentPromotion.cpp11
1 files changed, 1 insertions, 10 deletions
diff --git a/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp b/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp
index a67332d067a..2e2f131f7ed 100644
--- a/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp
+++ b/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp
@@ -1001,16 +1001,7 @@ bool ArgPromotion::runOnSCC(CallGraphSCC &SCC) {
// changes.
CallGraph &CG = getAnalysis<CallGraphWrapperPass>().getCallGraph();
- // We compute dedicated AA results for each function in the SCC as needed. We
- // use a lambda referencing external objects so that they live long enough to
- // be queried, but we re-use them each time.
- Optional<BasicAAResult> BAR;
- Optional<AAResults> AAR;
- auto AARGetter = [&](Function &F) -> AAResults & {
- BAR.emplace(createLegacyPMBasicAAResult(*this, F));
- AAR.emplace(createLegacyPMAAResults(*this, F, *BAR));
- return *AAR;
- };
+ LegacyAARGetter AARGetter(*this);
bool Changed = false, LocalChange;
OpenPOWER on IntegriCloud