Update the callgraph correctly.

llvm-svn: 55896
This commit is contained in:
Duncan Sands 2008-09-08 11:08:09 +00:00
parent 62431a29a5
commit 0fcef7437c

View File

@ -252,7 +252,7 @@ Function *SRETPromotion::cloneFunctionBody(Function *F,
/// updateCallSites - Update all sites that call F to use NF.
void SRETPromotion::updateCallSites(Function *F, Function *NF) {
CallGraph &CG = getAnalysis<CallGraph>();
SmallVector<Value*, 16> Args;
// ParamAttrs - Keep track of the parameter attributes for the arguments.
@ -303,6 +303,9 @@ void SRETPromotion::updateCallSites(Function *F, Function *NF) {
ArgAttrsVec.clear();
New->takeName(Call);
// Update the callgraph to know that the callsite has been transformed.
CG[Call->getParent()->getParent()]->replaceCallSite(Call, New);
// Update all users of sret parameter to extract value using extractvalue.
for (Value::use_iterator UI = FirstCArg->use_begin(),
UE = FirstCArg->use_end(); UI != UE; ) {