MachineOperand MO; if (MO.isJTI()) { // Operand is a Jump Table index // Do something } else { // Operand is not a Jump Table index // Do something else }
MachineBasicBlock *MBB = MI.getParent(); for (MachineBasicBlock::iterator I = MBB->begin(), E = MBB->end(); I != E; ++I) { if (I->isBranch()) { for (unsigned i = 0, e = I->getNumOperands(); i < e; ++i) { MachineOperand &MO = I->getOperand(i); if (MO.isJTI()) { // Operand is a Jump Table index // Do something } else { // Operand is not a Jump Table index // Do something else } } } }This code loops through all instructions in the current basic block of the machine function MI and checks whether any operands of branch instructions are Jump Table indexes using the isJTI function. The MachineOperand class is part of the LLVM Core library, which is distributed as the LLVM package. Therefore, the package library for the MachineOperand class is likely to be LLVM.