Add callee-saved regs & reg classes getter hooks
authorAnton Korobeynikov <asl@math.spbu.ru>
Sun, 3 May 2009 13:00:46 +0000 (13:00 +0000)
committerAnton Korobeynikov <asl@math.spbu.ru>
Sun, 3 May 2009 13:00:46 +0000 (13:00 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70706 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/MSP430/MSP430RegisterInfo.cpp

index b40cca988d9a07abff9082f2bfd11823522a5281..3bfe8b0df5f051dfac3f3658eb05a57ea628ce74 100644 (file)
@@ -30,12 +30,26 @@ MSP430RegisterInfo::MSP430RegisterInfo(const TargetInstrInfo &tii)
 
 const unsigned*
 MSP430RegisterInfo::getCalleeSavedRegs(const MachineFunction *MF) const {
-  assert(0 && "Not implemented yet!");
+  static const unsigned CalleeSavedRegs[] = {
+    MSP430::FP, MSP430::R5, MSP430::R6, MSP430::R7,
+    MSP430::R8, MSP430::R9, MSP430::R10, MSP430::R11,
+    0
+  };
+
+  return CalleeSavedRegs;
 }
 
 const TargetRegisterClass* const*
 MSP430RegisterInfo::getCalleeSavedRegClasses(const MachineFunction *MF) const {
-  assert(0 && "Not implemented yet!");
+  static const TargetRegisterClass * const CalleeSavedRegClasses[] = {
+    &MSP430::MSP430RegsRegClass, &MSP430::MSP430RegsRegClass,
+    &MSP430::MSP430RegsRegClass, &MSP430::MSP430RegsRegClass,
+    &MSP430::MSP430RegsRegClass, &MSP430::MSP430RegsRegClass,
+    &MSP430::MSP430RegsRegClass, &MSP430::MSP430RegsRegClass,
+    0
+  };
+
+  return CalleeSavedRegClasses;
 }
 
 BitVector