aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/MachineInstr.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-10-28 04:24:49 +0000
committerChris Lattner <sabre@nondot.org>2002-10-28 04:24:49 +0000
commit572f5c8c0cf66cd6f53dda255cd8c4d8f27d8505 (patch)
treebe900ade1798bf6bbaf3ffe4901b2bb8c0ea8a28 /lib/CodeGen/MachineInstr.cpp
parent054c1f6cb6f3a680fe4b8447880ed960fd7fe441 (diff)
Fairly major overhaul of MachineInstr & Operand classes
- Inline methods that are mostly a single line anyway - Eliminate several methods that were never called - Group methods a bit more consistently git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4329 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/MachineInstr.cpp')
-rw-r--r--lib/CodeGen/MachineInstr.cpp27
1 files changed, 21 insertions, 6 deletions
diff --git a/lib/CodeGen/MachineInstr.cpp b/lib/CodeGen/MachineInstr.cpp
index cd439e3aee..367774ac8a 100644
--- a/lib/CodeGen/MachineInstr.cpp
+++ b/lib/CodeGen/MachineInstr.cpp
@@ -47,12 +47,16 @@ MachineInstr::replace(MachineOpCode _opCode,
void
MachineInstr::SetMachineOperandVal(unsigned int i,
MachineOperand::MachineOperandType opType,
- Value* _val,
+ Value* V,
bool isdef,
bool isDefAndUse)
{
assert(i < operands.size());
- operands[i].Initialize(opType, _val);
+ operands[i].opType = opType;
+ operands[i].value = V;
+ operands[i].regNum = -1;
+ operands[i].flags = 0;
+
if (isdef || TargetInstrDescriptors[opCode].resultPos == (int) i)
operands[i].markDef();
if (isDefAndUse)
@@ -60,25 +64,36 @@ MachineInstr::SetMachineOperandVal(unsigned int i,
}
void
-MachineInstr::SetMachineOperandConst(unsigned int i,
+MachineInstr::SetMachineOperandConst(unsigned i,
MachineOperand::MachineOperandType operandType,
int64_t intValue)
{
assert(i < operands.size());
assert(TargetInstrDescriptors[opCode].resultPos != (int) i &&
"immed. constant cannot be defined");
- operands[i].InitializeConst(operandType, intValue);
+
+ operands[i].opType = operandType;
+ operands[i].value = NULL;
+ operands[i].immedVal = intValue;
+ operands[i].regNum = -1;
+ operands[i].flags = 0;
}
void
-MachineInstr::SetMachineOperandReg(unsigned int i,
+MachineInstr::SetMachineOperandReg(unsigned i,
int regNum,
bool isdef,
bool isDefAndUse,
bool isCCReg)
{
assert(i < operands.size());
- operands[i].InitializeReg(regNum, isCCReg);
+
+ operands[i].opType =
+ isCCReg? MachineOperand::MO_CCRegister : MachineOperand::MO_MachineRegister;
+ operands[i].value = NULL;
+ operands[i].regNum = regNum;
+ operands[i].flags = 0;
+
if (isdef || TargetInstrDescriptors[opCode].resultPos == (int) i)
operands[i].markDef();
if (isDefAndUse)