[PATCH] Add a DWOId field to DICompileUnit (so DWARF skeleton CUs can be expression in IR).

Duncan P. N. Exon Smith dexonsmith at apple.com
Mon May 4 13:06:26 PDT 2015


> On 2015 May 4, at 15:58, Adrian Prantl <aprantl at apple.com> wrote:
> 
> Hi dexonsmith, dblaikie, echristo,
> 
> This patch adds a DWOId field to DICompileUnit so DWARF skeleton CUs can be expression in IR.
> 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.
> 
> This is a prerequisite for clang module debugging as discussed in http://lists.cs.uiuc.edu/pipermail/cfe-dev/2014-November/040076.html.
> 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.
> 
> 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.
> 
> REPOSITORY
>  rL LLVM
> 
> http://reviews.llvm.org/D9488
> 
> Files:
>  include/llvm/IR/DIBuilder.h
>  include/llvm/IR/DebugInfoMetadata.h
>  lib/AsmParser/LLParser.cpp
>  lib/Bitcode/Reader/BitcodeReader.cpp
>  lib/Bitcode/Writer/BitcodeWriter.cpp
>  lib/IR/AsmWriter.cpp
>  lib/IR/DIBuilder.cpp
>  lib/IR/DebugInfoMetadata.cpp
>  lib/IR/LLVMContextImpl.h
>  test/Assembler/mdcompileunit.ll
>  unittests/IR/MetadataTest.cpp
> 
> EMAIL PREFERENCES
>  http://reviews.llvm.org/settings/panel/emailpreferences/
> <D9488.24899.patch>

Mostly looks good, but:

> Index: lib/Bitcode/Reader/BitcodeReader.cpp
> ===================================================================
> --- lib/Bitcode/Reader/BitcodeReader.cpp
> +++ lib/Bitcode/Reader/BitcodeReader.cpp
> @@ -1835,7 +1835,7 @@
>        break;
>      }
>      case bitc::METADATA_COMPILE_UNIT: {
> -      if (Record.size() != 14)
> +      if (Record.size() != 15)

This should auto-upgrade from a record size of 14.

>          return Error("Invalid record");
>  
>        MDValueList.AssignValue(
> @@ -1846,7 +1846,7 @@
>                             getMDString(Record[7]), Record[8],
>                             getMDOrNull(Record[9]), getMDOrNull(Record[10]),
>                             getMDOrNull(Record[11]), getMDOrNull(Record[12]),
> -                           getMDOrNull(Record[13]))),
> +                           getMDOrNull(Record[13]), Record[14])),
>            NextMDValueNo++);
>        break;
>      }





More information about the llvm-commits mailing list