Consider a simple ll code:
%2 = load i32* %y, align 4
I intend to get the memory address of %2.
// variable name:y
value v = I.getOperand(0);
// ? I shows the entire instruction, not %2, then I.getName() would print an empty space which is %2, but I can’t get the memory when dereferencing it
error: taking the address of an temporary object of type llvm::stringRef.
Please suggest what should I use to get the actual address of the register name %2.