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
This commit is contained in:
Dan Gohman
2009-07-24 18:13:53 +00:00
parent 6b118a2122
commit 02a436c48e
5 changed files with 33 additions and 32 deletions
+3 -4
View File
@@ -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:";