All callers of these methods actually wanted them to preserve the flags,
authorChris Lattner <sabre@nondot.org>
Tue, 5 Aug 2003 16:58:46 +0000 (16:58 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 5 Aug 2003 16:58:46 +0000 (16:58 +0000)
so get rid of the def/use parameters that were getting passed in.

**** This now changes the semantics of these methods to preserve the flags,
     not clobber them!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7602 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/CodeGen/MachineInstr.h
lib/CodeGen/MachineInstr.cpp

index 117e4adb5047e8789fb8b7b041781ca11bb9cc0f..47f244b148f893c55868cd92c51d6b783120bc19 100644 (file)
@@ -432,12 +432,10 @@ public:
     ++numImplicitRefs;
     addRegOperand(V, isDef, isDefAndUse);
   }
-  void setImplicitRef(unsigned i, Value* V, bool isDef=false,
-                      bool isDefAndUse=false) {
+  void setImplicitRef(unsigned i, Value* V) {
     assert(i < getNumImplicitRefs() && "setImplicitRef() out of range!");
     SetMachineOperandVal(i + getNumOperands(),
-                         MachineOperand::MO_VirtualRegister,
-                         V, isDef, isDefAndUse);
+                         MachineOperand::MO_VirtualRegister, V);
   }
 
   //
@@ -631,17 +629,13 @@ public:
   // 
   void SetMachineOperandVal     (unsigned i,
                                  MachineOperand::MachineOperandType operandType,
-                                 Value* V,
-                                 bool isDef=false,
-                                 bool isDefAndUse=false);
+                                 Value* V);
 
   void SetMachineOperandConst   (unsigned i,
                                  MachineOperand::MachineOperandType operandType,
                                  int64_t intValue);
 
-  void SetMachineOperandReg     (unsigned i,
-                                 int regNum,
-                                 bool isDef=false);
+  void SetMachineOperandReg(unsigned i, int regNum);
 
 
   unsigned substituteValue(const Value* oldVal, Value* newVal,
index d51c8071f76aac2c58403db88845816aa55dc1d7..904a412add72cdf1400f31264f90bc6db911e6eb 100644 (file)
@@ -80,24 +80,13 @@ void MachineInstr::replace(MachineOpCode Opcode, unsigned numOperands)
   operands.resize(numOperands, MachineOperand());
 }
 
-void
-MachineInstr::SetMachineOperandVal(unsigned i,
-                                   MachineOperand::MachineOperandType opType,
-                                   Value* V,
-                                   bool isdef,
-                                   bool isDefAndUse)
-{
+void MachineInstr::SetMachineOperandVal(unsigned i,
+                                        MachineOperand::MachineOperandType opTy,
+                                        Value* V) {
   assert(i < operands.size());          // may be explicit or implicit op
-  operands[i].opType = opType;
+  operands[i].opType = opTy;
   operands[i].value = V;
   operands[i].regNum = -1;
-
-  if (isDefAndUse)
-    operands[i].flags = MachineOperand::DEFUSEFLAG;
-  else if (isdef || TargetInstrDescriptors[opCode].resultPos == (int) i)
-    operands[i].flags = MachineOperand::DEFONLYFLAG;
-  else
-    operands[i].flags = 0;
 }
 
 void
@@ -116,22 +105,12 @@ MachineInstr::SetMachineOperandConst(unsigned i,
   operands[i].flags = 0;
 }
 
-void
-MachineInstr::SetMachineOperandReg(unsigned i,
-                                   int regNum,
-                                   bool isdef) {
+void MachineInstr::SetMachineOperandReg(unsigned i, int regNum) {
   assert(i < getNumOperands());          // must be explicit op
 
   operands[i].opType = MachineOperand::MO_MachineRegister;
   operands[i].value = NULL;
   operands[i].regNum = regNum;
-
-  if (isdef || TargetInstrDescriptors[opCode].resultPos == (int)i) {
-    assert(operands[i].flags == MachineOperand::DEFONLYFLAG &&
-           "Shouldn't be changing a register type once set!");
-    operands[i].flags = MachineOperand::DEFONLYFLAG;
-  }
-
   insertUsedReg(regNum);
 }