summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2008-09-08 11:08:09 +0000
committerDuncan Sands <baldrick@free.fr>2008-09-08 11:08:09 +0000
commitb9a6f861b462c2f21c0938eba40c5261fb4ff2f4 (patch)
treefd5e87e6b44d2a117a2c9741964da0934a6fea3a /llvm/lib
parent3cf7d86556a1425b6dcae15ece9eebd1632dc22c (diff)
downloadbcm5719-llvm-b9a6f861b462c2f21c0938eba40c5261fb4ff2f4.tar.gz
bcm5719-llvm-b9a6f861b462c2f21c0938eba40c5261fb4ff2f4.zip
Update the callgraph correctly.
llvm-svn: 55896
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Transforms/IPO/StructRetPromotion.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/IPO/StructRetPromotion.cpp b/llvm/lib/Transforms/IPO/StructRetPromotion.cpp
index 2a7de3dc491..8e6415b2ab8 100644
--- a/llvm/lib/Transforms/IPO/StructRetPromotion.cpp
+++ b/llvm/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<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; ) {
OpenPOWER on IntegriCloud