Changed lowering and asmprinter to use ABI Names class called PAN.
[oota-llvm.git] / lib / Target / PIC16 / PIC16InstrInfo.cpp
index 9185437edb49e5e2a6ad73e876cbe242aac7c311..c8cab3407d7ce7a7987b00ef1270a7f8e7075c99 100644 (file)
@@ -76,8 +76,7 @@ void PIC16InstrInfo::storeRegToStackSlot(MachineBasicBlock &MBB,
   const Function *Func = MBB.getParent()->getFunction();
   const std::string FuncName = Func->getName();
 
-  char *tmpName = new char [strlen(FuncName.c_str()) +  10];
-  sprintf(tmpName, "%s.temp.", FuncName.c_str());
+  const char *tmpName = createESName(PAN::getTempdataLabel(FuncName));
 
   // On the order of operands here: think "movwf SrcReg, tmp_slot, offset".
   if (RC == PIC16::GPRRegisterClass) {
@@ -119,8 +118,7 @@ void PIC16InstrInfo::loadRegFromStackSlot(MachineBasicBlock &MBB,
   const Function *Func = MBB.getParent()->getFunction();
   const std::string FuncName = Func->getName();
 
-  char *tmpName = new char [strlen(FuncName.c_str()) +  10];
-  sprintf(tmpName, "%s.temp.", FuncName.c_str());
+  const char *tmpName = createESName(PAN::getTempdataLabel(FuncName));
 
   // On the order of operands here: think "movf FrameIndex, W".
   if (RC == PIC16::GPRRegisterClass) {