go through PIC16TargetObjectFile to make sections instead of 
creating them directly in the pic16 asmprinter.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78317 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Target/PIC16/PIC16AsmPrinter.cpp b/lib/Target/PIC16/PIC16AsmPrinter.cpp
index e98cf41..55ec1fe 100644
--- a/lib/Target/PIC16/PIC16AsmPrinter.cpp
+++ b/lib/Target/PIC16/PIC16AsmPrinter.cpp
@@ -68,12 +68,8 @@
   EmitAutos(CurrentFnName);
 
   // Now emit the instructions of function in its code section.
-  std::string T = PAN::getCodeSectionName(CurrentFnName);
-  const char *codeSection = T.c_str();
- 
   const MCSection *fCodeSection = 
-    getObjFileLowering().getOrCreateSection(codeSection, false, 
-                                           SectionKind::getText());
+    getObjFileLowering().getSectionForFunction(CurrentFnName);
   // Start the Code Section.
   O <<  "\n";
   SwitchToSection(fCodeSection);
@@ -347,12 +343,9 @@
   const TargetData *TD = TM.getTargetData();
   // Emit the data section name.
   O << "\n"; 
-  std::string T = PAN::getFrameSectionName(CurrentFnName);
-  const char *SectionName = T.c_str();
-
+  
   const MCSection *fPDataSection =
-    getObjFileLowering().getOrCreateSection(SectionName, false,
-                                        SectionKind::getDataRel());
+    getObjFileLowering().getSectionForFunctionFrame(CurrentFnName);
   SwitchToSection(fPDataSection);
   
   // Emit function frame label