diff options
author | Chris Lattner <sabre@nondot.org> | 2006-05-04 18:16:01 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2006-05-04 18:16:01 +0000 |
commit | 8b915b4ed2c6e43413937ac71c0cbcf476ad1a98 (patch) | |
tree | dc4cddca818202794ae10be1bf2bad36c8a6f344 /include/llvm | |
parent | 2d90ac7ca6117d3b160dde8a4f322c1079a6ffce (diff) |
Remove and simplify some more machineinstr/machineoperand stuff.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28105 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm')
-rw-r--r-- | include/llvm/CodeGen/MachineInstr.h | 30 | ||||
-rw-r--r-- | include/llvm/CodeGen/MachineInstrBuilder.h | 24 |
2 files changed, 10 insertions, 44 deletions
diff --git a/include/llvm/CodeGen/MachineInstr.h b/include/llvm/CodeGen/MachineInstr.h index 0cf822aa0e..fbb272f822 100644 --- a/include/llvm/CodeGen/MachineInstr.h +++ b/include/llvm/CodeGen/MachineInstr.h @@ -261,23 +261,8 @@ public: //===----------------------------------------------------------------------===// -// class MachineInstr -// -// Purpose: -// Representation of each machine instruction. -// -// MachineOpCode must be an enum, defined separately for each target. -// E.g., It is defined in SparcInstructionSelection.h for the SPARC. -// -// There are 2 kinds of operands: -// -// (1) Explicit operands of the machine instruction in vector operands[] -// -// (2) "Implicit operands" are values implicitly used or defined by the -// machine instruction, such as arguments to a CALL, return value of -// a CALL (if any), and return value of a RETURN. -//===----------------------------------------------------------------------===// - +/// MachineInstr - Representation of each machine instruction. +/// class MachineInstr { short Opcode; // the opcode std::vector<MachineOperand> operands; // the operands @@ -287,9 +272,7 @@ class MachineInstr { // OperandComplete - Return true if it's illegal to add a new operand bool OperandsComplete() const; - //Constructor used by clone() method MachineInstr(const MachineInstr&); - void operator=(const MachineInstr&); // DO NOT IMPLEMENT // Intrusive list support @@ -297,12 +280,9 @@ class MachineInstr { friend struct ilist_traits<MachineInstr>; public: - /// MachineInstr ctor - This constructor only does a _reserve_ of the - /// operands, not a resize for them. It is expected that if you use this that - /// you call add* methods below to fill up the operands, instead of the Set - /// methods. Eventually, the "resizing" ctors will be phased out. - /// - MachineInstr(short Opcode, unsigned numOperands, bool XX, bool YY); + /// MachineInstr ctor - This constructor reserve's space for numOperand + /// operands. + MachineInstr(short Opcode, unsigned numOperands); /// MachineInstr ctor - Work exactly the same as the ctor above, except that /// the MachineInstr is created and added to the end of the specified basic diff --git a/include/llvm/CodeGen/MachineInstrBuilder.h b/include/llvm/CodeGen/MachineInstrBuilder.h index 36ee998cbc..0d4d07d00a 100644 --- a/include/llvm/CodeGen/MachineInstrBuilder.h +++ b/include/llvm/CodeGen/MachineInstrBuilder.h @@ -47,20 +47,6 @@ public: return *this; } - /// addZImm - Add a new zero extended immediate operand... - /// - const MachineInstrBuilder &addZImm(unsigned Val) const { - MI->addImmOperand(Val); - return *this; - } - - /// addImm64 - Add a new 64-bit immediate operand... - /// - const MachineInstrBuilder &addImm64(uint64_t Val) const { - MI->addImmOperand(Val); - return *this; - } - const MachineInstrBuilder &addMBB(MachineBasicBlock *MBB) const { MI->addMachineBasicBlockOperand(MBB); return *this; @@ -99,7 +85,7 @@ public: /// allow for memory efficient representation of machine instructions. /// inline MachineInstrBuilder BuildMI(int Opcode, unsigned NumOperands) { - return MachineInstrBuilder(new MachineInstr(Opcode, NumOperands, true, true)); + return MachineInstrBuilder(new MachineInstr(Opcode, NumOperands)); } /// BuildMI - This version of the builder sets up the first operand as a @@ -110,8 +96,8 @@ inline MachineInstrBuilder BuildMI( int Opcode, unsigned NumOperands, unsigned DestReg, MachineOperand::UseType useType = MachineOperand::Def) { - return MachineInstrBuilder(new MachineInstr(Opcode, NumOperands+1, - true, true)).addReg(DestReg, useType); + return MachineInstrBuilder(new MachineInstr(Opcode, NumOperands+1)) + .addReg(DestReg, useType); } /// BuildMI - This version of the builder inserts the newly-built @@ -124,7 +110,7 @@ inline MachineInstrBuilder BuildMI(MachineBasicBlock &BB, MachineBasicBlock::iterator I, int Opcode, unsigned NumOperands, unsigned DestReg) { - MachineInstr *MI = new MachineInstr(Opcode, NumOperands+1, true, true); + MachineInstr *MI = new MachineInstr(Opcode, NumOperands+1); BB.insert(I, MI); return MachineInstrBuilder(MI).addReg(DestReg, MachineOperand::Def); } @@ -136,7 +122,7 @@ inline MachineInstrBuilder BuildMI(MachineBasicBlock &BB, inline MachineInstrBuilder BuildMI(MachineBasicBlock &BB, MachineBasicBlock::iterator I, int Opcode, unsigned NumOperands) { - MachineInstr *MI = new MachineInstr(Opcode, NumOperands, true, true); + MachineInstr *MI = new MachineInstr(Opcode, NumOperands); BB.insert(I, MI); return MachineInstrBuilder(MI); } |