mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-19 04:32:19 +00:00
RegisterInfo now supports handing out caller- and callee-save registers, as
well as building a map from a physical register to its register class. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4896 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
e8e6743cb7
commit
44662a783b
@ -10,6 +10,7 @@
|
||||
#define LLVM_TARGET_MREGISTERINFO_H
|
||||
|
||||
#include "llvm/CodeGen/MachineBasicBlock.h"
|
||||
#include <map>
|
||||
#include <assert.h>
|
||||
|
||||
class Type;
|
||||
@ -60,6 +61,15 @@ public:
|
||||
|
||||
virtual unsigned getDataSize() const { return 0; }
|
||||
|
||||
virtual void
|
||||
buildReg2RegClassMap(std::map<unsigned,const TargetRegisterClass*>&
|
||||
Reg2RegClassMap) const
|
||||
{
|
||||
for (unsigned i=0; i < getNumRegs(); ++i) {
|
||||
Reg2RegClassMap[getRegister(i)] = this;
|
||||
}
|
||||
}
|
||||
|
||||
//const std::vector<unsigned> &getRegsInClass(void) { return Regs; }
|
||||
//void getAliases(void);
|
||||
};
|
||||
@ -119,6 +129,9 @@ public:
|
||||
unsigned DestReg, unsigned SrcReg,
|
||||
unsigned ImmOffset, unsigned dataSize) const = 0;
|
||||
|
||||
virtual const unsigned* getCalleeSaveRegs() const = 0;
|
||||
virtual const unsigned* getCallerSaveRegs() const = 0;
|
||||
|
||||
virtual unsigned getFramePointer() const = 0;
|
||||
virtual unsigned getStackPointer() const = 0;
|
||||
|
||||
@ -130,6 +143,10 @@ public:
|
||||
|
||||
virtual unsigned getNumRegClasses() const = 0;
|
||||
virtual const TargetRegisterClass* getRegClassForType(const Type* Ty) const=0;
|
||||
|
||||
virtual void
|
||||
buildReg2RegClassMap(std::map<unsigned,const TargetRegisterClass*>&
|
||||
Reg2RegClassMap) const=0;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user