MachineFunction MF(...); // create machine function object MachineBasicBlock *MBB = MF.CreateMachineBasicBlock(); // create new machine basic block // add instructions to MBB MF.push_back(MBB);
MachineFunction *MF = ...; // create machine function pointer MachineBasicBlock *MBB = MF->CreateMachineBasicBlock(); // create new machine basic block // add instructions to MBB MF->push_back(MBB);This example is similar to the first, but uses a pointer to a machine function object. We use the arrow operator to call CreateMachineBasicBlock and push_back on the pointer. Package Library: The CreateMachineBasicBlock function is part of the LLVM C++ API, which is a set of libraries that provide programmatic access to the LLVM compiler infrastructure. Specifically, this function is defined in the MachineFunction class, which is part of the LLVM Core library.