[LLVMdev] Accessing instruction/operand names

Tanya M. Lattner tonic at nondot.org
Wed Apr 15 09:03:30 PDT 2009

> I can retrieve the opcodeName() from the Instruction object, which is
> "load". I can also access the operand and use getName() to retrieve
> "x_addr". However, this instruction is storing into %2 - how do I access the
> name of that?
> Also, when an operand is a numbered temporary such as
> %3 = add i32 %2, %1		; <i32> [#uses=1]
> I'm also unable to access the name of it. Are these numberings no longer
> present in the bitcode? If not, is there any way to find out the name of
> which local variable it is referencing?

I agree with everyone else that you should not be using names to track 
anything. But if you want names, you can run 'opt -instnamer' to assign 
names to annymous values. I would only recommend using that for debugging 
purposes though.


> Thanks in advance - I've been stuck on this for a while.
> Best,
> James
> -- 
> View this message in context: http://www.nabble.com/Accessing-instruction-operand-names-tp23058683p23058683.html
> Sent from the LLVM - Dev mailing list archive at Nabble.com.
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev

More information about the llvm-dev mailing list