summaryrefslogtreecommitdiff
path: root/include/llvm/CodeGen/MachineInstr.h
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2006-11-30 07:08:44 +0000
committerEvan Cheng <evan.cheng@apple.com>2006-11-30 07:08:44 +0000
commit67f660cb080965ea93ed6d7265a67100f2fe38e4 (patch)
tree07ef475acfc5b383eebc2dee2f89b899a18168a3 /include/llvm/CodeGen/MachineInstr.h
parente8776d81f90bc7023b87a7eec876a82a343c7a25 (diff)
downloadllvm-67f660cb080965ea93ed6d7265a67100f2fe38e4.tar.gz
llvm-67f660cb080965ea93ed6d7265a67100f2fe38e4.tar.bz2
llvm-67f660cb080965ea93ed6d7265a67100f2fe38e4.tar.xz
- MachineInstr now keeps a ptr to TargetInstrDescriptor instead of Opcode.
- Remove the ugly TargetInstrDescriptors hack. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32032 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/CodeGen/MachineInstr.h')
-rw-r--r--include/llvm/CodeGen/MachineInstr.h17
1 files changed, 11 insertions, 6 deletions
diff --git a/include/llvm/CodeGen/MachineInstr.h b/include/llvm/CodeGen/MachineInstr.h
index 11a769c930..e347128031 100644
--- a/include/llvm/CodeGen/MachineInstr.h
+++ b/include/llvm/CodeGen/MachineInstr.h
@@ -299,7 +299,7 @@ public:
/// MachineInstr - Representation of each machine instruction.
///
class MachineInstr {
- short Opcode; // the opcode
+ const TargetInstrDescriptor *TID; // Instruction descriptor.
unsigned short NumImplicitOps; // Number of implicit operands (which
// are determined at construction time).
@@ -319,7 +319,7 @@ class MachineInstr {
public:
/// MachineInstr ctor - This constructor creates a dummy MachineInstr with
- /// opcode 0 and no operands.
+ /// TID NULL and no operands.
MachineInstr();
/// MachineInstr ctor - This constructor create a MachineInstr and add the
@@ -337,10 +337,14 @@ public:
const MachineBasicBlock* getParent() const { return parent; }
MachineBasicBlock* getParent() { return parent; }
+
+ /// getInstrDescriptor - Returns the target instruction descriptor of this
+ /// MachineInstr.
+ const TargetInstrDescriptor *getInstrDescriptor() const { return TID; }
/// getOpcode - Returns the opcode of this MachineInstr.
///
- const int getOpcode() const { return Opcode; }
+ const int getOpcode() const;
/// Access to explicit operands of the instruction.
///
@@ -500,9 +504,10 @@ public:
// Accessors used to modify instructions in place.
//
- /// setOpcode - Replace the opcode of the current instruction with a new one.
+ /// setInstrDescriptor - Replace the instruction descriptor (thus opcode) of
+ /// the current instruction with a new one.
///
- void setOpcode(unsigned Op) { Opcode = Op; }
+ void setInstrDescriptor(const TargetInstrDescriptor &tid) { TID = &tid; }
/// RemoveOperand - Erase an operand from an instruction, leaving it with one
/// fewer operand than it started with.
@@ -525,7 +530,7 @@ private:
/// addImplicitDefUseOperands - Add all implicit def and use operands to
/// this instruction.
- void addImplicitDefUseOperands(const TargetInstrDescriptor &TID);
+ void addImplicitDefUseOperands();
};
//===----------------------------------------------------------------------===//