mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-12 13:38:21 +00:00
All callers of these methods actually wanted them to preserve the flags,
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
This commit is contained in:
@ -432,12 +432,10 @@ public:
|
|||||||
++numImplicitRefs;
|
++numImplicitRefs;
|
||||||
addRegOperand(V, isDef, isDefAndUse);
|
addRegOperand(V, isDef, isDefAndUse);
|
||||||
}
|
}
|
||||||
void setImplicitRef(unsigned i, Value* V, bool isDef=false,
|
void setImplicitRef(unsigned i, Value* V) {
|
||||||
bool isDefAndUse=false) {
|
|
||||||
assert(i < getNumImplicitRefs() && "setImplicitRef() out of range!");
|
assert(i < getNumImplicitRefs() && "setImplicitRef() out of range!");
|
||||||
SetMachineOperandVal(i + getNumOperands(),
|
SetMachineOperandVal(i + getNumOperands(),
|
||||||
MachineOperand::MO_VirtualRegister,
|
MachineOperand::MO_VirtualRegister, V);
|
||||||
V, isDef, isDefAndUse);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -631,17 +629,13 @@ public:
|
|||||||
//
|
//
|
||||||
void SetMachineOperandVal (unsigned i,
|
void SetMachineOperandVal (unsigned i,
|
||||||
MachineOperand::MachineOperandType operandType,
|
MachineOperand::MachineOperandType operandType,
|
||||||
Value* V,
|
Value* V);
|
||||||
bool isDef=false,
|
|
||||||
bool isDefAndUse=false);
|
|
||||||
|
|
||||||
void SetMachineOperandConst (unsigned i,
|
void SetMachineOperandConst (unsigned i,
|
||||||
MachineOperand::MachineOperandType operandType,
|
MachineOperand::MachineOperandType operandType,
|
||||||
int64_t intValue);
|
int64_t intValue);
|
||||||
|
|
||||||
void SetMachineOperandReg (unsigned i,
|
void SetMachineOperandReg(unsigned i, int regNum);
|
||||||
int regNum,
|
|
||||||
bool isDef=false);
|
|
||||||
|
|
||||||
|
|
||||||
unsigned substituteValue(const Value* oldVal, Value* newVal,
|
unsigned substituteValue(const Value* oldVal, Value* newVal,
|
||||||
|
@ -80,24 +80,13 @@ void MachineInstr::replace(MachineOpCode Opcode, unsigned numOperands)
|
|||||||
operands.resize(numOperands, MachineOperand());
|
operands.resize(numOperands, MachineOperand());
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void MachineInstr::SetMachineOperandVal(unsigned i,
|
||||||
MachineInstr::SetMachineOperandVal(unsigned i,
|
MachineOperand::MachineOperandType opTy,
|
||||||
MachineOperand::MachineOperandType opType,
|
Value* V) {
|
||||||
Value* V,
|
|
||||||
bool isdef,
|
|
||||||
bool isDefAndUse)
|
|
||||||
{
|
|
||||||
assert(i < operands.size()); // may be explicit or implicit op
|
assert(i < operands.size()); // may be explicit or implicit op
|
||||||
operands[i].opType = opType;
|
operands[i].opType = opTy;
|
||||||
operands[i].value = V;
|
operands[i].value = V;
|
||||||
operands[i].regNum = -1;
|
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
|
void
|
||||||
@ -116,22 +105,12 @@ MachineInstr::SetMachineOperandConst(unsigned i,
|
|||||||
operands[i].flags = 0;
|
operands[i].flags = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void MachineInstr::SetMachineOperandReg(unsigned i, int regNum) {
|
||||||
MachineInstr::SetMachineOperandReg(unsigned i,
|
|
||||||
int regNum,
|
|
||||||
bool isdef) {
|
|
||||||
assert(i < getNumOperands()); // must be explicit op
|
assert(i < getNumOperands()); // must be explicit op
|
||||||
|
|
||||||
operands[i].opType = MachineOperand::MO_MachineRegister;
|
operands[i].opType = MachineOperand::MO_MachineRegister;
|
||||||
operands[i].value = NULL;
|
operands[i].value = NULL;
|
||||||
operands[i].regNum = regNum;
|
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);
|
insertUsedReg(regNum);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user