mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-27 04:18:42 +00:00
* Frame indices are signed
* Cluster modification methods together git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5164 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
1 parent
cd0d1d1f0f
commit
7ad6be7b01
1 file changed
+32
-22
@@ -203,7 +203,7 @@ public:
|
|||||||
assert(isMachineBasicBlock() && "Can't get MBB in non-MBB operand!");
|
assert(isMachineBasicBlock() && "Can't get MBB in non-MBB operand!");
|
||||||
return MBB;
|
return MBB;
|
||||||
}
|
}
|
||||||
unsigned getFrameIndex() const { assert(isFrameIndex()); return immedVal; }
|
int getFrameIndex() const { assert(isFrameIndex()); return immedVal; }
|
||||||
|
|
||||||
bool opIsUse () const { return (flags & USEDEFMASK) == 0; }
|
bool opIsUse () const { return (flags & USEDEFMASK) == 0; }
|
||||||
bool opIsDef () const { return flags & DEFFLAG; }
|
bool opIsDef () const { return flags & DEFFLAG; }
|
||||||
@@ -313,12 +313,6 @@ public:
|
|||||||
MachineInstr(MachineBasicBlock *MBB, MachineOpCode Opcode, unsigned numOps);
|
MachineInstr(MachineBasicBlock *MBB, MachineOpCode Opcode, unsigned numOps);
|
||||||
|
|
||||||
|
|
||||||
/// replace - Support to rewrite a machine instruction in place: for now,
|
|
||||||
/// simply replace() and then set new operands with Set.*Operand methods
|
|
||||||
/// below.
|
|
||||||
///
|
|
||||||
void replace(MachineOpCode Opcode, unsigned numOperands);
|
|
||||||
|
|
||||||
// The opcode.
|
// The opcode.
|
||||||
//
|
//
|
||||||
const MachineOpCode getOpcode() const { return opCode; }
|
const MachineOpCode getOpcode() const { return opCode; }
|
||||||
@@ -338,10 +332,12 @@ public:
|
|||||||
return operands[i];
|
return operands[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// FIXME: ELIMINATE
|
||||||
MachineOperand::MachineOperandType getOperandType(unsigned i) const {
|
MachineOperand::MachineOperandType getOperandType(unsigned i) const {
|
||||||
return getOperand(i).getType();
|
return getOperand(i).getType();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// FIXME: ELIMINATE: Misleading name: Definition not defined.
|
||||||
bool operandIsDefined(unsigned i) const {
|
bool operandIsDefined(unsigned i) const {
|
||||||
return getOperand(i).opIsDef();
|
return getOperand(i).opIsDef();
|
||||||
}
|
}
|
||||||
@@ -401,21 +397,6 @@ public:
|
|||||||
typedef ValOpIterator<const MachineInstr*,const Value*> const_val_op_iterator;
|
typedef ValOpIterator<const MachineInstr*,const Value*> const_val_op_iterator;
|
||||||
typedef ValOpIterator< MachineInstr*, Value*> val_op_iterator;
|
typedef ValOpIterator< MachineInstr*, Value*> val_op_iterator;
|
||||||
|
|
||||||
// Access to set the operands when building the machine instruction
|
|
||||||
//
|
|
||||||
void SetMachineOperandVal (unsigned i,
|
|
||||||
MachineOperand::MachineOperandType operandType,
|
|
||||||
Value* V,
|
|
||||||
bool isDef=false,
|
|
||||||
bool isDefAndUse=false);
|
|
||||||
|
|
||||||
void SetMachineOperandConst (unsigned i,
|
|
||||||
MachineOperand::MachineOperandType operandType,
|
|
||||||
int64_t intValue);
|
|
||||||
|
|
||||||
void SetMachineOperandReg (unsigned i,
|
|
||||||
int regNum,
|
|
||||||
bool isDef=false);
|
|
||||||
|
|
||||||
//===--------------------------------------------------------------------===//
|
//===--------------------------------------------------------------------===//
|
||||||
// Accessors to add operands when building up machine instructions
|
// Accessors to add operands when building up machine instructions
|
||||||
@@ -519,6 +500,35 @@ public:
|
|||||||
operands.push_back(MachineOperand(Idx, MachineOperand::MO_FrameIndex));
|
operands.push_back(MachineOperand(Idx, MachineOperand::MO_FrameIndex));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//===--------------------------------------------------------------------===//
|
||||||
|
// Accessors used to modify instructions in place.
|
||||||
|
//
|
||||||
|
// FIXME: Move this stuff to MachineOperand itself!
|
||||||
|
|
||||||
|
/// replace - Support to rewrite a machine instruction in place: for now,
|
||||||
|
/// simply replace() and then set new operands with Set.*Operand methods
|
||||||
|
/// below.
|
||||||
|
///
|
||||||
|
void replace(MachineOpCode Opcode, unsigned numOperands);
|
||||||
|
|
||||||
|
// Access to set the operands when building the machine instruction
|
||||||
|
//
|
||||||
|
void SetMachineOperandVal (unsigned i,
|
||||||
|
MachineOperand::MachineOperandType operandType,
|
||||||
|
Value* V,
|
||||||
|
bool isDef=false,
|
||||||
|
bool isDefAndUse=false);
|
||||||
|
|
||||||
|
void SetMachineOperandConst (unsigned i,
|
||||||
|
MachineOperand::MachineOperandType operandType,
|
||||||
|
int64_t intValue);
|
||||||
|
|
||||||
|
void SetMachineOperandReg (unsigned i,
|
||||||
|
int regNum,
|
||||||
|
bool isDef=false);
|
||||||
|
|
||||||
|
|
||||||
unsigned substituteValue(const Value* oldVal, Value* newVal,
|
unsigned substituteValue(const Value* oldVal, Value* newVal,
|
||||||
bool defsOnly = true);
|
bool defsOnly = true);
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user