[PATCH] D42734: [DebugInfo] Improvements to representation of enumeration types (PR36168)

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 31 10:48:19 PST 2018


On Wed, Jan 31, 2018 at 6:31 AM Momchil Velikov via Phabricator <
reviews at reviews.llvm.org> wrote:

> chill created this revision.
> chill added reviewers: dblaikie, keith.walker.arm.
> Herald added subscribers: JDevlieghere, aprantl.
>
> This patch is the LLVM part of fixing the issues, described in
> https://bugs.llvm.org/show_bug.cgi?id=36168


As an aside - you don't need to file a bug in order to provide a patch. If
you're already working on the fix, feel free to skip filing the bug & just
explain everything in the patch/review.


>
>
> - The representation of enumerator values in the debug info metadata now
> contains a boolean flag `isSigned`, which
>
> determines how the bits of the `value` are interpreted.
>
> - The DW_TAG_enumeration type DIE now always (for DWARF version >= 3)
> includes a `DW_AT_type` attribute, which refers to the underlying integer
> type, as suggested in DWARFv4 (5.7 Enumeration Type Entries).
> - The debug info metadata for enumeration type contains (in flags)
> indication whether this is a C++11 "fixed enum".
> - For C++11 enumeration with a fixed underlying type, the DIE also
> includes the `DW_AT_enum_class` attribute (for DWARF version >= 4).
> - Encoding of enumerator constants uses `DW_FORM_sdata` for signed values
> and `DW_FORM_udata` for unsigned values, as suggested by DWARFv4 (7.5.4
> Attribute Encodings).
>
> The changes should be backwards compatible:
>
> - the `isSigned` attribute is optional and defaults to `true`
> - if the underlying type for the enumeration  is not available, the
> enumerator values are considered signed
> - the `FixedEnum` flag defaults to clear
>
> There are corresponding changes to `clang` (I'll submit them shortly),
> however this patch in isolation
>  ought to not break build or introduce regressions.
>
>
> Repository:
>   rL LLVM
>
> https://reviews.llvm.org/D42734
>
> Files:
>   include/llvm/Bitcode/LLVMBitCodes.h
>   include/llvm/IR/DIBuilder.h
>   include/llvm/IR/DebugInfoFlags.def
>   include/llvm/IR/DebugInfoMetadata.h
>   lib/AsmParser/LLParser.cpp
>   lib/Bitcode/Reader/MetadataLoader.cpp
>   lib/Bitcode/Writer/BitcodeWriter.cpp
>   lib/CodeGen/AsmPrinter/DwarfUnit.cpp
>   lib/IR/AsmWriter.cpp
>   lib/IR/DIBuilder.cpp
>   lib/IR/DebugInfoMetadata.cpp
>   lib/IR/LLVMContextImpl.h
>   test/DebugInfo/Generic/debug-info-enum.ll
>   test/DebugInfo/X86/enum-class.ll
>   unittests/IR/MetadataTest.cpp
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180131/21bd5237/attachment-0001.html>


More information about the llvm-commits mailing list