diff options
author | Misha Brukman <brukman+llvm@gmail.com> | 2002-12-03 23:09:53 +0000 |
---|---|---|
committer | Misha Brukman <brukman+llvm@gmail.com> | 2002-12-03 23:09:53 +0000 |
commit | 44662a783b8dbef0292c8337a52fce665b3b9f4c (patch) | |
tree | 87582be962ba0fa6a2e967245d05acdd7234470b | |
parent | e8e6743cb78d0b8ef4cef0f427a42839a153d457 (diff) |
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
-rw-r--r-- | include/llvm/Target/MRegisterInfo.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/include/llvm/Target/MRegisterInfo.h b/include/llvm/Target/MRegisterInfo.h index 7a0dd3c449..143ec2efec 100644 --- a/include/llvm/Target/MRegisterInfo.h +++ b/include/llvm/Target/MRegisterInfo.h @@ -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 |