[llvm-commits] CVS: llvm/include/llvm/CodeGen/MachineInstrBuilder.h
Chris Lattner
lattner at cs.uiuc.edu
Fri Dec 13 03:34:00 PST 2002
Changes in directory llvm/include/llvm/CodeGen:
MachineInstrBuilder.h updated: 1.7 -> 1.8
---
Log message:
Final version of BuildMI for symmetry and because I want to use it
---
Diffs of the changes:
Index: llvm/include/llvm/CodeGen/MachineInstrBuilder.h
diff -u llvm/include/llvm/CodeGen/MachineInstrBuilder.h:1.7 llvm/include/llvm/CodeGen/MachineInstrBuilder.h:1.8
--- llvm/include/llvm/CodeGen/MachineInstrBuilder.h:1.7 Sun Nov 17 15:56:10 2002
+++ llvm/include/llvm/CodeGen/MachineInstrBuilder.h Fri Dec 13 03:33:06 2002
@@ -91,6 +91,17 @@
return MachineInstrBuilder(new MachineInstr(Opcode, NumOperands, true, true));
}
+/// BuildMI - This version of the builder also sets up the first "operand" as a
+/// destination virtual register. NumOperands is the number of additional add*
+/// calls that are expected, it does not include the destination register.
+///
+inline MachineInstrBuilder BuildMI(MachineOpCode Opcode, unsigned NumOperands,
+ unsigned DestReg) {
+ return MachineInstrBuilder(new MachineInstr(Opcode, NumOperands+1,
+ true, true)).addReg(DestReg, MOTy::Def);
+}
+
+
/// BuildMI - This version of the builder inserts the built MachineInstr into
/// the specified MachineBasicBlock.
///
More information about the llvm-commits
mailing list