[llvm-dev] type information about instruction

Tim Northover via llvm-dev llvm-dev at lists.llvm.org
Fri Jul 21 08:03:10 PDT 2017

On 21 July 2017 at 07:52, Anastasiya Ruzhanskaya
<anastasiya.ruzhanskaya at frtk.ru> wrote:
> Thank you for the answer. So, as I understood, to get the type of the "or"
> instruction (which I cannot access further as Value , because it is actually
> a dead instruction), I should get the type of one of its' operands, yes?

The Type of the "or" instruction should be fine without messing around
with operands, whether it's dead or not.

First, make sure you're looking at the Instruction you think you are
(sounds obvious, but I'm frequently not) by calling dump: "I->dump()"
either in the actual C++ or in a debugger. You can also dump the Type
itself to make sure it's i32. The more sanity checks the better!

Other than that, what function are you using to get the size?



More information about the llvm-dev mailing list