[LLVMdev] Operand, instruction

Duncan Sands baldrick at free.fr
Sat Mar 27 10:21:38 PDT 2010


Hi,

> Can anyone tell how to get the result name or instruction name of all
> instruction? For example if the instruction is "x=add y,z", here i need "x".
> Using getName(), i am getting some instructions result name, but llvm
> produces some instruction like "%0=add i32 tmp, 1", here getName() shows
> empty string as result name.
> So please help.

as you have noticed, names are optional: instructions may not have names.
That said, you can give names to all instructions by running the instnamer
pass.

Ciao,

Duncan.



More information about the llvm-dev mailing list