<div dir="ltr">Adding the dwarf accelerator tables is increasing the size of libclang.so (ToT) by ~12% so I don't think we want to generate them by default. Also these sections are not specified by any dwarf standard at the moment so emitting them by default would be strange in my opinion.<br><br><div class="gmail_quote"><div dir="ltr">On Thu, Nov 5, 2015 at 8:17 AM Saleem Abdulrasool <<a href="mailto:compnerd@compnerd.org">compnerd@compnerd.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br><br>On Wednesday, November 4, 2015, Tamas Berghammer via cfe-commits <<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">tberghammer created this revision.<br>
tberghammer added a reviewer: echristo.<br>
tberghammer added a subscriber: cfe-commits.<br>
<br>
Add new compiler flag to enable the generation of dwarf accelerator tables<br>
<br></blockquote><div><br></div><div>Is the additional information large enough to require a new flag?  They wouldn't break split debug even though they don't work there yet, so if the impact isn't large enough, might make sense to just enable them on -g.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
The dwarf accelerator tables already generated on darwin platforms. This CL ands a new flag to clang to make it possible to enable the generation of these tables on other platforms also.<br>
<br>
Note: Currently the accelerator table generation code isn't working when split dwarf is enabled for several reasons (accelerator tables aren't copied to dwo file, they contain relocation entries for the .debug_str.dwo sections). These issues should be addressed separately.<br>
<br>
<a href="http://reviews.llvm.org/D14354" target="_blank">http://reviews.llvm.org/D14354</a><br>
<br>
Files:<br>
  include/clang/Driver/Options.td<br>
  lib/Driver/Tools.cpp<br>
<br>
Index: lib/Driver/Tools.cpp<br>
===================================================================<br>
--- lib/Driver/Tools.cpp<br>
+++ lib/Driver/Tools.cpp<br>
@@ -3876,6 +3876,14 @@<br>
     CmdArgs.push_back("-split-dwarf=Enable");<br>
   }<br>
<br>
+  // -gdwarf-accel-tables should turn on -g and enable the genereation of the<br>
+  // dwarf acceleration tables in the backend.<br>
+  if (Args.hasArg(options::OPT_gdwarf_accel_tables)) {<br>
+    DebugInfoKind = CodeGenOptions::LimitedDebugInfo;<br>
+    CmdArgs.push_back("-backend-option");<br>
+    CmdArgs.push_back("-dwarf-accel-tables=Enable");<br>
+  }<br>
+<br>
   // After we've dealt with all combinations of things that could<br>
   // make DebugInfoKind be other than None or DebugLineTablesOnly,<br>
   // figure out if we need to "upgrade" it to standalone debug info.<br>
Index: include/clang/Driver/Options.td<br>
===================================================================<br>
--- include/clang/Driver/Options.td<br>
+++ include/clang/Driver/Options.td<br>
@@ -1161,6 +1161,7 @@<br>
 def gsplit_dwarf : Flag<["-"], "gsplit-dwarf">, Group<g_flags_Group>;<br>
 def ggnu_pubnames : Flag<["-"], "ggnu-pubnames">, Group<g_flags_Group>;<br>
 def gdwarf_aranges : Flag<["-"], "gdwarf-aranges">, Group<g_flags_Group>;<br>
+def gdwarf_accel_tables : Flag<["-"], "gdwarf-accel-tables">, Group<g_flags_Group>;<br>
 def gmodules : Flag <["-"], "gmodules">, Group<f_Group>,<br>
   HelpText<"Generate debug info with external references to clang modules"<br>
            " or precompiled headers">;<br>
<br>
<br>
</blockquote><br><br>-- <br>Saleem Abdulrasool<br>compnerd (at) compnerd (dot) org<br>
</blockquote></div></div>