[llvm-commits] CVS: llvm/lib/CodeGen/AsmPrinter.cpp DwarfWriter.cpp

Anton Korobeynikov asl at math.spbu.ru
Tue Oct 31 00:31:42 PST 2006



Changes in directory llvm/lib/CodeGen:

AsmPrinter.cpp updated: 1.114 -> 1.115
DwarfWriter.cpp updated: 1.89 -> 1.90
---
Log message:

1. Clean up code due to changes in SwitchTo*Section(2)
2. Added partial debug support for mingw\cygwin targets (the same as 
   Linux\ELF). Please note, that currently mingw\cygwin uses 'stabs' format
   for storing debug info by default, thus many (runtime) libraries has 
   this information included. These formats shouldn't be mixed in one binary
   ('stabs' & 'DWARF'), otherwise binutils tools will be confused. 


---
Diffs of the changes:  (+32 -32)

 AsmPrinter.cpp  |   12 ++++++------
 DwarfWriter.cpp |   52 ++++++++++++++++++++++++++--------------------------
 2 files changed, 32 insertions(+), 32 deletions(-)


Index: llvm/lib/CodeGen/AsmPrinter.cpp
diff -u llvm/lib/CodeGen/AsmPrinter.cpp:1.114 llvm/lib/CodeGen/AsmPrinter.cpp:1.115
--- llvm/lib/CodeGen/AsmPrinter.cpp:1.114	Sat Oct 28 13:10:06 2006
+++ llvm/lib/CodeGen/AsmPrinter.cpp	Tue Oct 31 02:31:23 2006
@@ -96,7 +96,7 @@
       << "\n" << TAI->getCommentString()
       << " End of file scope inline assembly\n";
 
