<div dir="ltr">And this is the part of the recent debug info schema changes that makes me a bit sad - the amount of code that has to change to add a field to a debug info record... that's a lot of files to touch, etc. :/<br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, May 4, 2015 at 12:58 PM, Adrian Prantl <span dir="ltr"><<a href="mailto:aprantl@apple.com" target="_blank">aprantl@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi dexonsmith, dblaikie, echristo,<br>
<br>
This patch adds a DWOId field to DICompileUnit so DWARF skeleton CUs can be expression in IR.<br></blockquote><div><br>We might want to call this ModuleId - normal DWOs won't have a DWOId passed down from the frontend (because it's computed in the backend by hashing the contents of the debug_info in the .dwo file). But maybe DWOId is fine - not sure, just throwing some ideas around.<br><br>I suppose this will be used on both sides of the module+fission work - passed down for a non-trivial CU when building the module's debug info itself. Then also passed down attached to a trivial CU when building the skeleton CU to reference the module? (in the latter case, it'll need to be used for the comdat group identifier too - we'll need some way to differentiate these two cases, then? as well as including all the special llvm attributes for module reconstitution (pending where they actually end up))<br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
A skeleton CU is a (typically empty) DW_TAG_compile_unit that has a DW_AT_(GNU)_dwo_name and a DW_AT_(GNU)_dwo_id attribute. It is used to refer to external debug info.<br>
<br>
This is a prerequisite for clang module debugging as discussed in <a href="http://lists.cs.uiuc.edu/pipermail/cfe-dev/2014-November/040076.html" target="_blank">http://lists.cs.uiuc.edu/pipermail/cfe-dev/2014-November/040076.html</a>.<br>
In order to refer to external types stored in split DWARF (dwo) objects, such as clang modules, we need to emit skeleton CUs, which identify the dwarf object (i.e., the clang module) by filename (the SplitDebugFilename) and a hash value, the dwo_id.<br>
<br>
This patch only contains the IR changes. The idea is that a CUs with a non-zero dwo_id field will be emitted together with a DW_AT_GNU_dwo_name and DW_AT_GNU_dwo_id attribute.<br>
<br>
REPOSITORY<br>
  rL LLVM<br>
<br>
<a href="http://reviews.llvm.org/D9488" target="_blank">http://reviews.llvm.org/D9488</a><br>
<br>
Files:<br>
  include/llvm/IR/DIBuilder.h<br>
  include/llvm/IR/DebugInfoMetadata.h<br>
  lib/AsmParser/LLParser.cpp<br>
  lib/Bitcode/Reader/BitcodeReader.cpp<br>
  lib/Bitcode/Writer/BitcodeWriter.cpp<br>
  lib/IR/AsmWriter.cpp<br>
  lib/IR/DIBuilder.cpp<br>
  lib/IR/DebugInfoMetadata.cpp<br>
  lib/IR/LLVMContextImpl.h<br>
  test/Assembler/mdcompileunit.ll<br>
  unittests/IR/MetadataTest.cpp<br>
<br>
EMAIL PREFERENCES<br>
  <a href="http://reviews.llvm.org/settings/panel/emailpreferences/" target="_blank">http://reviews.llvm.org/settings/panel/emailpreferences/</a><br>
</blockquote></div><br></div></div>