[llvm-commits] [llvm] r77888 - in /llvm/trunk: include/llvm/Target/TargetLoweringObjectFile.h lib/CodeGen/AsmPrinter/DwarfException.cpp lib/Target/PowerPC/PPCTargetAsmInfo.cpp lib/Target/TargetAsmInfo.cpp lib/Target/TargetLoweringObjectFile.cpp lib/Target/X86/X86TargetAsmInfo.cpp

Chris Lattner sabre at nondot.org
Sat Aug 1 23:52:37 PDT 2009


Author: lattner
Date: Sun Aug  2 01:52:36 2009
New Revision: 77888

URL: http://llvm.org/viewvc/llvm-project?rev=77888&view=rev
Log:
convert EHFrameSection to be managed by TLOF instead of TAI.

Modified:
    llvm/trunk/include/llvm/Target/TargetLoweringObjectFile.h
    llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.cpp
    llvm/trunk/lib/Target/PowerPC/PPCTargetAsmInfo.cpp
    llvm/trunk/lib/Target/TargetAsmInfo.cpp
    llvm/trunk/lib/Target/TargetLoweringObjectFile.cpp
    llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp

Modified: llvm/trunk/include/llvm/Target/TargetLoweringObjectFile.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetLoweringObjectFile.h?rev=77888&r1=77887&r2=77888&view=diff

==============================================================================
--- llvm/trunk/include/llvm/Target/TargetLoweringObjectFile.h (original)
+++ llvm/trunk/include/llvm/Target/TargetLoweringObjectFile.h Sun Aug  2 01:52:36 2009
@@ -62,6 +62,11 @@
   /// the section the Language Specific Data Area information is emitted to.
   const MCSection *LSDASection;
   
+  /// EHFrameSection - If exception handling is supported by the target, this is
+  /// the section the EH Frame is emitted to.
+  const MCSection *EHFrameSection;
+  
+  
 public:
   // FIXME: NONPUB.
   const MCSection *getOrCreateSection(const char *Name,
@@ -84,7 +89,8 @@
   const MCSection *getStaticCtorSection() const { return StaticCtorSection; }
   const MCSection *getStaticDtorSection() const { return StaticDtorSection; }
   const MCSection *getLSDASection() const { return LSDASection; }
-  
+  const MCSection *getEHFrameSection() const { return EHFrameSection; }
+
   /// shouldEmitUsedDirectiveFor - This hook allows targets to selectively
   /// decide not to emit the UsedDirective for some symbols in llvm.used.
   /// FIXME: REMOVE this (rdar://7071300)

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.cpp?rev=77888&r1=77887&r2=77888&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.cpp Sun Aug  2 01:52:36 2009
@@ -56,7 +56,7 @@
     TD->getPointerSize() : -TD->getPointerSize();
 
   // Begin eh frame section.
-  Asm->SwitchToTextSection(TAI->getDwarfEHFrameSection());
+  Asm->SwitchToSection(Asm->getObjFileLowering().getEHFrameSection());
 
   if (TAI->is_EHSymbolPrivate())
     O << TAI->getPrivateGlobalPrefix();
@@ -150,7 +150,7 @@
 
   const Function *TheFunc = EHFrameInfo.function;
   
-  Asm->SwitchToTextSection(TAI->getDwarfEHFrameSection());
+  Asm->SwitchToSection(Asm->getObjFileLowering().getEHFrameSection());
 
   // Externally visible entry into the functions eh frame info. If the
   // corresponding function is static, this should not be externally visible.

Modified: llvm/trunk/lib/Target/PowerPC/PPCTargetAsmInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCTargetAsmInfo.cpp?rev=77888&r1=77887&r2=77888&view=diff

==============================================================================
--- llvm/trunk/lib/Target/PowerPC/PPCTargetAsmInfo.cpp (original)
+++ llvm/trunk/lib/Target/PowerPC/PPCTargetAsmInfo.cpp Sun Aug  2 01:52:36 2009
@@ -26,8 +26,6 @@
   UsedDirective = "\t.no_dead_strip\t";
   SupportsExceptionHandling = true;
   
-  DwarfEHFrameSection =
-   ".section __TEXT,__eh_frame,coalesced,no_toc+strip_static_syms+live_support";
   GlobalEHDirective = "\t.globl\t";
   SupportsWeakOmittedEHFrame = false;
 }
