<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Wed, Jan 31, 2018 at 6:31 AM Momchil Velikov via Phabricator <<a href="mailto:reviews@reviews.llvm.org">reviews@reviews.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">chill created this revision.<br>
chill added reviewers: dblaikie, keith.walker.arm.<br>
Herald added subscribers: JDevlieghere, aprantl.<br>
<br>
This patch is the LLVM part of fixing the issues, described in <a href="https://bugs.llvm.org/show_bug.cgi?id=36168" rel="noreferrer" target="_blank">https://bugs.llvm.org/show_bug.cgi?id=36168</a></blockquote><div><br>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.<br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
<br>
- The representation of enumerator values in the debug info metadata now contains a boolean flag `isSigned`, which<br>
<br>
determines how the bits of the `value` are interpreted.<br>
<br>
- 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).<br>
- The debug info metadata for enumeration type contains (in flags) indication whether this is a C++11 "fixed enum".<br>
- For C++11 enumeration with a fixed underlying type, the DIE also includes the `DW_AT_enum_class` attribute (for DWARF version >= 4).<br>
- 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).<br>
<br>
The changes should be backwards compatible:<br>
<br>
- the `isSigned` attribute is optional and defaults to `true`<br>
- if the underlying type for the enumeration is not available, the enumerator values are considered signed<br>
- the `FixedEnum` flag defaults to clear<br>
<br>
There are corresponding changes to `clang` (I'll submit them shortly), however this patch in isolation<br>
ought to not break build or introduce regressions.<br>
<br>
<br>
Repository:<br>
rL LLVM<br>
<br>
<a href="https://reviews.llvm.org/D42734" rel="noreferrer" target="_blank">https://reviews.llvm.org/D42734</a><br>
<br>
Files:<br>
include/llvm/Bitcode/LLVMBitCodes.h<br>
include/llvm/IR/DIBuilder.h<br>
include/llvm/IR/DebugInfoFlags.def<br>
include/llvm/IR/DebugInfoMetadata.h<br>
lib/AsmParser/LLParser.cpp<br>
lib/Bitcode/Reader/MetadataLoader.cpp<br>
lib/Bitcode/Writer/BitcodeWriter.cpp<br>
lib/CodeGen/AsmPrinter/DwarfUnit.cpp<br>
lib/IR/AsmWriter.cpp<br>
lib/IR/DIBuilder.cpp<br>
lib/IR/DebugInfoMetadata.cpp<br>
lib/IR/LLVMContextImpl.h<br>
test/DebugInfo/Generic/debug-info-enum.ll<br>
test/DebugInfo/X86/enum-class.ll<br>
unittests/IR/MetadataTest.cpp<br>
<br>
</blockquote></div></div>