<div dir="ltr">I'll leave it up to someone with more Objective-C knowledge to some of this review (Eric - since he implemented the accelerator tables in the first place)<br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Nov 12, 2014 at 3:48 PM, Frederic Riss <span dir="ltr"><<a href="mailto:friss@apple.com" target="_blank">friss@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: friss<br>
Date: Wed Nov 12 17:48:10 2014<br>
New Revision: 221836<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=221836&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=221836&view=rev</a><br>
Log:<br>
[dwarfdump] Add support for dumping accelerator tables.<br>
<br>
The class used for the dump only allows to dump for the moment, but<br>
it can (and will) be easily extended to support search also.<br>
<br>
Added:<br>
    llvm/trunk/lib/DebugInfo/DWARFAcceleratorTable.cpp<br>
    llvm/trunk/lib/DebugInfo/DWARFAcceleratorTable.h<br>
    llvm/trunk/test/DebugInfo/dwarfdump-accel.test<br>
Modified:<br>
    llvm/trunk/include/llvm/DebugInfo/DIContext.h<br>
    llvm/trunk/lib/DebugInfo/CMakeLists.txt<br>
    llvm/trunk/lib/DebugInfo/DWARFContext.cpp<br>
    llvm/trunk/lib/DebugInfo/DWARFContext.h<br>
    llvm/trunk/test/DebugInfo/Inputs/gmlt.ll<br>
    llvm/trunk/tools/llvm-dwarfdump/llvm-dwarfdump.cpp<br>
<br>
Modified: llvm/trunk/include/llvm/DebugInfo/DIContext.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/DIContext.h?rev=221836&r1=221835&r2=221836&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/DIContext.h?rev=221836&r1=221835&r2=221836&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/include/llvm/DebugInfo/DIContext.h (original)<br>
+++ llvm/trunk/include/llvm/DebugInfo/DIContext.h Wed Nov 12 17:48:10 2014<br>
@@ -107,7 +107,11 @@ enum DIDumpType {<br>
   DIDT_GnuPubtypes,<br>
   DIDT_Str,<br>
   DIDT_StrDwo,<br>
-  DIDT_StrOffsetsDwo<br>
+  DIDT_StrOffsetsDwo,<br>
+  DIDT_AppleNames,<br>
+  DIDT_AppleTypes,<br>
+  DIDT_AppleNamespaces,<br>
+  DIDT_AppleObjC<br>
 };<br>
<br>
 // In place of applying the relocations to the data we've read from disk we use<br>
