Reputation: 165
I have the following LLVM IR
%6 = load i32** %imw, align 8
%arrayidx = getelementptr inbounds i32* %6, i64 10
I want to extract i32
from these instructions in my LLVM pass. Can anyone guide me on how can I go about doing this?
Upvotes: 5
Views: 4040
Reputation: 34391
First you access an operand you are interested in with instruction->getOperand(i)
and then call ->getType()
on it. The llvm::Type
class has a lot of helper classes and ->isPointerTy()
is what you are probably interested in.
Upvotes: 3