[llvm-commits] [llvm] r55896 - /llvm/trunk/lib/Transforms/IPO/StructRetPromotion.cpp
Duncan Sands
baldrick at free.fr
Mon Sep 8 04:08:09 PDT 2008
Author: baldrick
Date: Mon Sep 8 06:08:09 2008
New Revision: 55896
URL: http://llvm.org/viewvc/llvm-project?rev=55896&view=rev
Log:
Update the callgraph correctly.
Modified:
llvm/trunk/lib/Transforms/IPO/StructRetPromotion.cpp
Modified: llvm/trunk/lib/Transforms/IPO/StructRetPromotion.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/StructRetPromotion.cpp?rev=55896&r1=55895&r2=55896&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/IPO/StructRetPromotion.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/StructRetPromotion.cpp Mon Sep 8 06:08:09 2008
@@ -252,7 +252,7 @@
/// 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 @@
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; ) {
More information about the llvm-commits
mailing list