<br>
Modified: llvm/trunk/lib/DebugInfo/CMakeLists.txt<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/CMakeLists.txt?rev=221836&r1=221835&r2=221836&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/CMakeLists.txt?rev=221836&r1=221835&r2=221836&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/DebugInfo/CMakeLists.txt (original)<br>
+++ llvm/trunk/lib/DebugInfo/CMakeLists.txt Wed Nov 12 17:48:10 2014<br>
@@ -1,6 +1,7 @@<br>
 add_llvm_library(LLVMDebugInfo<br>
   DIContext.cpp<br>
   DWARFAbbreviationDeclaration.cpp<br>
+  DWARFAcceleratorTable.cpp<br>
   DWARFCompileUnit.cpp<br>
   DWARFContext.cpp<br>
   DWARFDebugAbbrev.cpp<br>
<br>
Added: llvm/trunk/lib/DebugInfo/DWARFAcceleratorTable.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/DWARFAcceleratorTable.cpp?rev=221836&view=auto" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/DWARFAcceleratorTable.cpp?rev=221836&view=auto</a><br>
==============================================================================<br>
--- llvm/trunk/lib/DebugInfo/DWARFAcceleratorTable.cpp (added)<br>
+++ llvm/trunk/lib/DebugInfo/DWARFAcceleratorTable.cpp Wed Nov 12 17:48:10 2014<br>
@@ -0,0 +1,110 @@<br>
+#include "DWARFAcceleratorTable.h"<br>
+<br>
+#include "llvm/Support/Dwarf.h"<br>
+#include "llvm/Support/Format.h"<br>
+#include "llvm/Support/raw_ostream.h"<br>
+<br>
+namespace llvm {<br>
+<br>
+bool DWARFAcceleratorTable::extract() {<br>
+  uint32_t Offset = 0;<br>
+<br>
+  // Check that we can at least read the header.<br>
+  if (!AccelSection.isValidOffset(offsetof(Header, HeaderDataLength)+4))<br>
+    return false;<br>
+<br>
+  Hdr.Magic = AccelSection.getU32(&Offset);<br>
+  Hdr.Version = AccelSection.getU16(&Offset);<br>
+  Hdr.HashFunction = AccelSection.getU16(&Offset);<br>
+  Hdr.NumBuckets = AccelSection.getU32(&Offset);<br>
+  Hdr.NumHashes = AccelSection.getU32(&Offset);<br>
+  Hdr.HeaderDataLength = AccelSection.getU32(&Offset);<br>
+<br>
+  // Check that we can read all the hashes and offsets from the<br>
+  // section (see SourceLevelDebugging.rst for the structure of the index).<br>
+  if (!AccelSection.isValidOffset(sizeof(Hdr) + Hdr.HeaderDataLength +<br>
+                                  Hdr.NumBuckets*4 + Hdr.NumHashes*8))<br>
+    return false;<br>
+<br>
+  HdrData.DIEOffsetBase = AccelSection.getU32(&Offset);<br>
+  uint32_t NumAtoms = AccelSection.getU32(&Offset);<br>
+<br>
+  for (unsigned i = 0; i < NumAtoms; ++i) {<br>
+    auto Atom = std::make_pair(AccelSection.getU16(&Offset),<br>
+                               DWARFFormValue(AccelSection.getU16(&Offset)));<br></blockquote><div><br></div><div>This might not be portable ^ due to unspecified order of evaluation of function arguments, this might read the fields in the wrong order (dwarfdump built with GCC versus dwarfdump built with Clang would behave differently)</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+    HdrData.Atoms.push_back(Atom);<br></blockquote><div><br>If not for the point above, I'd probably suggest rolling the make_pair into the push_back, but nevermind.<br><br>Is it worth doing HdrData.reserve(NumAtoms) before this loop?<br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+  }<br>
+<br>
+  return true;<br>
+}<br>
+<br>
+void DWARFAcceleratorTable::dump(raw_ostream &OS) {<br>
+  // Dump the header.<br>
+  OS << "Magic = " << format("0x%08x", Hdr.Magic) << '\n';<br>
+  OS << "Version = " << format("0x%04x", Hdr.Version) << '\n';<br>
+  OS << "Hash function = " << format("0x%08x", Hdr.HashFunction) << '\n';<br>
+  OS << "Bucket count = " << Hdr.NumBuckets << '\n';<br>
+  OS << "Hashes count = " << Hdr.NumHashes << '\n';<br>
+  OS << "HeaderData length = " << Hdr.HeaderDataLength << '\n';<br>
+  OS << "DIE offset base = " << HdrData.DIEOffsetBase << '\n';<br>
+  OS << "Number of atoms = " << HdrData.Atoms.size() << '\n';<br></blockquote><div><br>Looks like dwarfdump is inconsistent in this regard, but you can just do it:<br><br>OS << ...<br>      << ...<br>      << ...;<br><br>rather than separate OS/; on each line.<br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+<br>
+  unsigned i = 0;<br>
+  for (const auto &Atom: HdrData.Atoms) {<br>
+    OS << format("Atom[%d] ", i++);<br>
+    OS << " Type: " << dwarf::AtomTypeString(Atom.first);<br>
+    OS << " Form: " << dwarf::FormEncodingString(Atom.second.getForm());<br>
+    OS << "\n";<br></blockquote><div><br></div><div>Which would make code like this ^ just a single statement and you could omit the {} if you want (some people prefer to only omit the braces on single /line/ blocks rather than single statement blocks - up to you)<br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+  }<br>
+<br>
+  // Now go through the actual tables and dump them.<br>
+  uint32_t Offset = sizeof(Hdr) + Hdr.HeaderDataLength;<br>
+  unsigned HashesBase = Offset + Hdr.NumBuckets * 4;<br>
+  unsigned OffsetsBase = HashesBase + Hdr.NumHashes * 4;<br>
+<br>
+  for (unsigned Bucket = 0; Bucket < Hdr.NumBuckets; ++Bucket) {<br>
+    unsigned Index;<br>
+    Index = AccelSection.getU32(&Offset);<br></blockquote><div><br>Make this into a single line/initialization? ^<br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+<br>
+    OS << format("Bucket[%d]\n", Bucket);<br>
+    if (Index == UINT32_MAX) {<br>
+      OS << "  EMPTY\n";<br>
+      continue;<br>
+    }<br>
+<br>
+    for (unsigned HashIdx = Index; HashIdx < Hdr.NumHashes; ++HashIdx) {<br>
+      unsigned HashOffset = HashesBase + HashIdx*4;<br>
+      unsigned OffsetsOffset = OffsetsBase + HashIdx*4;<br>
+      uint32_t Hash = AccelSection.getU32(&HashOffset);<br>
+<br>
+      if (Hash % Hdr.NumBuckets != Bucket)<br>
+        break;<br>
+<br>
+      unsigned DataOffset = AccelSection.getU32(&OffsetsOffset);<br>
+      OS << format("  Hash = 0x%08x Offset = 0x%08x\n", Hash, DataOffset);<br>
+      if (!AccelSection.isValidOffset(DataOffset)) {<br>
+        OS << "    Invalid section offset\n";<br>
+        continue;<br>
+      }<br>
+      while (unsigned StringOffset = AccelSection.getU32(&DataOffset)) {<br>
+        OS << format("    Name: %08x \"%s\"\n", StringOffset,<br>
+                     StringSection.getCStr(&StringOffset));<br>
+        unsigned NumData = AccelSection.getU32(&DataOffset);<br>
+        for (unsigned Data = 0; Data < NumData; ++Data) {<br>
+          OS << format("    Data[%d] => ", Data);<br>
+          unsigned i = 0;<br>
+          for (auto &Atom : HdrData.Atoms) {<br>
+            OS << format("{Atom[%d]: ", i++);<br>
+            if (Atom.second.extractValue(AccelSection, &DataOffset, nullptr))<br>
+              Atom.second.dump(OS, nullptr);<br>
+            else<br>
+              OS << "Error extracting the value";<br>
+            OS << "} ";<br>
+          }<br>
+          OS << '\n';<br>
+        }<br>
+      }<br>
+    }<br>
+  }<br>
+}<br>
+}<br>
<br>
Added: llvm/trunk/lib/DebugInfo/DWARFAcceleratorTable.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/DWARFAcceleratorTable.h?rev=221836&view=auto" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/DWARFAcceleratorTable.h?rev=221836&view=auto</a><br>
==============================================================================<br>
--- llvm/trunk/lib/DebugInfo/DWARFAcceleratorTable.h (added)<br>
+++ llvm/trunk/lib/DebugInfo/DWARFAcceleratorTable.h Wed Nov 12 17:48:10 2014<br>
@@ -0,0 +1,38 @@<br>
+<br>
+#include "llvm/ADT/SmallVector.h"<br>
+#include "llvm/DebugInfo/DWARFFormValue.h"<br>
+<br>
+#include <cstdint><br>
+<br>
+namespace llvm {<br>
+<br>
+class DWARFAcceleratorTable {<br>
+<br>
+  struct Header {<br>
+    uint32_t Magic;<br>
+    uint16_t Version;<br>
+    uint16_t HashFunction;<br>
+    uint32_t NumBuckets;<br>
+    uint32_t NumHashes;<br>
+    uint32_t HeaderDataLength;<br>
+  };<br>
+<br>
+  struct HeaderData {<br>
+    typedef uint16_t AtomType;<br>
+    uint32_t DIEOffsetBase;<br>
+    SmallVector<std::pair<AtomType, DWARFFormValue>, 1> Atoms;<br>
+  };<br>
+<br>
+  struct Header Hdr;<br>
+  struct HeaderData HdrData;<br>
+  DataExtractor AccelSection;<br>
+  DataExtractor StringSection;<br>
+public:<br>
+  DWARFAcceleratorTable(DataExtractor AccelSection, DataExtractor StringSection)<br>
+    : AccelSection(AccelSection), StringSection(StringSection) {}<br>
+<br>
+  bool extract();<br>
+  void dump(raw_ostream &OS);<br>
+};<br>
+<br>
+}<br>
<br>
Modified: llvm/trunk/lib/DebugInfo/DWARFContext.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/DWARFContext.cpp?rev=221836&r1=221835&r2=221836&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/DWARFContext.cpp?rev=221836&r1=221835&r2=221836&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/DebugInfo/DWARFContext.cpp (original)<br>
+++ llvm/trunk/lib/DebugInfo/DWARFContext.cpp Wed Nov 12 17:48:10 2014<br>
@@ -9,6 +9,7 @@<br>
<br>
 #include "DWARFContext.h"<br>
 #include "DWARFDebugArangeSet.h"<br>
+#include "DWARFAcceleratorTable.h"<br>
<br>
 #include "llvm/ADT/SmallString.h"<br>
 #include "llvm/ADT/StringSwitch.h"<br>
@@ -59,6 +60,17 @@ static void dumpPubSection(raw_ostream &<br>
   }<br>
 }<br>
<br>
+static void dumpAccelSection(raw_ostream &OS, StringRef Name, StringRef Data,<br>
+                             StringRef StringSection, bool LittleEndian) {<br>
+  DataExtractor AccelSection(Data, LittleEndian, 0);<br>
+  DataExtractor StrData(StringSection, LittleEndian, 0);<br>
+  OS << "\n." << Name << " contents:\n";<br>
+  DWARFAcceleratorTable Accel(AccelSection, StrData);<br>
+  if (!Accel.extract())<br>
+    return;<br>
+  Accel.dump(OS);<br>
+}<br>
+<br>
 void DWARFContext::dump(raw_ostream &OS, DIDumpType DumpType) {<br>
   if (DumpType == DIDT_All || DumpType == DIDT_Abbrev) {<br>
     OS << ".debug_abbrev contents:\n";<br>
@@ -218,6 +230,22 @@ void DWARFContext::dump(raw_ostream &OS,<br>
       OS << format("%8.8x\n", strOffsetExt.getU32(&offset));<br>
     }<br>
   }<br>
+<br>
+  if (DumpType == DIDT_All || DumpType == DIDT_AppleNames)<br>
+    dumpAccelSection(OS, "apple_names", getAppleNamesSection(),<br>
+                     getStringSection(), isLittleEndian());<br>
+<br>
+  if (DumpType == DIDT_All || DumpType == DIDT_AppleTypes)<br>
+    dumpAccelSection(OS, "apple_types", getAppleTypesSection(),<br>
+                     getStringSection(), isLittleEndian());<br>
+<br>
+  if (DumpType == DIDT_All || DumpType == DIDT_AppleNamespaces)<br>
+    dumpAccelSection(OS, "apple_namespaces", getAppleNamespacesSection(),<br>
+                     getStringSection(), isLittleEndian());<br>
+<br>
+  if (DumpType == DIDT_All || DumpType == DIDT_AppleObjC)<br>
+    dumpAccelSection(OS, "apple_objc", getAppleObjCSection(),<br>
+                     getStringSection(), isLittleEndian());<br>
 }<br>
<br>
 const DWARFDebugAbbrev *DWARFContext::getDebugAbbrev() {<br>
@@ -565,6 +593,11 @@ DWARFContextInMemory::DWARFContextInMemo<br>
             .Case("debug_str.dwo", &StringDWOSection)<br>
             .Case("debug_str_offsets.dwo", &StringOffsetDWOSection)<br>
             .Case("debug_addr", &AddrSection)<br>
+            .Case("apple_names", &AppleNamesSection)<br>
+            .Case("apple_types", &AppleTypesSection)<br>
+            .Case("apple_namespaces", &AppleNamespacesSection)<br>
+            .Case("apple_namespac", &AppleNamespacesSection)<br>
+            .Case("apple_objc", &AppleObjCSection)<br>
             // Any more debug info sections go here.<br>
             .Default(nullptr);<br>
     if (SectionData) {<br>
<br>
Modified: llvm/trunk/lib/DebugInfo/DWARFContext.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/DWARFContext.h?rev=221836&r1=221835&r2=221836&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/DWARFContext.h?rev=221836&r1=221835&r2=221836&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/DebugInfo/DWARFContext.h (original)<br>
+++ llvm/trunk/lib/DebugInfo/DWARFContext.h Wed Nov 12 17:48:10 2014<br>
@@ -192,6 +192,10 @@ public:<br>
   virtual StringRef getStringOffsetDWOSection() = 0;<br>
   virtual StringRef getRangeDWOSection() = 0;<br>
   virtual StringRef getAddrSection() = 0;<br>
+  virtual StringRef getAppleNamesSection() = 0;<br>
+  virtual StringRef getAppleTypesSection() = 0;<br>
+  virtual StringRef getAppleNamespacesSection() = 0;<br>
+  virtual StringRef getAppleObjCSection() = 0;<br>
<br>
   static bool isSupportedVersion(unsigned version) {<br>
     return version == 2 || version == 3 || version == 4;<br>
@@ -236,6 +240,10 @@ class DWARFContextInMemory : public DWAR<br>
   StringRef StringOffsetDWOSection;<br>
   StringRef RangeDWOSection;<br>
   StringRef AddrSection;<br>
+  StringRef AppleNamesSection;<br>
+  StringRef AppleTypesSection;<br>
+  StringRef AppleNamespacesSection;<br>
+  StringRef AppleObjCSection;<br>
<br>
   SmallVector<SmallString<32>, 4> UncompressedSections;<br>
<br>
@@ -256,6 +264,10 @@ public:<br>
   StringRef getPubTypesSection() override { return PubTypesSection; }<br>
   StringRef getGnuPubNamesSection() override { return GnuPubNamesSection; }<br>
   StringRef getGnuPubTypesSection() override { return GnuPubTypesSection; }<br>
+  StringRef getAppleNamesSection() override { return AppleNamesSection; }<br>
+  StringRef getAppleTypesSection() override { return AppleTypesSection; }<br>
+  StringRef getAppleNamespacesSection() override { return AppleNamespacesSection; }<br>
+  StringRef getAppleObjCSection() override { return AppleObjCSection; }<br>
<br>
   // Sections for DWARF5 split dwarf proposal.<br>
   const DWARFSection &getInfoDWOSection() override { return InfoDWOSection; }<br>
<br>
Modified: llvm/trunk/test/DebugInfo/Inputs/gmlt.ll<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/Inputs/gmlt.ll?rev=221836&r1=221835&r2=221836&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/Inputs/gmlt.ll?rev=221836&r1=221835&r2=221836&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/test/DebugInfo/Inputs/gmlt.ll (original)<br>
+++ llvm/trunk/test/DebugInfo/Inputs/gmlt.ll Wed Nov 12 17:48:10 2014<br>
@@ -95,6 +95,8 @@<br>
 ; CHECK: .debug_pubtypes contents:<br>
 ; CHECK-NOT: Offset<br>
<br>
+; CHECK: .apple{{.*}} contents:<br>
+<br>
 ; Function Attrs: nounwind uwtable<br>
 define void @_Z2f1v() #0 {<br>
 entry:<br>
<br>
Added: llvm/trunk/test/DebugInfo/dwarfdump-accel.test<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/dwarfdump-accel.test?rev=221836&view=auto" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/dwarfdump-accel.test?rev=221836&view=auto</a><br>
==============================================================================<br>
--- llvm/trunk/test/DebugInfo/dwarfdump-accel.test (added)<br>
+++ llvm/trunk/test/DebugInfo/dwarfdump-accel.test Wed Nov 12 17:48:10 2014<br>
@@ -0,0 +1,154 @@<br>
+RUN: llvm-dwarfdump %p/Inputs/dwarfdump-objc.x86_64.o | FileCheck %s<br></blockquote><div><br></div><div>Does the example need to be this long? Could it involve fewer elements? What particular codepaths is it testing that require this length?</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+<br>
+CHECK: .apple_names contents:<br>
+CHECK: Magic = 0x48415348<br>
+CHECK: Version = 0x0001<br>
+CHECK: Hash function = 0x00000000<br>
+CHECK: Bucket count = 11<br>
+CHECK: Hashes count = 22<br>
+CHECK: HeaderData length = 12<br>
+CHECK: DIE offset base = 0<br>
+CHECK: Number of atoms = 1<br>
+CHECK: Atom[0]  Type: DW_ATOM_die_offset Form: DW_FORM_data4<br>
+CHECK: Bucket[0]<br>
+CHECK:   Hash = 0x248050fe Offset = 0x000000fc<br>
+CHECK:     Name: 00000165 "-[TestInterface Retain]"<br>
+CHECK:     Data[0] => {Atom[0]: 0x0000024f}<br>
+CHECK: Bucket[1]<br>
+CHECK:   Hash = 0x926d42cc Offset = 0x0000010c<br>
+CHECK:     Name: 00000057 "ReadWrite"<br>
+CHECK:     Data[0] => {Atom[0]: 0x000001cb}<br>
+CHECK: Bucket[2]<br>
+CHECK:   EMPTY<br>
+CHECK: Bucket[3]<br>
+CHECK:   Hash = 0x99254268 Offset = 0x0000011c<br>
+CHECK:     Name: 0000013f "-[TestInterface setReadWrite:]"<br>
+CHECK:     Data[0] => {Atom[0]: 0x00000209}<br>
+CHECK:   Hash = 0x946f52b9 Offset = 0x0000012c<br>
+CHECK:     Name: 000000c6 "-[TestInterface ReadOnly]"<br>
+CHECK:     Data[0] => {Atom[0]: 0x00000109}<br>
+CHECK: Bucket[4]<br>
+CHECK:   EMPTY<br>
+CHECK: Bucket[5]<br>
+CHECK:   EMPTY<br>
+CHECK: Bucket[6]<br>
+CHECK:   Hash = 0x6e8e91a3 Offset = 0x0000013c<br>
+CHECK:     Name: 000001e0 "-[TestInterface NonAtomic]"<br>
+CHECK:     Data[0] => {Atom[0]: 0x00000357}<br>
+CHECK:   Hash = 0x7d1a5012 Offset = 0x0000014c<br>
+CHECK:     Name: 0000014d "setReadWrite:"<br>
+CHECK:     Data[0] => {Atom[0]: 0x00000209}<br>
+CHECK:   Hash = 0xb65f49d3 Offset = 0x0000015c<br>
+CHECK:     Name: 0000020d "setNonAtomic:"<br>
+CHECK:     Data[0] => {Atom[0]: 0x00000395}<br>
+CHECK:   Hash = 0x354997e2 Offset = 0x0000016c<br>
+CHECK:     Name: 00000120 "-[TestInterface ReadWrite]"<br>
+CHECK:     Data[0] => {Atom[0]: 0x000001cb}<br>
+CHECK: Bucket[7]<br>
+CHECK:   Hash = 0xce8af9c8 Offset = 0x0000017c<br>
+CHECK:     Name: 0000005e "Retain"<br>
+CHECK:     Data[0] => {Atom[0]: 0x0000024f}<br>
+CHECK:   Hash = 0xa7e0338a Offset = 0x0000018c<br>
+CHECK:     Name: 0000004d "Assign"<br>
+CHECK:     Data[0] => {Atom[0]: 0x00000147}<br>
+CHECK:   Hash = 0xa9812410 Offset = 0x0000019c<br>
+CHECK:     Name: 00000105 "setAssign:"<br>
+CHECK:     Data[0] => {Atom[0]: 0x00000185}<br>
+CHECK:   Hash = 0x218d07f6 Offset = 0x000001ac<br>
+CHECK:     Name: 000001a2 "-[TestInterface Copy]"<br>
+CHECK:     Data[0] => {Atom[0]: 0x000002d3}<br>
+CHECK:   Hash = 0x0456817c Offset = 0x000001bc<br>
+CHECK:     Name: 000001bc "-[TestInterface setCopy:]"<br>
+CHECK:     Data[0] => {Atom[0]: 0x00000311}<br>
+CHECK:   Hash = 0x7c83b400 Offset = 0x000001cc<br>
+CHECK:     Name: 0000006c "Copy"<br>
+CHECK:     Data[0] => {Atom[0]: 0x000002d3}<br>
+CHECK: Bucket[8]<br>
+CHECK:   Hash = 0x0f918046 Offset = 0x000001dc<br>
+CHECK:     Name: 000001c5 "setCopy:"<br>
+CHECK:     Data[0] => {Atom[0]: 0x00000311}<br>
+CHECK:   Hash = 0xfb097449 Offset = 0x000001ec<br>
+CHECK:     Name: 000001ff "-[TestInterface setNonAtomic:]"<br>
+CHECK:     Data[0] => {Atom[0]: 0x00000395}<br>
+CHECK:   Hash = 0x71069de3 Offset = 0x000001fc<br>
+CHECK:     Name: 00000042 "ReadOnly"<br>
+CHECK:     Data[0] => {Atom[0]: 0x00000109}<br>
+CHECK: Bucket[9]<br>
+CHECK:   Hash = 0xd55908c6 Offset = 0x0000020c<br>
+CHECK:     Name: 000000fa "-[TestInterface setAssign:]"<br>
+CHECK:     Data[0] => {Atom[0]: 0x00000185}<br>
+CHECK:   Hash = 0xa584b20e Offset = 0x0000021c<br>
+CHECK:     Name: 0000018c "setRetain:"<br>
+CHECK:     Data[0] => {Atom[0]: 0x0000028d}<br>
+CHECK:   Hash = 0x9429886d Offset = 0x0000022c<br>
+CHECK:     Name: 00000076 "NonAtomic"<br>
+CHECK:     Data[0] => {Atom[0]: 0x00000357}<br>
+CHECK:   Hash = 0x287cc300 Offset = 0x0000023c<br>
+CHECK:     Name: 000000de "-[TestInterface Assign]"<br>
+CHECK:     Data[0] => {Atom[0]: 0x00000147}<br>
+CHECK:   Hash = 0x51ce5684 Offset = 0x0000024c<br>
+CHECK:     Name: 00000181 "-[TestInterface setRetain:]"<br>
+CHECK:     Data[0] => {Atom[0]: 0x0000028d}<br>
+CHECK: Bucket[10]<br>
+CHECK:   EMPTY<br>
+<br>
+<br>
+CHECK: .apple_types contents:<br>
+CHECK: Magic = 0x48415348<br>
+CHECK: Version = 0x0001<br>
+CHECK: Hash function = 0x00000000<br>
+CHECK: Bucket count = 4<br>
+CHECK: Hashes count = 4<br>
+CHECK: HeaderData length = 20<br>
+CHECK: DIE offset base = 0<br>
+CHECK: Number of atoms = 3<br>
+CHECK: Atom[0]  Type: DW_ATOM_die_offset Form: DW_FORM_data4<br>
+CHECK: Atom[1]  Type: DW_ATOM_die_tag Form: DW_FORM_data2<br>
+CHECK: Atom[2]  Type: DW_ATOM_type_flags Form: DW_FORM_data1<br>
+CHECK: Bucket[0]<br>
+CHECK:   Hash = 0x0b888030 Offset = 0x00000058<br>
+CHECK:     Name: 00000046 "int"<br>
+CHECK:     Data[0] => {Atom[0]: 0x000000f4} {Atom[1]: 0x0024} {Atom[2]: 0x00}<br>
+CHECK: Bucket[1]<br>
+CHECK:   Hash = 0x0b881d29 Offset = 0x0000006b<br>
+CHECK:     Name: 0000021b "SEL"<br>
+CHECK:     Data[0] => {Atom[0]: 0x000003e0} {Atom[1]: 0x0016} {Atom[2]: 0x00}<br>
+CHECK:   Hash = 0x2c549f3d Offset = 0x0000007e<br>
+CHECK:     Name: 00000067 "NSObject"<br>
+CHECK:     Data[0] => {Atom[0]: 0x00000100} {Atom[1]: 0x0013} {Atom[2]: 0x00}<br>
+CHECK: Bucket[2]<br>
+CHECK:   Hash = 0x16a83cb6 Offset = 0x00000091<br>
+CHECK:     Name: 00000039 "TestInterface"<br>
+CHECK:     Data[0] => {Atom[0]: 0x0000002f} {Atom[1]: 0x0013} {Atom[2]: 0x00}<br>
+CHECK: Bucket[3]<br>
+CHECK:   EMPTY<br>
+<br>
+<br>
+CHECK: .apple_namespaces contents:<br>
+CHECK-NOT: Magic<br>
+<br>
+<br>
+CHECK: .apple_objc contents:<br>
+CHECK: Magic = 0x48415348<br>
+CHECK: Version = 0x0001<br>
+CHECK: Hash function = 0x00000000<br>
+CHECK: Bucket count = 1<br>
+CHECK: Hashes count = 1<br>
+CHECK: HeaderData length = 12<br>
+CHECK: DIE offset base = 0<br>
+CHECK: Number of atoms = 1<br>
+CHECK: Atom[0]  Type: DW_ATOM_die_offset Form: DW_FORM_data4<br>
+CHECK: Bucket[0]<br>
+CHECK:   Hash = 0x16a83cb6 Offset = 0x0000002c<br>
+CHECK:     Name: 00000039 "TestInterface"<br>
+CHECK:     Data[0] => {Atom[0]: 0x00000109}<br>
+CHECK:     Data[1] => {Atom[0]: 0x00000147}<br>
+CHECK:     Data[2] => {Atom[0]: 0x00000185}<br>
+CHECK:     Data[3] => {Atom[0]: 0x000001cb}<br>
+CHECK:     Data[4] => {Atom[0]: 0x00000209}<br>
+CHECK:     Data[5] => {Atom[0]: 0x0000024f}<br>
+CHECK:     Data[6] => {Atom[0]: 0x0000028d}<br>
+CHECK:     Data[7] => {Atom[0]: 0x000002d3}<br>
+CHECK:     Data[8] => {Atom[0]: 0x00000311}<br>
+CHECK:     Data[9] => {Atom[0]: 0x00000357}<br>
+CHECK:     Data[10] => {Atom[0]: 0x00000395}<br>
\ No newline at end of file<br>
<br>
Modified: llvm/trunk/tools/llvm-dwarfdump/llvm-dwarfdump.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-dwarfdump/llvm-dwarfdump.cpp?rev=221836&r1=221835&r2=221836&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-dwarfdump/llvm-dwarfdump.cpp?rev=221836&r1=221835&r2=221836&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/tools/llvm-dwarfdump/llvm-dwarfdump.cpp (original)<br>
+++ llvm/trunk/tools/llvm-dwarfdump/llvm-dwarfdump.cpp Wed Nov 12 17:48:10 2014<br>
@@ -45,6 +45,10 @@ DumpType("debug-dump", cl::init(DIDT_All<br>
         clEnumValN(DIDT_All, "all", "Dump all debug sections"),<br>
         clEnumValN(DIDT_Abbrev, "abbrev", ".debug_abbrev"),<br>
         clEnumValN(DIDT_AbbrevDwo, "abbrev.dwo", ".debug_abbrev.dwo"),<br>
+        clEnumValN(DIDT_AppleNames, "apple_names", ".apple_names"),<br>
+        clEnumValN(DIDT_AppleTypes, "apple_types", ".apple_types"),<br>
+        clEnumValN(DIDT_AppleNamespaces, "apple_namespaces", ".apple_namespaces"),<br>
+        clEnumValN(DIDT_AppleObjC, "apple_objc", ".apple_objc"),<br>
         clEnumValN(DIDT_Aranges, "aranges", ".debug_aranges"),<br>
         clEnumValN(DIDT_Info, "info", ".debug_info"),<br>
         clEnumValN(DIDT_InfoDwo, "info.dwo", ".debug_info.dwo"),<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br></div></div>