unique instruction ids

Hi All,
I am trying to find out whether llvm assigns unique numeric ids to instructions?

George

George Baah wrote:

Hi All,
   I am trying to find out whether llvm assigns unique numeric ids to
instructions?

No, we use the Instruction* wherever we want to refer to a unique instruction. I suppose you could cast that to an integer.

Nick

I am wondering whether the values of the casts are guaranteed to be unique for every instruction.

George

George Baah <georgebaah@gmail.com> writes:

I am wondering whether the values of the casts are guaranteed to be unique
for every instruction.

Of course! Otherwise two different pointers would point to the same
object.

Just be sure you cast to a integer type wide enough to not truncate the
pointer.