@@ -64,7 +62,6 @@
   if (!TM.getSubtargetImpl()->isPPC64())
     SupportsExceptionHandling = true;
   AbsoluteEHSectionOffsets = false;
-  DwarfEHFrameSection = "\t.section\t.eh_frame,\"aw\", at progbits";
 }
 
 

Modified: llvm/trunk/lib/Target/TargetAsmInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/TargetAsmInfo.cpp?rev=77888&r1=77887&r2=77888&view=diff

==============================================================================
--- llvm/trunk/lib/Target/TargetAsmInfo.cpp (original)
+++ llvm/trunk/lib/Target/TargetAsmInfo.cpp Sun Aug  2 01:52:36 2009
@@ -96,7 +96,6 @@
   DwarfARangesSection = ".debug_aranges";
   DwarfRangesSection = ".debug_ranges";
   DwarfMacroInfoSection = ".debug_macinfo";
-  DwarfEHFrameSection = ".eh_frame";
   AsmTransCBE = 0;
 }
 

Modified: llvm/trunk/lib/Target/TargetLoweringObjectFile.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/TargetLoweringObjectFile.cpp?rev=77888&r1=77887&r2=77888&view=diff

==============================================================================
--- llvm/trunk/lib/Target/TargetLoweringObjectFile.cpp (original)
+++ llvm/trunk/lib/Target/TargetLoweringObjectFile.cpp Sun Aug  2 01:52:36 2009
@@ -37,6 +37,7 @@
   StaticCtorSection = 0;
   StaticDtorSection = 0;
   LSDASection = 0;
+  EHFrameSection = 0;
 }
 
 TargetLoweringObjectFile::~TargetLoweringObjectFile() {
@@ -311,6 +312,8 @@
   // adjusted or this should be a data section.
   LSDASection =
     getOrCreateSection(".gcc_except_table", false, SectionKind::getReadOnly());
+  EHFrameSection =
+    getOrCreateSection(".eh_frame", false, SectionKind::getDataRel());
 }
 
 
@@ -548,6 +551,9 @@
   
   LSDASection = getOrCreateSection("__DATA,__gcc_except_tab", false,
                                    SectionKind::getDataRel());
+  EHFrameSection =
+    getOrCreateSection("__TEXT,__eh_frame,coalesced,no_toc+strip_static_syms"
+                       "+live_support", false, SectionKind::getReadOnly());
 }
 
 const MCSection *TargetLoweringObjectFileMachO::

Modified: llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp?rev=77888&r1=77887&r2=77888&view=diff

==============================================================================
--- llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp Sun Aug  2 01:52:36 2009
@@ -82,8 +82,6 @@
   GlobalEHDirective = "\t.globl\t";
   SupportsWeakOmittedEHFrame = false;
   AbsoluteEHSectionOffsets = false;
-  DwarfEHFrameSection =
-  ".section __TEXT,__eh_frame,coalesced,no_toc+strip_static_syms+live_support";
 }
 
 X86ELFTargetAsmInfo::X86ELFTargetAsmInfo(const X86TargetMachine &TM) :
@@ -115,7 +113,6 @@
   // Exceptions handling
   SupportsExceptionHandling = true;
   AbsoluteEHSectionOffsets = false;
-  DwarfEHFrameSection = "\t.section\t.eh_frame,\"aw\", at progbits";
 
   // On Linux we must declare when we can use a non-executable stack.
   if (TM.getSubtarget<X86Subtarget>().isLinux())





More information about the llvm-commits mailing list