[LLVMdev] Changing the operands in the CallInst

Yakov Malinkovich yakovm3 at gmail.com
Tue Dec 13 08:18:58 PST 2011

I implement the following function,which gets CallInst * and should perform
the following:

   1. Change the value of the argument if  condition1 takes place
   2. Change the type of the argument if condition2 takes place
   3. Add addition argument/s if condition3 takes place

void argChange(CallInst * I)

for (unsigned index = 0; index < I->getNumOperands(); ++index) {
do_something_with (I->getOperand(index),condition);

I think that the 1. can be implemented using I->setOperand(index,newValue)
Can anyone advice me how 2. & 3. could be implemented.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20111213/34d22095/attachment.html>

More information about the llvm-dev mailing list