mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-30 04:35:00 +00:00
Made a single common InvalidRegNum = -1.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6473 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
2263df029a
commit
3fd7bf4257
@ -65,6 +65,11 @@ protected:
|
|||||||
public:
|
public:
|
||||||
const TargetMachine ⌖
|
const TargetMachine ⌖
|
||||||
|
|
||||||
|
// A register can be initialized to an invalid number. That number can
|
||||||
|
// be obtained using this method.
|
||||||
|
//
|
||||||
|
static int getInvalidRegNum() { return -1; }
|
||||||
|
|
||||||
TargetRegInfo(const TargetMachine& tgt) : target(tgt) { }
|
TargetRegInfo(const TargetMachine& tgt) : target(tgt) { }
|
||||||
~TargetRegInfo() {
|
~TargetRegInfo() {
|
||||||
for (unsigned i = 0, e = MachineRegClassArr.size(); i != e; ++i)
|
for (unsigned i = 0, e = MachineRegClassArr.size(); i != e; ++i)
|
||||||
@ -209,12 +214,15 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Returns the assembly-language name of the specified machine register.
|
// Returns the assembly-language name of the specified machine register.
|
||||||
|
//
|
||||||
const char * const getUnifiedRegName(int UnifiedRegNum) const {
|
const char * const getUnifiedRegName(int UnifiedRegNum) const {
|
||||||
unsigned regClassID = getNumOfRegClasses(); // initialize to invalid value
|
unsigned regClassID = getNumOfRegClasses(); // initialize to invalid value
|
||||||
int regNumInClass = getClassRegNum(UnifiedRegNum, regClassID);
|
int regNumInClass = getClassRegNum(UnifiedRegNum, regClassID);
|
||||||
return MachineRegClassArr[regClassID]->getRegName(regNumInClass);
|
return MachineRegClassArr[regClassID]->getRegName(regNumInClass);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Get the register type for a register identified different ways.
|
||||||
|
//
|
||||||
virtual int getRegType(const Type* type) const = 0;
|
virtual int getRegType(const Type* type) const = 0;
|
||||||
virtual int getRegType(const LiveRange *LR) const = 0;
|
virtual int getRegType(const LiveRange *LR) const = 0;
|
||||||
virtual int getRegType(int unifiedRegNum) const = 0;
|
virtual int getRegType(int unifiedRegNum) const = 0;
|
||||||
@ -224,11 +232,6 @@ public:
|
|||||||
virtual unsigned getFramePointer() const = 0;
|
virtual unsigned getFramePointer() const = 0;
|
||||||
virtual unsigned getStackPointer() const = 0;
|
virtual unsigned getStackPointer() const = 0;
|
||||||
|
|
||||||
// A register can be initialized to an invalid number. That number can
|
|
||||||
// be obtained using this method.
|
|
||||||
//
|
|
||||||
virtual int getInvalidRegNum() const = 0;
|
|
||||||
|
|
||||||
// Method for inserting caller saving code. The caller must save all the
|
// Method for inserting caller saving code. The caller must save all the
|
||||||
// volatile registers across a call based on the calling conventions of
|
// volatile registers across a call based on the calling conventions of
|
||||||
// an architecture. This must insert code for saving and restoring
|
// an architecture. This must insert code for saving and restoring
|
||||||
|
Loading…
x
Reference in New Issue
Block a user