forked from OSchip/llvm-project
RegisterInfo now supports handing out caller- and callee-save registers, as
well as building a map from a physical register to its register class. llvm-svn: 4896
This commit is contained in:
parent
64261741c7
commit
9e4163539f
|
@ -10,6 +10,7 @@
|
||||||
#define LLVM_TARGET_MREGISTERINFO_H
|
#define LLVM_TARGET_MREGISTERINFO_H
|
||||||
|
|
||||||
#include "llvm/CodeGen/MachineBasicBlock.h"
|
#include "llvm/CodeGen/MachineBasicBlock.h"
|
||||||
|
#include <map>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
class Type;
|
class Type;
|
||||||
|
@ -60,6 +61,15 @@ public:
|
||||||
|
|
||||||
virtual unsigned getDataSize() const { return 0; }
|
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; }
|
//const std::vector<unsigned> &getRegsInClass(void) { return Regs; }
|
||||||
//void getAliases(void);
|
//void getAliases(void);
|
||||||
};
|
};
|
||||||
|
@ -119,6 +129,9 @@ public:
|
||||||
unsigned DestReg, unsigned SrcReg,
|
unsigned DestReg, unsigned SrcReg,
|
||||||
unsigned ImmOffset, unsigned dataSize) const = 0;
|
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 getFramePointer() const = 0;
|
||||||
virtual unsigned getStackPointer() const = 0;
|
virtual unsigned getStackPointer() const = 0;
|
||||||
|
|
||||||
|
@ -130,6 +143,10 @@ public:
|
||||||
|
|
||||||
virtual unsigned getNumRegClasses() const = 0;
|
virtual unsigned getNumRegClasses() const = 0;
|
||||||
virtual const TargetRegisterClass* getRegClassForType(const Type* Ty) const=0;
|
virtual const TargetRegisterClass* getRegClassForType(const Type* Ty) const=0;
|
||||||
|
|
||||||
|
virtual void
|
||||||
|
buildReg2RegClassMap(std::map<unsigned,const TargetRegisterClass*>&
|
||||||
|
Reg2RegClassMap) const=0;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue