aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVikram S. Adve <vadve@cs.uiuc.edu>2002-03-18 03:35:24 +0000
committerVikram S. Adve <vadve@cs.uiuc.edu>2002-03-18 03:35:24 +0000
commitc356e565a69e56993d018c7d94194e504a78285f (patch)
treec507519dec3ef3d7f9a4b19b0b7f5cc31bbc404e
parent42f632041dcce6335349512724f5ce648f46f08b (diff)
Bug fix in setting CC register.
Also use distinct names for the three types of SetMachineOperand to avoid painful overloading problems and errors. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1904 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/CodeGen/MachineInstr.cpp19
1 files changed, 11 insertions, 8 deletions
diff --git a/lib/CodeGen/MachineInstr.cpp b/lib/CodeGen/MachineInstr.cpp
index bb22008f95..1d6bfb8033 100644
--- a/lib/CodeGen/MachineInstr.cpp
+++ b/lib/CodeGen/MachineInstr.cpp
@@ -41,7 +41,7 @@ MachineInstr::MachineInstr(MachineOpCode _opCode,
}
void
-MachineInstr::SetMachineOperand(unsigned int i,
+MachineInstr::SetMachineOperandVal(unsigned int i,
MachineOperand::MachineOperandType operandType,
Value* _val, bool isdef=false)
{
@@ -52,22 +52,25 @@ MachineInstr::SetMachineOperand(unsigned int i,
}
void
-MachineInstr::SetMachineOperand(unsigned int i,
+MachineInstr::SetMachineOperandConst(unsigned int i,
MachineOperand::MachineOperandType operandType,
- int64_t intValue, bool isdef=false)
+ 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].isDef = isdef ||
- TargetInstrDescriptors[opCode].resultPos == (int) i;
+ operands[i].isDef = false;
}
void
-MachineInstr::SetMachineOperand(unsigned int i,
- int regNum, bool isdef=false)
+MachineInstr::SetMachineOperandReg(unsigned int i,
+ int regNum,
+ bool isdef=false,
+ bool isCCReg=false)
{
assert(i < operands.size());
- operands[i].InitializeReg(regNum);
+ operands[i].InitializeReg(regNum, isCCReg);
operands[i].isDef = isdef ||
TargetInstrDescriptors[opCode].resultPos == (int) i;
}