mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-21 23:17:16 +00:00
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:
@@ -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:";
|
||||
|
||||
Reference in New Issue
Block a user