llvm.org GIT mirror llvm / a14fac4
Remove faulty assertion in llvm-pdbutil If a class's first data member is an instance of an empty class, then an assertion in the PrettyClassLayoutGraphicalDumper would fail. The storage is reserved, but it's not marked as in use. As far as I understand, it's the assertion that's faulty, so I removed it and updated the nearby comment. Found by running llvm-pdbutil against its own PDB, and this assertion would fail on HashAdjusters, which is a HashTable whose first data member is a TraitsT, which is a PdbHashTraits<T>, which is an empty struct. (The struct has a specialization for uint32_t, but that specialization doesn't apply here because the T is actually ulittle32_t.) Differential Revision: https://reviews.llvm.org/D45645 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@330135 91177308-0d34-0410-b5e6-96231b3b80d8 Adrian McCarthy 1 year, 5 months ago
1 changed file(s) with 2 addition(s) and 5 deletion(s). Raw diff Collapse all Expand all
4949 uint32_t RelativeOffset = Item->getOffsetInParent();
5050 CurrentAbsoluteOffset = ClassOffsetZero + RelativeOffset;
5151
52 // Since there is storage there, it should be set! However, this might
53 // be an empty base, in which case it could extend outside the bounds of
54 // the parent class.
52 // This might be an empty base, in which case it could extend outside the
53 // bounds of the parent class.
5554 if (RelativeOffset < UseMap.size() && (Item->getSize() > 0)) {
56 assert(UseMap.test(RelativeOffset));
57
5855 // If there is any remaining padding in this class, and the offset of the
5956 // new item is after the padding, then we must have just jumped over some
6057 // padding. Print a padding row and then look for where the next block