aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/MachineInstr.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-05-04 19:14:44 +0000
committerChris Lattner <sabre@nondot.org>2006-05-04 19:14:44 +0000
commit943b5e117fe9a087f9aa529a2632c2d32cc22374 (patch)
tree0a5136f73a915b34d87f08db151f5e4091ad149e /lib/CodeGen/MachineInstr.cpp
parent02597f3b8826e9760cee11ea07b4cfc5f260f736 (diff)
Remove redundancy and a level of indirection when creating machine operands
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28107 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/MachineInstr.cpp')
-rw-r--r--lib/CodeGen/MachineInstr.cpp26
1 files changed, 5 insertions, 21 deletions
diff --git a/lib/CodeGen/MachineInstr.cpp b/lib/CodeGen/MachineInstr.cpp
index 2cb5119e49..495da5edfc 100644
--- a/lib/CodeGen/MachineInstr.cpp
+++ b/lib/CodeGen/MachineInstr.cpp
@@ -43,7 +43,7 @@ namespace llvm {
///
MachineInstr::MachineInstr(short opcode, unsigned numOperands)
: Opcode(opcode), parent(0) {
- operands.reserve(numOperands);
+ Operands.reserve(numOperands);
// Make sure that we get added to a machine basicblock
LeakDetector::addGarbageObject(this);
}
@@ -55,7 +55,7 @@ MachineInstr::MachineInstr(MachineBasicBlock *MBB, short opcode,
unsigned numOperands)
: Opcode(opcode), parent(0) {
assert(MBB && "Cannot use inserting ctor with null basic block!");
- operands.reserve(numOperands);
+ Operands.reserve(numOperands);
// Make sure that we get added to a machine basicblock
LeakDetector::addGarbageObject(this);
MBB->push_back(this); // Add instruction to end of basic block!
@@ -65,11 +65,11 @@ MachineInstr::MachineInstr(MachineBasicBlock *MBB, short opcode,
///
MachineInstr::MachineInstr(const MachineInstr &MI) {
Opcode = MI.getOpcode();
- operands.reserve(MI.getNumOperands());
+ Operands.reserve(MI.getNumOperands());
// Add operands
- for (unsigned i = 0; i < MI.getNumOperands(); ++i)
- operands.push_back(MachineOperand(MI.getOperand(i)));
+ for (unsigned i = 0; i != MI.getNumOperands(); ++i)
+ Operands.push_back(MI.getOperand(i));
// Set parent, next, and prev to null
parent = 0;
@@ -82,13 +82,6 @@ MachineInstr::~MachineInstr() {
LeakDetector::removeGarbageObject(this);
}
-/// clone - Create a copy of 'this' instruction that is identical in all ways
-/// except the following: the new instruction has no parent and it has no name
-///
-MachineInstr* MachineInstr::clone() const {
- return new MachineInstr(*this);
-}
-
/// removeFromParent - This method unlinks 'this' from the containing basic
/// block, and returns it, but does not delete it.
MachineInstr *MachineInstr::removeFromParent() {
@@ -111,15 +104,6 @@ void MachineInstr::dump() const {
std::cerr << " " << *this;
}
-static inline std::ostream& OutputValue(std::ostream &os, const Value* val) {
- os << "(val ";
- os << (void*) val; // print address always
- if (val && val->hasName())
- os << " " << val->getName(); // print name also, if available
- os << ")";
- return os;
-}
-
static inline void OutputReg(std::ostream &os, unsigned RegNo,
const MRegisterInfo *MRI = 0) {
if (!RegNo || MRegisterInfo::isPhysicalRegister(RegNo)) {