For the LLVM IR instruction, for example %cmp7 = icmp eq i32 %6 %7, I want to get all three case / character names (i.e. %cmp %6 and %7)
Now I can get the line with the %cmpcommand pi->getName(), where pi is the instruction pointer. But when I try to get the oprand names, I got an empty string by typing pi->getOperand(0)->getName().
I tried to isa<Instruction>(pi->getOperand(0))check if this is an instruction, and it returned true, but pi->getOperand(0)->hasName()returns false. Things make me feel weird, why the two piand pi->getOperand(0)are instructions, but only pihas a name?
Are there any thoughts, I can get the name of the operand (the string %6and %7here) using the API?
The LLVM version I'm using is 3.4.2
source
share