I am using BasicBlock iterator to iterate over the instructions in the basic block. Does the Instruction class provide any direct methods to check whether the instruction is an ‘and’ or ‘or’ instruction. If not, is any typecasting necessary?
I am using BasicBlock iterator to iterate over the instructions in the basic block.
Share
There is
Instruction *I; I->getOpcode()methodCasting is not needed when BasicBlock is iterated. It is needed when iterator may return not an Instruction, e.g. when iterating over def-use structures.
Usage is like:
Documentation used to write this answer: http://llvm.org/docs/ProgrammersManual.html