Hi all,
I am trying to extract the operands from an instruction, for that i am iterating over the operand list as defined by the user class.
for (User::op_iterator O = i->op_begin() ;O != i->op_end(); ++O)
{
Value *v = *O;
llvm::cout << v->getNameStr() ;
}
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.
Is there anyway I can display/extract these constant values from the instruction ?
Another question:
For and example IR like below,
%tmp6 = load i32* @glob_var, align 4 ; [#uses=1]
How can i extract the name of the instruction i.e. %tmp6
Regards
Prabhat