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

Momchil Velikov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 14 02:42:09 PST 2018

chill added a comment.

In https://reviews.llvm.org/D42734#1006877, @vsapsai wrote:

> Hi, Momchil. I suspect this change caused
> > Assertion failed: (DTy), function constructEnumTypeDIE, file /Users/buildslave/jenkins/workspace/clang-stage1-configure-RA/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp, line 1436.
> on the build bot http://green.lab.llvm.org/green/job/clang-stage2-Rthinlto/ For example, see http://green.lab.llvm.org/green/job/clang-stage2-Rthinlto/8694/console
> Earlier instead of `assert(DTy);` we had
>   if (DTy) {
>     addType(Buffer, DTy);
>     addFlag(Buffer, dwarf::DW_AT_enum_class);
>   }
> I don't know where the bug is but maybe it makes sense to remove assertion for now and correctly handle nullptr `DTy`? This will unblock the build bot for others and after that you can work on better fix if required.


This is quite strange. Having the flag `DINode::FlagFixedEnum` set means the LLVM IR was generated by this
version of Clang (as the last parameter to `createEnumerationType` did not exist before and defaults to `false`).

Perhaps the underlying type was null already in the AST?

For pre-existing `.ll` files, the flag `DINode::FlagFixedEnum` should be clear, and the control shouldn't even enter that if body.



More information about the llvm-commits mailing list