mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-08 18:31:23 +00:00
* Simplify TargetRegisterClass implementations
* Change regclass iterators to use an extra level of pointers git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5047 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
aa8dad5561
commit
439b76730d
@ -20,11 +20,7 @@ namespace {
|
||||
#include "X86RegisterInfo.def"
|
||||
};
|
||||
|
||||
class X86ByteRegisterClass : public TargetRegisterClass {
|
||||
protected:
|
||||
|
||||
public:
|
||||
X86ByteRegisterClass() {}
|
||||
struct X86ByteRegisterClass : public TargetRegisterClass {
|
||||
unsigned getNumRegs() const {
|
||||
return sizeof(X86ByteRegisterClassRegs)/
|
||||
sizeof(X86ByteRegisterClassRegs[0]);
|
||||
@ -35,7 +31,6 @@ namespace {
|
||||
}
|
||||
|
||||
unsigned getDataSize() const { return 1; }
|
||||
|
||||
} X86ByteRegisterClassInstance;
|
||||
|
||||
|
||||
@ -48,11 +43,7 @@ namespace {
|
||||
#include "X86RegisterInfo.def"
|
||||
};
|
||||
|
||||
class X86ShortRegisterClass : public TargetRegisterClass {
|
||||
protected:
|
||||
|
||||
public:
|
||||
X86ShortRegisterClass() {}
|
||||
struct X86ShortRegisterClass : public TargetRegisterClass {
|
||||
unsigned getNumRegs() const {
|
||||
return sizeof(X86ShortRegisterClassRegs)/
|
||||
sizeof(X86ShortRegisterClassRegs[0]); }
|
||||
@ -61,7 +52,6 @@ namespace {
|
||||
return X86ShortRegisterClassRegs[idx];
|
||||
}
|
||||
unsigned getDataSize() const { return 2; }
|
||||
|
||||
} X86ShortRegisterClassInstance;
|
||||
|
||||
//
|
||||
@ -74,11 +64,7 @@ namespace {
|
||||
#include "X86RegisterInfo.def"
|
||||
};
|
||||
|
||||
class X86IntRegisterClass : public TargetRegisterClass {
|
||||
protected:
|
||||
|
||||
public:
|
||||
X86IntRegisterClass() {}
|
||||
struct X86IntRegisterClass : public TargetRegisterClass {
|
||||
unsigned getNumRegs() const {
|
||||
return sizeof(X86IntRegisterClassRegs)/
|
||||
sizeof(X86IntRegisterClassRegs[0]); }
|
||||
@ -87,7 +73,6 @@ namespace {
|
||||
return X86IntRegisterClassRegs[idx];
|
||||
}
|
||||
unsigned getDataSize() const { return 4; }
|
||||
|
||||
} X86IntRegisterClassInstance;
|
||||
|
||||
|
||||
@ -120,21 +105,19 @@ namespace {
|
||||
assert(0 && "Invalid type to getClass!");
|
||||
return 0; // not reached
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
MRegisterInfo::const_iterator X86RegisterInfo::const_regclass_begin() const {
|
||||
return X86RegClasses[0];
|
||||
MRegisterInfo::const_iterator X86RegisterInfo::regclass_begin() const {
|
||||
return X86RegClasses;
|
||||
}
|
||||
|
||||
unsigned X86RegisterInfo::getNumRegClasses() const {
|
||||
return sizeof(X86RegClasses)/sizeof(X86RegClasses[0]);
|
||||
}
|
||||
|
||||
MRegisterInfo::const_iterator X86RegisterInfo::const_regclass_end() const {
|
||||
return (X86RegClasses[0]+getNumRegClasses());
|
||||
MRegisterInfo::const_iterator X86RegisterInfo::regclass_end() const {
|
||||
return X86RegClasses+getNumRegClasses();
|
||||
}
|
||||
|
||||
|
@ -14,8 +14,8 @@ class Type;
|
||||
struct X86RegisterInfo : public MRegisterInfo {
|
||||
X86RegisterInfo();
|
||||
|
||||
MRegisterInfo::const_iterator const_regclass_begin() const;
|
||||
MRegisterInfo::const_iterator const_regclass_end() const;
|
||||
MRegisterInfo::const_iterator regclass_begin() const;
|
||||
MRegisterInfo::const_iterator regclass_end() const;
|
||||
|
||||
MachineBasicBlock::iterator
|
||||
storeReg2RegOffset(MachineBasicBlock *MBB,
|
||||
|
Loading…
Reference in New Issue
Block a user