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
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits