From dddfcdc4783cc6fef837de2de47da3d6c3f16de3 Mon Sep 17 00:00:00 2001 From: "Vikram S. Adve" Date: Sun, 29 Sep 2002 22:55:45 +0000 Subject: [PATCH] Added several more helper functions for construction MachineInstrs. llvm-svn: 3983 --- include/llvm/CodeGen/InstrSelectionSupport.h | 26 ++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/include/llvm/CodeGen/InstrSelectionSupport.h b/include/llvm/CodeGen/InstrSelectionSupport.h index af30dc3e566..31ac3be9043 100644 --- a/include/llvm/CodeGen/InstrSelectionSupport.h +++ b/include/llvm/CodeGen/InstrSelectionSupport.h @@ -113,6 +113,32 @@ Create1OperandInstr(MachineOpCode opCode, Value* argVal1) return M; } +inline MachineInstr* +Create1OperandInstr_UImmed(MachineOpCode opCode, unsigned int unextendedImmed) +{ + MachineInstr* M = new MachineInstr(opCode); + M->SetMachineOperandConst(0, MachineOperand::MO_UnextendedImmed, + unextendedImmed); + return M; +} + +inline MachineInstr* +Create1OperandInstr_SImmed(MachineOpCode opCode, int signExtendedImmed) +{ + MachineInstr* M = new MachineInstr(opCode); + M->SetMachineOperandConst(0, MachineOperand::MO_SignExtendedImmed, + signExtendedImmed); + return M; +} + +inline MachineInstr* +Create1OperandInstr_Addr(MachineOpCode opCode, Value* label) +{ + MachineInstr* M = new MachineInstr(opCode); + M->SetMachineOperandVal(0, MachineOperand::MO_PCRelativeDisp, label); + return M; +} + inline MachineInstr* Create2OperandInstr(MachineOpCode opCode, Value* argVal1, Value* argVal2) {