<div dir="ltr">Perhaps it'd be good to have a general design discussion here, rather than in the form of line-by-line code review. A few broad issues have been brought up by both Paul and Frederic that sound reasonable to me, though I've not looked at the code in detail yet.<br><br>Is there any reason this wouldn't be implemented the same way as the imported entity work? Where we check for imported entities at scope construction time to decide whether to create that scope or not.</div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, May 24, 2015 at 9:00 AM, Amjad Aboud <span dir="ltr"><<a href="mailto:amjad.aboud@intel.com" target="_blank">amjad.aboud@intel.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi echristo, bkramer, dblaikie,<br>
<br>
This patch is needed for resolving Bug 19238.<br>
It is the first part which will be followed by D9758.<br>
<br>
The idea is to create all debug info lexical block DIEs and add them to the DIScope->DIE map.<br>
Latter, just before emitting the DIEs, we will search the DIE tree and collapse all redundant (useless) DIE lexical blocks.<br>
<br>
REPOSITORY<br>
  rL LLVM<br>
<br>
<a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__reviews.llvm.org_D9960&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=mQ4LZ2PUj9hpadE3cDHZnIdEwhEBrbAstXeMaFoB9tg&m=YmS0Fh3EueyV-7Lg7c8ENqlqfzzyOjagGLpq6ttWZ2Y&s=N6hBI5eh5iWtbL1JVlJMt5OQsxjm-v0DUqX7lrY8-lU&e=" target="_blank">http://reviews.llvm.org/D9960</a><br>
<br>
Files:<br>
  include/llvm/CodeGen/DIE.h<br>
  lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp<br>
  lib/CodeGen/AsmPrinter/DwarfDebug.cpp<br>
  lib/CodeGen/AsmPrinter/DwarfDebug.h<br>
  test/DebugInfo/useless_lexical_scope.ll<br>
<br>
EMAIL PREFERENCES<br>
  <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__reviews.llvm.org_settings_panel_emailpreferences_&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=mQ4LZ2PUj9hpadE3cDHZnIdEwhEBrbAstXeMaFoB9tg&m=YmS0Fh3EueyV-7Lg7c8ENqlqfzzyOjagGLpq6ttWZ2Y&s=0WrAx8bMz-D-ovNh0hDxfalcY6S_tPqJ7v7f7Tz2j3M&e=" target="_blank">http://reviews.llvm.org/settings/panel/emailpreferences/</a><br>
</blockquote></div><br></div>