Jeff Kunkel
2010-Oct-15 12:04 UTC
[LLVMdev] [LLVMDev] How do I add a branch to a MachineInstr?
I know this is simple, but I want to be 100 percent sure I am doing this correctly. Would the following code be enough to add a simple unconditional branch instruction to a machine instruction? Do I need to set some key items in the MachineBasicBlock too? Is there more documentation on this subject? MachineBasicBlock * mbb = mf->CreateMachineBasicBlock( 0 ); mbb->getNumber(); TargetInstrDesc tid; tid.Opcode = TID::Branch; tid.NumOperands = 1; MachineInstr * instr = mf->CreateMachineInstr( tid, DebugLoc() ); mbb->insert( mbb->end(), instr ); Thanks, Jeff Kunkel
Seemingly Similar Threads
- [LLVMdev] Being able to know the jitted code-size before emitting
- [LLVMdev] MachineBasicBlock insertion and use/def list update
- [LLVMdev] how to get MachineBasicBlock of a BasicBlock
- [LLVMdev] MachineBasicBlock insertion
- [LLVMdev] [LLVMDev] Has anyone written this?