<div class="gmail_quote">Hello Anton<br><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
> %1 = tail call i32 (i8*, ...)* @printf(i8* noalias getelementptr ([16 x<br>
> i8]* @.str, i32 0, i32 0), i32 %0) nounwind<br>
> %10 = call i32 (i8*, ...)* @printf(i8* noalias getelementptr ([11 x i8]*<br>
> @.str2, i32 0, i32 0), i32 5) nounwind<br>
><br>
> Instruction::isSameOperationAs() returns false for those two. Is it a<br>
> bug or I misunderstood something?<br>
These are two different instructions as you might see, thus - no bug :)</blockquote><div><br>OK, I just need the same signature for both of those instructions. <br><br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
<br>
> In any case I wrote my custom isSame() operator for this but I'll<br>
> appreciate any hints.<br>
Why do you need this? Won't be enough just to compare function types?</blockquote><div>I do something like this:<br><br>static bool areSame(Instruction *A, Instruction *B) {<br>  if (A->getOpcode() != B->getOpcode()) return false;<br>
  if (A->getType()->getTypeID() != B->getType()->getTypeID()) return false;<br>  unsigned int a = A->getNumOperands();<br>  if (a != B->getNumOperands()) return false;<br>  for (unsigned int i = 0; i < a; ++i)<br>
    if (A->getOperand(i)->getType()->getTypeID()<br>      != B->getOperand(i)->getType()->getTypeID()) return false;<br>  return true;<br>}<br><br>I'm not sure if it's too much.<br>Thanks!<br><br>
Artur<br><br>P.S. Sorry for that [Junk...] in few mails. It's our "great" antispammer, I will switch to gmail.<br></div></div>