Map stack based frameindices for spills to zero based indices that can be accessed based on an external symbol defining the location of temporary data for a function. For example: we have spill slots addressed as foo.tmp + 0, foo.tmp + 1 etc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68442 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Target/PIC16/PIC16AsmPrinter.cpp b/lib/Target/PIC16/PIC16AsmPrinter.cpp
index b495043..c0b1f6e 100644
--- a/lib/Target/PIC16/PIC16AsmPrinter.cpp
+++ b/lib/Target/PIC16/PIC16AsmPrinter.cpp
@@ -343,7 +343,6 @@
 void PIC16AsmPrinter::emitFunctionData(MachineFunction &MF) {
   const Function *F = MF.getFunction();
   std::string FuncName = Mang->getValueName(F);
-  MachineFrameInfo *MFI= MF.getFrameInfo();
   Module *M = const_cast<Module *>(F->getParent());
   const TargetData *TD = TM.getTargetData();
   unsigned FrameSize = 0;
@@ -406,15 +405,7 @@
     O << VarName << "  RES  " << Size << "\n";
   }
 
-
-  // Emit the variable to hold the space for temporary locations
-  // in function frame.
-  if (MFI->hasStackObjects()) {
-    int indexBegin = MFI->getObjectIndexBegin();
-    int indexEnd = MFI->getObjectIndexEnd();
-    if (indexBegin < indexEnd) {
-      int TempSize = indexEnd - indexBegin; 
-      O << CurrentFnName << ".tmp       RES  " << TempSize <<"\n";
-    }
-  }
+  int TempSize = PTLI->GetTmpSize();
+  if (TempSize > 0 )
+    O << CurrentFnName << ".tmp       RES  " << TempSize <<"\n";
 }