diff options
| author | Evan Cheng <evan.cheng@apple.com> | 2006-05-18 00:12:58 +0000 |
|---|---|---|
| committer | Evan Cheng <evan.cheng@apple.com> | 2006-05-18 00:12:58 +0000 |
| commit | 305c49579c045d0348240eabc77fa7c68fb11eb6 (patch) | |
| tree | 398fdffc6dfe0e9389b4a23187a70e72bc19deeb /llvm/lib/Target/X86 | |
| parent | 297e1cb10a0afa231904a5fafc8602988752cbfe (diff) | |
| download | bcm5719-llvm-305c49579c045d0348240eabc77fa7c68fb11eb6.tar.gz bcm5719-llvm-305c49579c045d0348240eabc77fa7c68fb11eb6.zip | |
getCalleeSaveRegs and getCalleeSaveRegClasses are no long TableGen'd.
llvm-svn: 28378
Diffstat (limited to 'llvm/lib/Target/X86')
| -rw-r--r-- | llvm/lib/Target/X86/X86.td | 3 | ||||
| -rw-r--r-- | llvm/lib/Target/X86/X86RegisterInfo.cpp | 16 | ||||
| -rw-r--r-- | llvm/lib/Target/X86/X86RegisterInfo.h | 16 |
3 files changed, 28 insertions, 7 deletions
diff --git a/llvm/lib/Target/X86/X86.td b/llvm/lib/Target/X86/X86.td index 170ec1302c8..e310f2676c5 100644 --- a/llvm/lib/Target/X86/X86.td +++ b/llvm/lib/Target/X86/X86.td @@ -130,9 +130,6 @@ def IntelAsmWriter : AsmWriter { def X86 : Target { - // Specify the callee saved registers. - let CalleeSavedRegisters = [ESI, EDI, EBX, EBP]; - // Information about the instructions... let InstructionSet = X86InstrInfo; diff --git a/llvm/lib/Target/X86/X86RegisterInfo.cpp b/llvm/lib/Target/X86/X86RegisterInfo.cpp index 53513c6c079..a0c9b0c2875 100644 --- a/llvm/lib/Target/X86/X86RegisterInfo.cpp +++ b/llvm/lib/Target/X86/X86RegisterInfo.cpp @@ -600,6 +600,22 @@ MachineInstr* X86RegisterInfo::foldMemoryOperand(MachineInstr* MI, return NULL; } +const unsigned *X86RegisterInfo::getCalleeSaveRegs() const { + static const unsigned CalleeSaveRegs[] = { + X86::ESI, X86::EDI, X86::EBX, X86::EBP, 0 + }; + return CalleeSaveRegs; +} + +const TargetRegisterClass* const* +X86RegisterInfo::getCalleeSaveRegClasses() const { + static const TargetRegisterClass * const CalleeSaveRegClasses[] = { + &X86::GR32RegClass, &X86::GR32RegClass, + &X86::GR32RegClass, &X86::GR32RegClass, 0 + }; + return CalleeSaveRegClasses; +} + //===----------------------------------------------------------------------===// // Stack Frame Processing methods //===----------------------------------------------------------------------===// diff --git a/llvm/lib/Target/X86/X86RegisterInfo.h b/llvm/lib/Target/X86/X86RegisterInfo.h index 5d4a66e12fd..8650d06d34b 100644 --- a/llvm/lib/Target/X86/X86RegisterInfo.h +++ b/llvm/lib/Target/X86/X86RegisterInfo.h @@ -47,10 +47,18 @@ struct X86RegisterInfo : public X86GenRegisterInfo { /// folding and return true, otherwise it should return false. If it folds /// the instruction, it is likely that the MachineInstruction the iterator /// references has been changed. - virtual MachineInstr* foldMemoryOperand(MachineInstr* MI, - unsigned OpNum, - int FrameIndex) const; - + MachineInstr* foldMemoryOperand(MachineInstr* MI, + unsigned OpNum, + int FrameIndex) const; + + /// getCalleeSaveRegs - Return a null-terminated list of all of the + /// callee-save registers on this target. + const unsigned *getCalleeSaveRegs() const; + + /// getCalleeSaveRegClasses - Return a null-terminated list of the preferred + /// register classes to spill each callee-saved register with. The order and + /// length of this list match the getCalleeSaveRegs() list. + const TargetRegisterClass* const* getCalleeSaveRegClasses() const; void eliminateCallFramePseudoInstr(MachineFunction &MF, MachineBasicBlock &MBB, |

