From a9c3251e6bb6b8c1ebd2ba5119adfb21cbbc434f Mon Sep 17 00:00:00 2001 From: Duncan Sands Date: Mon, 8 Sep 2008 11:08:09 +0000 Subject: Update the callgraph correctly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55896 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/IPO/StructRetPromotion.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lib/Transforms/IPO') diff --git a/lib/Transforms/IPO/StructRetPromotion.cpp b/lib/Transforms/IPO/StructRetPromotion.cpp index 2a7de3dc49..8e6415b2ab 100644 --- a/lib/Transforms/IPO/StructRetPromotion.cpp +++ b/lib/Transforms/IPO/StructRetPromotion.cpp @@ -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(); SmallVector 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; ) { -- cgit v1.2.3