Fix error where it wasn't getting the correct caller function.

llvm-svn: 59758
This commit is contained in:
Bill Wendling 2008-11-21 00:09:21 +00:00
parent 26c6a3e736
commit f5260d29c2
1 changed files with 2 additions and 1 deletions

View File

@ -54,11 +54,12 @@ static bool InlineCallIfPossible(CallSite CS, CallGraph &CG,
const std::set<Function*> &SCCFunctions,
const TargetData &TD) {
Function *Callee = CS.getCalledFunction();
Function *Caller = CS.getCaller();
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.
Function *Caller = CS.getCaller();
if (Callee->hasFnAttr(Attribute::StackProtectReq))
Caller->addFnAttr(Attribute::StackProtectReq);
else if (Callee->hasFnAttr(Attribute::StackProtect) &&