jmmartinez added inline comments.
================ Comment at: clang/lib/CodeGen/CGDebugInfo.cpp:1563 + + assert(PreviousBitfield->isBitField()); + ---------------- probinson wrote: > Is this true for cases like > ``` > struct nonadjacent { > char a : 8; > char : 0; > int b; > char d : 8; > }; > ``` > where the field `d` has a predecessor that is not a bitfield? (This might be > my ignorance of how Decls are put together, but asserting that `advance` is > guaranteed to get you a bitfield just seems a little odd.) In that case the assert is never reached. When emiting the debug-info for `d`, when looking at the metadata generated for the previous field the function should exit early on this condition: ``` if (!PreviousMDField || !PreviousMDField->isBitField() || PreviousMDField->getSizeInBits() == 0) return nullptr; ``` Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D144870/new/ https://reviews.llvm.org/D144870 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits