[llvm-commits] [poolalloc] r155780 - /poolalloc/trunk/lib/AssistDS/FuncSpec.cpp
Will Dietz
wdietz2 at illinois.edu
Sat Apr 28 17:13:21 PDT 2012
Author: wdietz2
Date: Sat Apr 28 19:13:21 2012
New Revision: 155780
URL: http://llvm.org/viewvc/llvm-project?rev=155780&view=rev
Log:
Update FuncSpec to not assume operand 0 is the callee of a CallInst.
Fixes 253.perlbmk and others.
Modified:
poolalloc/trunk/lib/AssistDS/FuncSpec.cpp
Modified: poolalloc/trunk/lib/AssistDS/FuncSpec.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/AssistDS/FuncSpec.cpp?rev=155780&r1=155779&r2=155780&view=diff
==============================================================================
--- poolalloc/trunk/lib/AssistDS/FuncSpec.cpp (original)
+++ poolalloc/trunk/lib/AssistDS/FuncSpec.cpp Sat Apr 28 19:13:21 2012
@@ -105,7 +105,9 @@
for (std::map<CallInst*, std::vector<std::pair<unsigned, Constant*> > >::iterator ii = cloneSites.begin(), ee = cloneSites.end(); ii != ee; ++ii) {
// Transform the call sites, to call the clones
- ii->first->setOperand(0, toClone[std::make_pair(cast<Function>(ii->first->getOperand(0)), ii->second)]);
+ Function *OldCallee = cast<Function>(ii->first->getCalledValue());
+ Function *NewCallee = toClone[std::make_pair(OldCallee, ii->second)];
+ ii->first->setCalledFunction(NewCallee);
++numReplaced;
}
More information about the llvm-commits
mailing list