[PATCH] Add a DIExternalTypeRef debug metadata node to the IR.

Adrian Prantl aprantl at apple.com
Fri May 8 12:58:56 PDT 2015


> On May 8, 2015, at 12:32 PM, David Blaikie <dblaikie at gmail.com> wrote:
> 
> 
> 
> On Fri, May 8, 2015 at 11:18 AM, Adrian Prantl <aprantl at apple.com <mailto:aprantl at apple.com>> wrote:
> Hi dexonsmith, dblaikie, echristo,
> 
> This adds a DIExternalTypeRef debug metadata node to the IR that is meant to be emitted by Clang when referring to a type that is defined in a .pcm file. DIExternalTypeRef is a child of DICompositeTypeBase because it shares common traits such as the unique identifier.
> 
> Could this be an attribute to the DIClassType/StructureType? (to emit the currently needed type unit references, we still should know the correct class/structure type tag) LLVM already knows to hash the ref identifier (mangled name) for the type unit identifier.

That would rule out using it for other kinds of types such as subroutine types (probably not so important) and typedef types (maybe as bit more so).

-- adrian

> 
> - David
>  
> 
> The idea how this is going to be used is that the frontend will discover that a type originates from an AST file and instead of and constructing a full DIType (and thus deserializing the type from the AST) it creates a DIExternalTypeRef with the tag type, mangled name and the .pcm file. The backend then can emit this as a split-DWARF-style forward declaration using DW_FORM_ref_sig8 (GDB) or as a string reference (LLDB) + and accelerator table entry.
> 
> REPOSITORY
>   rL LLVM
> 
> http://reviews.llvm.org/D9612 <http://reviews.llvm.org/D9612>
> 
> Files:
>   include/llvm/Bitcode/LLVMBitCodes.h
>   include/llvm/IR/DIBuilder.h
>   include/llvm/IR/DebugInfoMetadata.h
>   include/llvm/IR/Metadata.def
>   include/llvm/IR/Metadata.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
>   lib/IR/Verifier.cpp
>   test/Assembler/DIExternalTypeRef.ll
> 
> EMAIL PREFERENCES
>   http://reviews.llvm.org/settings/panel/emailpreferences/ <http://reviews.llvm.org/settings/panel/emailpreferences/>
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150508/3803cfbe/attachment.html>


More information about the llvm-commits mailing list