[prev in list] [next in list] [prev in thread] [next in thread] 

List:       cfe-commits
Subject:    Re: [PATCH] D11441: Generating available_externally vtables for classes without inline virtual funct
From:       Richard Smith <richard () metafoo ! co ! uk>
Date:       2015-07-23 0:50:35
Message-ID: 4d64f5369ea9569bb497c924dc37a939 () localhost ! localdomain
[Download RAW message or body]

rsmith added inline comments.

================
Comment at: lib/CodeGen/ItaniumCXXABI.cpp:309
@@ +308,3 @@
+ private:
+  /// Checks if function have any virtual inline function.
+  bool hasAnyVirtualInlineFunction(const CXXRecordDecl *RD) const {
----------------
function have -> RD has

================
Comment at: lib/CodeGen/ItaniumCXXABI.cpp:320
@@ +319,3 @@
+      const auto &method = vtableComponent.getFunctionDecl();
+      if (method->getMostRecentDecl()->isInlined()) return true;
+    }
----------------
majnemer wrote:
> Would we want to use `getCanonicalDecl` instead?
That would give the wrong answer in some cases. The `isInlined` flag is monotonically increasing across \
the redeclaration chain (at least until we reach a definition, at which point it can't change any more), \
so checking it on the most recent declaration at end of TU gives the correct answer. The canonical \
declaration may lie to you.

================
Comment at: lib/CodeGen/ItaniumCXXABI.cpp:1510-1511
@@ +1509,4 @@
+  // can emit definition of the inline functions.
+  if (!CGM.getCodeGenOpts().OptimizationLevel || CGM.getLangOpts().AppleKext)
+    return false;
+
----------------
I think the `OptimizationLevel` check belongs in the caller, not here. (We can emit \
`available_externally` vtables even at -O0, we just usually don't want to do so.)


http://reviews.llvm.org/D11441




_______________________________________________
cfe-commits mailing list
cfe-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic