mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-08 19:25:47 +00:00
Update the callgraph correctly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55896 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -252,7 +252,7 @@ Function *SRETPromotion::cloneFunctionBody(Function *F,
|
|||||||
|
|
||||||
/// updateCallSites - Update all sites that call F to use NF.
|
/// updateCallSites - Update all sites that call F to use NF.
|
||||||
void SRETPromotion::updateCallSites(Function *F, Function *NF) {
|
void SRETPromotion::updateCallSites(Function *F, Function *NF) {
|
||||||
|
CallGraph &CG = getAnalysis<CallGraph>();
|
||||||
SmallVector<Value*, 16> Args;
|
SmallVector<Value*, 16> Args;
|
||||||
|
|
||||||
// ParamAttrs - Keep track of the parameter attributes for the arguments.
|
// ParamAttrs - Keep track of the parameter attributes for the arguments.
|
||||||
@@ -303,6 +303,9 @@ void SRETPromotion::updateCallSites(Function *F, Function *NF) {
|
|||||||
ArgAttrsVec.clear();
|
ArgAttrsVec.clear();
|
||||||
New->takeName(Call);
|
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.
|
// Update all users of sret parameter to extract value using extractvalue.
|
||||||
for (Value::use_iterator UI = FirstCArg->use_begin(),
|
for (Value::use_iterator UI = FirstCArg->use_begin(),
|
||||||
UE = FirstCArg->use_end(); UI != UE; ) {
|
UE = FirstCArg->use_end(); UI != UE; ) {
|
||||||
|
Reference in New Issue
Block a user