From c356e565a69e56993d018c7d94194e504a78285f Mon Sep 17 00:00:00 2001 From: "Vikram S. Adve" Date: Mon, 18 Mar 2002 03:35:24 +0000 Subject: [PATCH] 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 --- lib/CodeGen/MachineInstr.cpp | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/lib/CodeGen/MachineInstr.cpp b/lib/CodeGen/MachineInstr.cpp index bb22008f952..1d6bfb8033f 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; }