mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-01 00:33:09 +00:00
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
This commit is contained in:
parent
0a229ed79a
commit
1885da4f49
@ -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];
|
||||
}
|
||||
|
||||
|
@ -19,12 +19,23 @@
|
||||
|
||||
//************************ Class Implementations **************************/
|
||||
|
||||
|
||||
// Constructor for instructions with fixed #operands (nearly all)
|
||||
MachineInstr::MachineInstr(MachineOpCode _opCode,
|
||||
OpCodeMask _opCodeMask)
|
||||
: opCode(_opCode),
|
||||
opCodeMask(_opCodeMask),
|
||||
operands(TargetInstrDescriptors[_opCode].numOperands)
|
||||
{
|
||||
assert(TargetInstrDescriptors[_opCode].numOperands >= 0);
|
||||
}
|
||||
|
||||
// Constructor for instructions with variable #operands
|
||||
MachineInstr::MachineInstr(MachineOpCode _opCode,
|
||||
unsigned numOperands,
|
||||
OpCodeMask _opCodeMask)
|
||||
: opCode(_opCode),
|
||||
opCodeMask(_opCodeMask),
|
||||
operands(numOperands)
|
||||
{
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user