[LLVMdev] Extraction of constant operands from the instruction

Anton Korobeynikov asl at math.spbu.ru
Mon Jan 14 09:06:53 PST 2008


Hello,

> However, whenever there is a constant operand like a numerical value, it
> does not displays any value at all, i checked using the hasName() method,
> for the constant operands the hasName() returns 0.
Correct. Constant doesn't have name at all. You should check, whether
operand is a constant, cast the Value to Constant (for example, via
dyn_cast facility) and then use the Constant' methods to obtain the
exact value.

> How can i extract the name of the instruction i.e. %tmp6
getName() will return it.

--
WBR, Anton Korobeynikov 



More information about the llvm-dev mailing list