Add a __LD,__compact_unwind section.
authorBill Wendling <isanbard@gmail.com>
Wed, 22 Jun 2011 22:22:24 +0000 (22:22 +0000)
committerBill Wendling <isanbard@gmail.com>
Wed, 22 Jun 2011 22:22:24 +0000 (22:22 +0000)
If the linker supports it, this will hold the CIE and FDE information in a
compact format. The implementation of the compact unwinding emission is coming
soon.

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

include/llvm/Target/TargetLoweringObjectFile.h
lib/CodeGen/TargetLoweringObjectFileImpl.cpp
lib/Target/TargetLoweringObjectFile.cpp

index 3991035ce064823412f078ec14030b570c177664..12ea2a5756e8075cff3288ca438e7402584ca745 100644 (file)
@@ -68,6 +68,11 @@ protected:
   /// LSDASection - If exception handling is supported by the target, this is
   /// the section the Language Specific Data Area information is emitted to.
   const MCSection *LSDASection;
+
+  /// CompactUnwindSection - If exception handling is supported by the target
+  /// and the target can support a compact representation of the CIE and FDE,
+  /// this is the section to emit them into.
+  const MCSection *CompactUnwindSection;
   
   // Dwarf sections for debug info.  If a target supports debug info, these must
   // be set.
@@ -132,6 +137,7 @@ public:
   const MCSection *getStaticCtorSection() const { return StaticCtorSection; }
   const MCSection *getStaticDtorSection() const { return StaticDtorSection; }
   const MCSection *getLSDASection() const { return LSDASection; }
+  const MCSection *getCompactUnwindSection() const{return CompactUnwindSection;}
   virtual const MCSection *getEHFrameSection() const = 0;
   virtual void emitPersonalityValue(MCStreamer &Streamer,
                                     const TargetMachine &TM,
index 2da1bd48fb183c5c2b71f6a9d2bf25d03422c9b4..3f346a359578284b5d1f313a0f4c2e62c26a395b 100644 (file)
@@ -605,6 +605,12 @@ void TargetLoweringObjectFileMachO::Initialize(MCContext &Ctx,
   // Exception Handling.
   LSDASection = getContext().getMachOSection("__TEXT", "__gcc_except_tab", 0,
                                              SectionKind::getReadOnlyWithRel());
+
+  CompactUnwindSection =
+    getContext().getMachOSection("__LD", "__compact_unwind",
+                                 MCSectionMachO::S_ATTR_DEBUG,
+                                 SectionKind::getReadOnly());
+
   // Debug Information.
   DwarfAbbrevSection =
     getContext().getMachOSection("__DWARF", "__debug_abbrev",
index 3e2a768d2d29956b409729cac608e7a47157e0a7..9f87c071643063c4ff78249c23fc51df0f24fe19 100644 (file)
@@ -43,6 +43,7 @@ TargetLoweringObjectFile::TargetLoweringObjectFile() : Ctx(0) {
   StaticCtorSection = 0;
   StaticDtorSection = 0;
   LSDASection = 0;
+  CompactUnwindSection = 0;
 
   CommDirectiveSupportsAlignment = true;
   DwarfAbbrevSection = 0;