[PATCH] D31267: [codeview] Move type index remapping logic to type merger

Zachary Turner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 22 16:40:01 PDT 2017

zturner added inline comments.

Comment at: lib/DebugInfo/CodeView/TypeStreamMerger.cpp:163
+Error TypeStreamMerger::visitKnownRecord(CVType &, ModifierRecord &R) {
+  return writeRecord(R, remapIndex(R.ModifiedType));
rnk wrote:
> zturner wrote:
> > I forgot why we store `LastError` and proceed through the type stream, instead of just returning the error right away and failing.  Do you happen to know?
> Yes, we want to be able to recover from corrupted records by skipping the record and mapping all uses of it to the untranslated type index. One bad type index shouldn't make us throw away all type information when linking.
Perhaps we could do a better job joining together the errors then.  Is it worth it to save *all* the errors?  If not, I think "first error" would be better than "last error".  Right now we skip a few (for example if `remapIndex` fails multiple times on a single record)


More information about the llvm-commits mailing list