[PATCH] D47299: [CodeGenCXX] Emit strip.invariant.group with -fstrict-vtable-pointers

Piotr Padlewski via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 15 15:37:24 PDT 2018


Prazek added inline comments.


================
Comment at: clang/lib/CodeGen/CGExprScalar.cpp:1633
+      bool DstMayNotBeDynamic =
+          !DstClassDecl || DstClassDecl->mayBeNotDynamicClass();
+      if (SourceMayBeNotDynamic && DstMayBeDynamic) {
----------------
rjmccall wrote:
> If you made a couple of tiny helper functions here that you could invoke on either `SourceClassDecl` or `DstClassDecl`, you could avoid some redundant logic and also make the calls self-documenting enough to legibly inline into the `if`-conditions.
> 
> ...in fact, since you start from a QualType in every case, maybe you should just define the helper as a method there.
oh yea, it is definitely better!


Repository:
  rL LLVM

https://reviews.llvm.org/D47299





More information about the llvm-commits mailing list