-  SwitchToDataSection("", 0);   // Reset back to no section.
+  SwitchToDataSection("");   // Reset back to no section.
   
   if (MachineDebugInfo *DebugInfo = getAnalysisToUpdate<MachineDebugInfo>()) {
     DebugInfo->AnalyzeModule(M);
@@ -160,7 +160,7 @@
                std::vector<std::pair<MachineConstantPoolEntry,unsigned> > &CP) {
   if (CP.empty()) return;
 
-  SwitchToDataSection(Section, 0);
+  SwitchToDataSection(Section);
   EmitAlignment(Alignment);
   for (unsigned i = 0, e = CP.size(); i != e; ++i) {
     O << TAI->getPrivateGlobalPrefix() << "CPI" << getFunctionNumber() << '_'
@@ -203,7 +203,7 @@
   if (TM.getRelocationModel() == Reloc::PIC_) {
     TargetLowering *LoweringInfo = TM.getTargetLowering();
     if (LoweringInfo && LoweringInfo->usesGlobalOffsetTable()) {
-      SwitchToDataSection(TAI->getJumpTableDataSection(), 0);
+      SwitchToDataSection(TAI->getJumpTableDataSection());
       if (TD->getPointerSize() == 8 && !JTEntryDirective)
         JTEntryDirective = TAI->getData64bitsDirective();
     } else {      
@@ -213,7 +213,7 @@
       SwitchToTextSection(getSectionForFunction(*F).c_str(), F);
     }
   } else {
-    SwitchToDataSection(TAI->getJumpTableDataSection(), 0);
+    SwitchToDataSection(TAI->getJumpTableDataSection());
     if (TD->getPointerSize() == 8)
       JTEntryDirective = TAI->getData64bitsDirective();
   }
@@ -279,14 +279,14 @@
   }
 
   if (GV->getName() == "llvm.global_ctors" && GV->use_empty()) {
-    SwitchToDataSection(TAI->getStaticCtorsSection(), 0);
+    SwitchToDataSection(TAI->getStaticCtorsSection());
     EmitAlignment(2, 0);
     EmitXXStructorList(GV->getInitializer());
     return true;
   } 
   
   if (GV->getName() == "llvm.global_dtors" && GV->use_empty()) {
-    SwitchToDataSection(TAI->getStaticDtorsSection(), 0);
+    SwitchToDataSection(TAI->getStaticDtorsSection());
     EmitAlignment(2, 0);
     EmitXXStructorList(GV->getInitializer());
     return true;


Index: llvm/lib/CodeGen/DwarfWriter.cpp
diff -u llvm/lib/CodeGen/DwarfWriter.cpp:1.89 llvm/lib/CodeGen/DwarfWriter.cpp:1.90
--- llvm/lib/CodeGen/DwarfWriter.cpp:1.89	Mon Oct 30 17:34:32 2006
+++ llvm/lib/CodeGen/DwarfWriter.cpp	Tue Oct 31 02:31:24 2006
@@ -2176,30 +2176,30 @@
   
   // Dwarf sections base addresses.
   if (TAI->getDwarfRequiresFrameSection()) {
-    Asm->SwitchToDataSection(TAI->getDwarfFrameSection(), 0);
+    Asm->SwitchToDataSection(TAI->getDwarfFrameSection());
     EmitLabel("section_frame", 0);
   }
-  Asm->SwitchToDataSection(TAI->getDwarfInfoSection(), 0);
+  Asm->SwitchToDataSection(TAI->getDwarfInfoSection());
   EmitLabel("section_info", 0);
-  Asm->SwitchToDataSection(TAI->getDwarfAbbrevSection(), 0);
+  Asm->SwitchToDataSection(TAI->getDwarfAbbrevSection());
   EmitLabel("section_abbrev", 0);
-  Asm->SwitchToDataSection(TAI->getDwarfARangesSection(), 0);
+  Asm->SwitchToDataSection(TAI->getDwarfARangesSection());
   EmitLabel("section_aranges", 0);
-  Asm->SwitchToDataSection(TAI->getDwarfMacInfoSection(), 0);
+  Asm->SwitchToDataSection(TAI->getDwarfMacInfoSection());
   EmitLabel("section_macinfo", 0);
-  Asm->SwitchToDataSection(TAI->getDwarfLineSection(), 0);
+  Asm->SwitchToDataSection(TAI->getDwarfLineSection());
   EmitLabel("section_line", 0);
-  Asm->SwitchToDataSection(TAI->getDwarfLocSection(), 0);
+  Asm->SwitchToDataSection(TAI->getDwarfLocSection());
   EmitLabel("section_loc", 0);
-  Asm->SwitchToDataSection(TAI->getDwarfPubNamesSection(), 0);
+  Asm->SwitchToDataSection(TAI->getDwarfPubNamesSection());
   EmitLabel("section_pubnames", 0);
-  Asm->SwitchToDataSection(TAI->getDwarfStrSection(), 0);
+  Asm->SwitchToDataSection(TAI->getDwarfStrSection());
   EmitLabel("section_str", 0);
-  Asm->SwitchToDataSection(TAI->getDwarfRangesSection(), 0);
+  Asm->SwitchToDataSection(TAI->getDwarfRangesSection());
   EmitLabel("section_ranges", 0);
-  Asm->SwitchToTextSection(TAI->getTextSection(), 0);
+  Asm->SwitchToTextSection(TAI->getTextSection());
   EmitLabel("text_begin", 0);
-  Asm->SwitchToDataSection(TAI->getDataSection(), 0);
+  Asm->SwitchToDataSection(TAI->getDataSection());
   EmitLabel("data_begin", 0);
 
   // Emit common frame information.
@@ -2408,7 +2408,7 @@
 ///
 void Dwarf::EmitDebugInfo() const {
   // Start debug info section.
-  Asm->SwitchToDataSection(TAI->getDwarfInfoSection(), 0);
+  Asm->SwitchToDataSection(TAI->getDwarfInfoSection());
   
   // Process each compile unit.
   for (unsigned i = 0, N = CompileUnits.size(); i < N; ++i) {
@@ -2444,7 +2444,7 @@
   // Check to see if it is worth the effort.
   if (!Abbreviations.empty()) {
     // Start the debug abbrev section.
-    Asm->SwitchToDataSection(TAI->getDwarfAbbrevSection(), 0);
+    Asm->SwitchToDataSection(TAI->getDwarfAbbrevSection());
     
     EmitLabel("abbrev_begin", 0);
     
@@ -2477,7 +2477,7 @@
   const int MaxLineDelta = 255 + MinLineDelta;
 
   // Start the dwarf line section.
-  Asm->SwitchToDataSection(TAI->getDwarfLineSection(), 0);
+  Asm->SwitchToDataSection(TAI->getDwarfLineSection());
   
   // Construct the section header.
   
@@ -2636,7 +2636,7 @@
       TAI->getAddressSize() : -TAI->getAddressSize();
 
   // Start the dwarf frame section.
-  Asm->SwitchToDataSection(TAI->getDwarfFrameSection(), 0);
+  Asm->SwitchToDataSection(TAI->getDwarfFrameSection());
 
   EmitLabel("frame_common", 0);
   EmitDifference("frame_common_end", 0,
@@ -2669,7 +2669,7 @@
     return;
 
   // Start the dwarf frame section.
-  Asm->SwitchToDataSection(TAI->getDwarfFrameSection(), 0);
+  Asm->SwitchToDataSection(TAI->getDwarfFrameSection());
   
   EmitDifference("frame_end", SubprogramCount,
                  "frame_begin", SubprogramCount);
@@ -2699,7 +2699,7 @@
 ///
 void Dwarf::EmitDebugPubNames() {
   // Start the dwarf pubnames section.
-  Asm->SwitchToDataSection(TAI->getDwarfPubNamesSection(), 0);
+  Asm->SwitchToDataSection(TAI->getDwarfPubNamesSection());
     
   // Process each compile unit.
   for (unsigned i = 0, N = CompileUnits.size(); i < N; ++i) {
@@ -2746,7 +2746,7 @@
   // Check to see if it is worth the effort.
   if (!StringPool.empty()) {
     // Start the dwarf str section.
-    Asm->SwitchToDataSection(TAI->getDwarfStrSection(), 0);
+    Asm->SwitchToDataSection(TAI->getDwarfStrSection());
     
     // For each of strings in the string pool.
     for (unsigned StringID = 1, N = StringPool.size();
@@ -2766,7 +2766,7 @@
 ///
 void Dwarf::EmitDebugLoc() {
   // Start the dwarf loc section.
-  Asm->SwitchToDataSection(TAI->getDwarfLocSection(), 0);
+  Asm->SwitchToDataSection(TAI->getDwarfLocSection());
   
   O << "\n";
 }
@@ -2775,7 +2775,7 @@
 ///
 void Dwarf::EmitDebugARanges() {
   // Start the dwarf aranges section.
-  Asm->SwitchToDataSection(TAI->getDwarfARangesSection(), 0);
+  Asm->SwitchToDataSection(TAI->getDwarfARangesSection());
   
   // FIXME - Mock up
 #if 0
@@ -2816,7 +2816,7 @@
 ///
 void Dwarf::EmitDebugRanges() {
   // Start the dwarf ranges section.
-  Asm->SwitchToDataSection(TAI->getDwarfRangesSection(), 0);
+  Asm->SwitchToDataSection(TAI->getDwarfRangesSection());
   
   O << "\n";
 }
@@ -2825,7 +2825,7 @@
 ///
 void Dwarf::EmitDebugMacInfo() {
   // Start the dwarf macinfo section.
-  Asm->SwitchToDataSection(TAI->getDwarfMacInfoSection(), 0);
+  Asm->SwitchToDataSection(TAI->getDwarfMacInfoSection());
   
   O << "\n";
 }
@@ -2939,14 +2939,14 @@
   EOL("Dwarf End Module");
   
   // Standard sections final addresses.
-  Asm->SwitchToTextSection(TAI->getTextSection(), 0);
+  Asm->SwitchToTextSection(TAI->getTextSection());
   EmitLabel("text_end", 0);
-  Asm->SwitchToDataSection(TAI->getDataSection(), 0);
+  Asm->SwitchToDataSection(TAI->getDataSection());
   EmitLabel("data_end", 0);
   
   // End text sections.
   for (unsigned i = 1, N = SectionMap.size(); i <= N; ++i) {
-    Asm->SwitchToTextSection(SectionMap[i].c_str(), 0);
+    Asm->SwitchToTextSection(SectionMap[i].c_str());
     EmitLabel("section_end", i);
   }
   






More information about the llvm-commits mailing list