[PATCH] D47299: [CodeGenCXX] Emit strip.invariant.group with -fstrict-vtable-pointers
Richard Smith - zygoloid via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed May 23 17:44:21 PDT 2018
rsmith added inline comments.
================
Comment at: clang/include/clang/AST/DeclCXX.h:779
+ bool mayBeDynamicClass() const {
+ return !isCompleteDefinition() || isDynamicClass();
+ }
----------------
`isCompleteDefinition` checks whether this declaration of the class is a definition, not whether it has a definition anywhere; the latter is what you need here. You can use `hasDefinition` to check that.
Please also check `hasAnyDependentBases()` (or add a comment to this function to indicate that it may return `false` for a templated class whose instantiations might be dynamic classes) -- if a class has dependent bases, we might not find out that it's a dynamic class until it's instantiated.
================
Comment at: clang/lib/CodeGen/CGExprScalar.cpp:1626-1627
+
+ // Casting to pointer that does not carry dynamic information (provided by
+ // invariant.group) requires stripping it.
+ Src = Builder.CreateStripInvariantGroup(Src);
----------------
Are there any cases where we need a barrier when the destination type is a dynamic type here?
Repository:
rL LLVM
https://reviews.llvm.org/D47299
More information about the cfe-commits
mailing list