aboutsummaryrefslogtreecommitdiff
path: root/include/llvm/CodeGen/MachineInstr.h
diff options
context:
space:
mode:
authorVikram S. Adve <vadve@cs.uiuc.edu>2001-07-31 21:49:28 +0000
committerVikram S. Adve <vadve@cs.uiuc.edu>2001-07-31 21:49:28 +0000
commit1885da4f49cf32efde2d4c840365c4333a0c8579 (patch)
tree6c92a224b0ad86ef35003f168d8cc89da0d6639d /include/llvm/CodeGen/MachineInstr.h
parent0a229ed79a1886340352e82be58e0536a454ac12 (diff)
Allow machine instructions with variable numbers of arguments.
This is used only by Phi for now. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@336 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/CodeGen/MachineInstr.h')
-rw-r--r--include/llvm/CodeGen/MachineInstr.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/llvm/CodeGen/MachineInstr.h b/include/llvm/CodeGen/MachineInstr.h
index a26c61accc..79efe36fb4 100644
--- a/include/llvm/CodeGen/MachineInstr.h
+++ b/include/llvm/CodeGen/MachineInstr.h
@@ -217,6 +217,9 @@ public:
public:
/*ctor*/ MachineInstr (MachineOpCode _opCode,
OpCodeMask _opCodeMask = 0x0);
+ /*ctor*/ MachineInstr (MachineOpCode _opCode,
+ unsigned numOperands,
+ OpCodeMask _opCodeMask = 0x0);
inline ~MachineInstr () {}
const MachineOpCode getOpCode () const;
@@ -260,12 +263,14 @@ MachineInstr::getNumOperands() const
inline MachineOperand&
MachineInstr::getOperand(unsigned int i)
{
+ assert(i < operands.size() && "getOperand() out of range!");
return operands[i];
}
inline const MachineOperand&
MachineInstr::getOperand(unsigned int i) const
{
+ assert(i < operands.size() && "getOperand() out of range!");
return operands[i];
}