[PATCH] D25579: [codeview] emit debug info for indirect virtual base classes
Reid Kleckner via cfe-commits
cfe-commits at lists.llvm.org
Wed Oct 19 16:30:25 PDT 2016
rnk accepted this revision.
rnk added a comment.
This revision is now accepted and ready to land.
Thanks, looks good with some nits
================
Comment at: lib/CodeGen/CGDebugInfo.cpp:1397
const auto *Base =
cast<CXXRecordDecl>(BI.getType()->getAs<RecordType>()->getDecl());
----------------
rnk wrote:
> You should be able to use this as the key into SeenTypes. You also want to do `Base = Base->getCanonicalDecl()`, though, so that we don't end up with pointers to different redeclarations of the same record. I don't think I can construct a case where this would matter, but it's probably still worth it. :)
So, the playing field shifted. Justin Lebar recently added the CanonicalDeclPtr template, which does the getCanonicalDecl dance for you. Probably best to use that. :)
================
Comment at: lib/CodeGen/CGDebugInfo.cpp:1393-1395
+ if (is_contained(SeenTypes, CanonicalBase))
+ continue;
+ SeenTypes.insert(CanonicalBase);
----------------
Now that we've figured out the best way to test set membership, I've realized we can save a hash lookup like this:
if (SeenTypes.insert(CanonicalBase).second)
continue;
https://reviews.llvm.org/D25579
More information about the cfe-commits
mailing list