diff options
author | Chris Lattner <sabre@nondot.org> | 2002-12-13 09:33:06 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2002-12-13 09:33:06 +0000 |
commit | 367ccab06e77247eb38b0e666425913e39b82cf0 (patch) | |
tree | 8b2f79bbf505a525149f6e04ad0bb93fbfb6f100 /include/llvm/CodeGen/MachineInstrBuilder.h | |
parent | ed6902ca8991b895025a9a11ddeb200e7b5ae6ae (diff) |
Final version of BuildMI for symmetry and because I want to use it
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5000 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/CodeGen/MachineInstrBuilder.h')
-rw-r--r-- | include/llvm/CodeGen/MachineInstrBuilder.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/llvm/CodeGen/MachineInstrBuilder.h b/include/llvm/CodeGen/MachineInstrBuilder.h index 1d8edbe171..96f7359301 100644 --- a/include/llvm/CodeGen/MachineInstrBuilder.h +++ b/include/llvm/CodeGen/MachineInstrBuilder.h @@ -91,6 +91,17 @@ inline MachineInstrBuilder BuildMI(MachineOpCode Opcode, unsigned NumOperands) { 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. /// |