The getParent function is a member function of the MachineInstr class in C++, which is used to get the parent instruction of a given instruction. The instruction's parent is the basic block containing the instruction.
Code Example 1:
llvm::MachineInstr *MI; // Suppose MI is a pointer to MachineInstr llvm::MachineBasicBlock *MBB = MI->getParent(); // Get the parent basic block of MI
In this example, MachineInstr pointer MI is used to get the parent basic block of MI using the getParent function.
Code Example 2:
llvm::MachineBasicBlock::iterator I; // Suppose I is an iterator over a MachineBasicBlock llvm::MachineBasicBlock *MBB = I->getParent(); // Get the parent basic block of I
In this example, an iterator I is used to get the parent basic block of I using the getParent function.
Package/Library:
The getParent function is a part of LLVM's MachineInstr class, which is defined in the LLVM Core library. Therefore, this function belongs to the LLVM Core library.
C++ (Cpp) MachineInstr::getParent - 30 examples found. These are the top rated real world C++ (Cpp) examples of MachineInstr::getParent extracted from open source projects. You can rate examples to help us improve the quality of examples.