diff --git a/llvm/include/llvm/Target/MRegisterInfo.h b/llvm/include/llvm/Target/MRegisterInfo.h index 7a0dd3c4495a..143ec2efecaf 100644 --- a/llvm/include/llvm/Target/MRegisterInfo.h +++ b/llvm/include/llvm/Target/MRegisterInfo.h @@ -10,6 +10,7 @@ #define LLVM_TARGET_MREGISTERINFO_H #include "llvm/CodeGen/MachineBasicBlock.h" +#include #include class Type; @@ -60,6 +61,15 @@ public: virtual unsigned getDataSize() const { return 0; } + virtual void + buildReg2RegClassMap(std::map& + Reg2RegClassMap) const + { + for (unsigned i=0; i < getNumRegs(); ++i) { + Reg2RegClassMap[getRegister(i)] = this; + } + } + //const std::vector &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& + Reg2RegClassMap) const=0; }; #endif