Make the Dwarf macro information section optional; CellSPU's assembler
authorScott Michel <scottm@aero.org>
Mon, 26 Jan 2009 22:32:51 +0000 (22:32 +0000)
committerScott Michel <scottm@aero.org>
Mon, 26 Jan 2009 22:32:51 +0000 (22:32 +0000)
doesn't support it. The default is set to 'true', so this should not
impact any other target backends.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63058 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Target/TargetAsmInfo.h
lib/CodeGen/AsmPrinter/DwarfWriter.cpp
lib/Target/TargetAsmInfo.cpp

index 0de74103adcf1a4577ccd5ef477e4132a2134942..bdfacf765715f1eecb4ab0605080d1b270927946 100644 (file)
@@ -429,27 +429,31 @@ namespace llvm {
     /// HasLEB128 - True if target asm supports leb128 directives.
     ///
     bool HasLEB128; // Defaults to false.
-    
+
     /// hasDotLocAndDotFile - True if target asm supports .loc and .file
     /// directives for emitting debugging information.
     ///
     bool HasDotLocAndDotFile; // Defaults to false.
-    
+
     /// SupportsDebugInformation - True if target supports emission of debugging
     /// information.
     bool SupportsDebugInformation;
-        
+
     /// SupportsExceptionHandling - True if target supports
     /// exception handling.
     ///
     bool SupportsExceptionHandling; // Defaults to false.
-    
+
     /// RequiresFrameSection - true if the Dwarf2 output needs a frame section
     ///
     bool DwarfRequiresFrameSection; // Defaults to true.
 
+    /// SupportsMacInfo - true if the Dwarf output supports macro information
+    ///
+    bool SupportsMacInfoSection;            // Defaults to true
+
     /// NonLocalEHFrameLabel - If set, the EH_frame label needs to be non-local.
-    /// 
+    ///
     bool NonLocalEHFrameLabel;              // Defaults to false.
 
     /// GlobalEHDirective - This is the directive used to make exception frame
@@ -818,6 +822,9 @@ namespace llvm {
     bool doesDwarfRequireFrameSection() const {
       return DwarfRequiresFrameSection;
     }
+    bool doesSupportMacInfoSection() const {
+      return SupportsMacInfoSection;
+    }
     bool doesRequireNonLocalEHFrameLabel() const {
       return NonLocalEHFrameLabel;
     }
index 4b19d06c924e9b2078c23e90a19215eb1972ecd1..c651cb66ceb4fee80322992474a4db692fa0bde4 100644 (file)
@@ -2167,8 +2167,10 @@ private:
     EmitLabel("section_abbrev", 0);
     Asm->SwitchToDataSection(TAI->getDwarfARangesSection());
     EmitLabel("section_aranges", 0);
-    Asm->SwitchToDataSection(TAI->getDwarfMacInfoSection());
-    EmitLabel("section_macinfo", 0);
+    if (TAI->doesSupportMacInfoSection()) {
+      Asm->SwitchToDataSection(TAI->getDwarfMacInfoSection());
+      EmitLabel("section_macinfo", 0);
+    }
     Asm->SwitchToDataSection(TAI->getDwarfLineSection());
     EmitLabel("section_line", 0);
     Asm->SwitchToDataSection(TAI->getDwarfLocSection());
@@ -2755,10 +2757,12 @@ private:
   /// EmitDebugMacInfo - Emit visible names into a debug macinfo section.
   ///
   void EmitDebugMacInfo() {
-    // Start the dwarf macinfo section.
-    Asm->SwitchToDataSection(TAI->getDwarfMacInfoSection());
+    if (TAI->doesSupportMacInfoSection()) {
+      // Start the dwarf macinfo section.
+      Asm->SwitchToDataSection(TAI->getDwarfMacInfoSection());
 
-    Asm->EOL();
+      Asm->EOL();
+    }
   }
 
   /// ConstructCompileUnits - Create a compile unit DIEs.
index 532b8b9a5bbf9d0db5a4f579881604dd30bfc1cf..4666875c34c2fdfdc0b06e8280fa8ffde4cc51c5 100644 (file)
@@ -99,6 +99,7 @@ void TargetAsmInfo::fillDefaultValues() {
   SupportsDebugInformation = false;
   SupportsExceptionHandling = false;
   DwarfRequiresFrameSection = true;
+  SupportsMacInfoSection = true;
   NonLocalEHFrameLabel = false;
   GlobalEHDirective = 0;
   SupportsWeakOmittedEHFrame = true;