mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-04 18:24:38 +00:00
Starting to refactor Target to separate out code that's needed to fully describe
target machine from those that are only needed by codegen. The goal is to sink the essential target description into MC layer so we can start building MC based tools without needing to link in the entire codegen. First step is to refactor TargetRegisterInfo. This patch added a base class MCRegisterInfo which TargetRegisterInfo is derived from. Changed TableGen to separate register description from the rest of the stuff. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133782 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -20,15 +20,12 @@
|
||||
|
||||
using namespace llvm;
|
||||
|
||||
TargetRegisterInfo::TargetRegisterInfo(const TargetRegisterDesc *D, unsigned NR,
|
||||
TargetRegisterInfo::TargetRegisterInfo(const TargetRegisterInfoDesc *ID,
|
||||
regclass_iterator RCB, regclass_iterator RCE,
|
||||
const char *const *subregindexnames,
|
||||
int CFSO, int CFDO)
|
||||
: Desc(D), SubRegIndexNames(subregindexnames), NumRegs(NR),
|
||||
: InfoDesc(ID), SubRegIndexNames(subregindexnames),
|
||||
RegClassBegin(RCB), RegClassEnd(RCE) {
|
||||
assert(isPhysicalRegister(NumRegs) &&
|
||||
"Target has too many physical registers!");
|
||||
|
||||
CallFrameSetupOpcode = CFSO;
|
||||
CallFrameDestroyOpcode = CFDO;
|
||||
}
|
||||
@ -86,7 +83,7 @@ static void getAllocatableSetForRC(const MachineFunction &MF,
|
||||
|
||||
BitVector TargetRegisterInfo::getAllocatableSet(const MachineFunction &MF,
|
||||
const TargetRegisterClass *RC) const {
|
||||
BitVector Allocatable(NumRegs);
|
||||
BitVector Allocatable(getNumRegs());
|
||||
if (RC) {
|
||||
getAllocatableSetForRC(MF, RC, Allocatable);
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user