[PATCH] D19236: Add DITypeIndex for CodeView and emit it for locals

Duncan P. N. Exon Smith via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 18 14:15:04 PDT 2016


I like this.  I think you're missing updates to ValueMapper.cpp, so
llvm-link will crash if you leave this as is.  For the code there,
it would be best to treat DITypeIndex exactly like MDString.

It might be nice to have a single `isa` target for types that (1)
don't have operands and (2) never change address.  Basically, things
like `MDString` and `DITypeRef` (and `DIExpression` should be moved
over, too...).

That'll keep down code duplication in ValueMapper; it'll probably be
useful in other places that don't really care about specific
semantics.

Maybe "ImmutableMetadata"?


> On 2016-Apr-18, at 13:43, Reid Kleckner <rnk at google.com> wrote:
> 
> rnk created this revision.
> rnk added reviewers: dexonsmith, aprantl, dblaikie, echristo.
> rnk added a subscriber: llvm-commits.
> Herald added a subscriber: joker.eph.
> 
> This is subclass of Metadata that essentially contains one 32-bit
> integer. It can stand in as a DITypeRef or a DIScopeRef in certain
> cases. If you attempt to resolve such a DITypeRef, you will get an
> assertion failure.
> 
> Currently the indexes can only represent the simple types below 0x1000.
> In the next patch I'll add support for type streams, and these indexes
> will be able to represent compound types such as record and function
> types.
> 
> http://reviews.llvm.org/D19236
> 
> 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/AsmParser/LLParser.h
>  lib/Bitcode/Reader/BitcodeReader.cpp
>  lib/Bitcode/Writer/BitcodeWriter.cpp
>  lib/Bitcode/Writer/ValueEnumerator.cpp
>  lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
>  lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
>  lib/CodeGen/AsmPrinter/DwarfUnit.cpp
>  lib/IR/AsmWriter.cpp
>  lib/IR/DIBuilder.cpp
>  lib/IR/DebugInfo.cpp
>  lib/IR/DebugInfoMetadata.cpp
>  lib/IR/LLVMContextImpl.h
>  lib/IR/Metadata.cpp
>  lib/IR/Verifier.cpp
>  test/DebugInfo/COFF/local-constant.ll
>  test/DebugInfo/COFF/local-variables.ll
>  test/DebugInfo/COFF/register-variables.ll
>  unittests/IR/IRBuilderTest.cpp
>  unittests/IR/MetadataTest.cpp
>  unittests/Transforms/Utils/Cloning.cpp
> 
> <D19236.54111.patch>



More information about the llvm-commits mailing list