<div dir="ltr"><div class="gmail_quote"><br><br><br><div><div clear="all">I implement the following function,which gets <font face="Consolas">CallInst * and </font>should perform the following:</div><ol><li><div clear="all">

Change the value of the argument if  condition1 takes place</div>
</li><li><div clear="all">Change the type of the argument if condition2 takes place</div></li><li><div clear="all">Add addition argument/s if condition3 takes place</div></li><div clear="all"> </div></ol><div clear="all">


void
argChange(<font face="Consolas"><font face="Consolas">CallInst *</font></font> I)</div></div><div> {
   </div><blockquote style="margin-right:0px" dir="ltr"><div>for (unsigned index = 0; index < I->getNumOperands(); ++index) {
      </div><div>do_something_with (I->getOperand(index),condition);
   </div></blockquote><div>            }</div><div>
}
</div><div>I think that the 1. can be implemented using I->setOperand(index,newValue)</div><div>Can anyone advice me how 2. & 3. could be implemented.</div><span class="HOEnZb"><font color="#888888"><div><br></div>

<div>
 </div>
</font></span></div><br></div>