Few comments:<div><br></div><div><div>+public:</div><div>+  enum DebugLevelOptions {</div><div>+    DWARF_2 = 2,</div><div>+    DWARF_3,</div><div>+    DWARF_4,</div><div>+    BAD_DEBUG_LEVEL</div><div>+  };</div><div>+private:</div>
</div><div><br></div><div>No underscore between the DWARF and number.</div><div><br></div><div class="gmail_extra"><div class="gmail_extra">-  if (!DD->useDarwinGDBCompat())</div><div class="gmail_extra">+  if (!DD->useDarwinGDBCompat() && DD->getDebugLevel() >= DwarfDebug::DWARF_4)</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">While this covers one of the output elements, it doesn't cover that many of them. I see you put this as a first step, but I'd rather a bit more step at first. You'll want to go through and enumerate the things in dwarf2, dwarf3, dwarf4 and make sure that they're covered by the appropriate level and are tested as such. This is going to be even more important in the front end where we'll probably have to distinguish (or not emit debug info for) c++11 features or other changes if you want to do strict compliance. I'd like to see how you're going to handle the changes in dwarf emission from the front end as well.</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">As far as the option handling, I guess it'll work and don't have any brilliant ideas.</div><div class="gmail_extra"><br></div><div class="gmail_extra">-eric</div>
<br><div class="gmail_quote">On Sun, Nov 25, 2012 at 11:43 AM, Pranav Bhandarkar <span dir="ltr"><<a href="mailto:pranavb@codeaurora.org" target="_blank">pranavb@codeaurora.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
Hi,<br>
<br>
In October, there had been a discussion (<a href="http://lists.cs.uiuc.edu/pipermail/llvmdev/2012-October/054543.html" target="_blank">http://lists.cs.uiuc.edu/<u></u>pipermail/llvmdev/2012-<u></u>October/054543.html</a>) about DWARF information related backwards compatibility. Rick Foos (he was speaking on my behalf too), in the email above, had proposed a mechanism for backwards compatibility. Unfortunately, I could not tend to it at that time, but now I have been able to. I am attaching two patches here, one for LLVM and the other for clang.<br>

<br>
1) The LLVM patch introduces a command line variable DwarfDebugLevel that is set to 4 by default. Additionaly, as a first step, this is used in CompileUnit:addFlag to gate the use of DW_FORM_flag_present which is a DWARF 4 addition that is compatible with DWARF 3.<br>

<br>
2) The second patch is a patch to clang to process the -gdwarf-2/3/4 flags, which involves setting DwarfDebugLevel using the -dwarf-debug-level option for "clang -cc1".<br>
<br>
This is an initial proposal. Please comment on what changes are needed. I am posting the clang patch here too because I wanted to post both the patches in one place. If cfe-commits is a better place to post (or if the two patches should be posted on both the lists) please let me know, and I'll do that.<br>

<br>
Thanks,<br>
Pranav<span class=""><font color="#888888"><br>
-- <br>
Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, hosted by The Linux Foundation.<br>
</font></span><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>
<br></blockquote></div><br></div>