[llvm-commits] [llvm] r71544 - in /llvm/trunk/lib/Target/PIC16: PIC16.h PIC16AsmPrinter.cpp

Sanjiv Gupta sanjiv.gupta at microchip.com
Mon May 11 23:52:41 PDT 2009


Author: sgupta
Date: Tue May 12 01:52:41 2009
New Revision: 71544

URL: http://llvm.org/viewvc/llvm-project?rev=71544&view=rev
Log:
We do not need to create a label for external defs and decls,
just emit a comment for readability.

Modified:
    llvm/trunk/lib/Target/PIC16/PIC16.h
    llvm/trunk/lib/Target/PIC16/PIC16AsmPrinter.cpp

Modified: llvm/trunk/lib/Target/PIC16/PIC16.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/PIC16.h?rev=71544&r1=71543&r2=71544&view=diff

==============================================================================
--- llvm/trunk/lib/Target/PIC16/PIC16.h (original)
+++ llvm/trunk/lib/Target/PIC16/PIC16.h Tue May 12 01:52:41 2009
@@ -234,20 +234,6 @@
        return o.str(); 
     }
 
-    static std::string getDeclSectionName(void) {
-       std::string dsname = "section.0";
-       dsname = addPrefix(dsname);
-       return dsname; 
-    }
-
-    // FIXME: currently decls for libcalls are into a separate section.
-    // merge the rest of decls to one.
-    static std::string getLibDeclSectionName(void) {
-       std::string dsname = "lib_decls.0";
-       dsname = addPrefix(dsname);
-       return dsname; 
-    }
-
     inline static bool isLocalName (const std::string &Name) {
       if (getSymbolTag(Name) == AUTOS_LABEL)
         return true;

Modified: llvm/trunk/lib/Target/PIC16/PIC16AsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/PIC16AsmPrinter.cpp?rev=71544&r1=71543&r2=71544&view=diff

==============================================================================
--- llvm/trunk/lib/Target/PIC16/PIC16AsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/PIC16/PIC16AsmPrinter.cpp Tue May 12 01:52:41 2009
@@ -157,8 +157,7 @@
   // If no libcalls used, return.
   if (Decls.empty()) return;
 
-  const Section *S = TAI->getNamedSection(PAN::getLibDeclSectionName().c_str());
-  SwitchToSection(S);
+  O << TAI->getCommentString() << "External decls for libcalls - BEGIN." <<"\n";
   // Remove duplicate entries.
   Decls.sort();
   Decls.unique();
@@ -169,6 +168,7 @@
     O << TAI->getExternDirective() << PAN::getArgsLabel(*I) << "\n";
     O << TAI->getExternDirective() << PAN::getRetvalLabel(*I) << "\n";
   }
+  O << TAI->getCommentString() << "External decls for libcalls - END." <<"\n";
 }
 
 bool PIC16AsmPrinter::doInitialization (Module &M) {
@@ -191,7 +191,7 @@
 
 void PIC16AsmPrinter::EmitExternsAndGlobals (Module &M) {
  // Emit declarations for external functions.
-  O << PAN::getDeclSectionName() <<"\n";
+  O << TAI->getCommentString() << "External defs and decls - BEGIN." <<"\n";
   for (Module::iterator I = M.begin(), E = M.end(); I != E; I++) {
     std::string Name = Mang->getValueName(I);
     if (Name.compare("@abort") == 0)
@@ -233,6 +233,7 @@
                                                  TAI->getGlobalDirective();
     O << directive << Name << "\n";
   }
+  O << TAI->getCommentString() << "External defs and decls - END." <<"\n";
 }
 
 void PIC16AsmPrinter::EmitRomData (Module &M)





More information about the llvm-commits mailing list