diff options
author | Dan Gohman <gohman@apple.com> | 2009-07-24 18:13:53 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2009-07-24 18:13:53 +0000 |
commit | 02a436c48ecff9e34d50ce0a2f861e5acdd9bf3f (patch) | |
tree | 1391c877e3f025721f7458adab62a96758eff919 /lib/Transforms/IPO/Inliner.cpp | |
parent | 6b118a2122f8f7da954fbfbcdec05c331e3fd625 (diff) |
Convert several more passes to use getAnalysisIfAvailable<TargetData>()
instead of getAnalysis<TargetData>().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76982 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/IPO/Inliner.cpp')
-rw-r--r-- | lib/Transforms/IPO/Inliner.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/Transforms/IPO/Inliner.cpp b/lib/Transforms/IPO/Inliner.cpp index e874a98b8d..34cbd961f2 100644 --- a/lib/Transforms/IPO/Inliner.cpp +++ b/lib/Transforms/IPO/Inliner.cpp @@ -45,7 +45,6 @@ Inliner::Inliner(void *ID, int Threshold) /// the call graph. If the derived class implements this method, it should /// always explicitly call the implementation here. void Inliner::getAnalysisUsage(AnalysisUsage &Info) const { - Info.addRequired<TargetData>(); CallGraphSCCPass::getAnalysisUsage(Info); } @@ -53,11 +52,11 @@ void Inliner::getAnalysisUsage(AnalysisUsage &Info) const { // do so and update the CallGraph for this operation. bool Inliner::InlineCallIfPossible(CallSite CS, CallGraph &CG, const SmallPtrSet<Function*, 8> &SCCFunctions, - const TargetData &TD) { + const TargetData *TD) { Function *Callee = CS.getCalledFunction(); Function *Caller = CS.getCaller(); - if (!InlineFunction(CS, &CG, &TD)) return false; + if (!InlineFunction(CS, &CG, TD)) return false; // If the inlined function had a higher stack protection level than the // calling function, then bump up the caller's stack protection level. @@ -127,7 +126,7 @@ bool Inliner::shouldInline(CallSite CS) { bool Inliner::runOnSCC(const std::vector<CallGraphNode*> &SCC) { CallGraph &CG = getAnalysis<CallGraph>(); - TargetData &TD = getAnalysis<TargetData>(); + const TargetData *TD = getAnalysisIfAvailable<TargetData>(); SmallPtrSet<Function*, 8> SCCFunctions; DOUT << "Inliner visiting SCC:"; |