May 2015
Intermediate to advanced
296 pages
5h 10m
English
The MachineInstrBuilder class exposes a function called BuildMI(). This function is used to build machine instructions.
Machine instructions are created by using the BuildMI functions, located in the include/llvm/CodeGen/MachineInstrBuilder.h file. The BuildMI functions make it easy to build arbitrary machine instructions.
For example, you can use BuildMI in code snippets for the following purposes:
DestReg = mov 42 (rendered in the x86 assembly as mov DestReg, 42) instruction:MachineInstr *MI = BuildMI(X86::MOV32ri, 1, DestReg).addImm(42);
MachineBasicBlock &MBB = BuildMI(MBB, X86::MOV32ri, 1, DestReg).addImm(42); ...
Read now
Unlock full access