[PATCH] D71913: [LTO/WPD] Enable aggressive WPD under LTO option

Eugene Leviant via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 23 02:00:34 PST 2020


evgeny777 added a comment.

Looks good so far. See remaining comment in D71907 <https://reviews.llvm.org/D71907>



================
Comment at: clang/lib/CodeGen/CGVTables.cpp:1050
 
-  if (getCodeGenOpts().LTOVisibilityPublicStd) {
-    const DeclContext *DC = RD;
-    while (1) {
-      auto *D = cast<Decl>(DC);
-      DC = DC->getParent();
-      if (isa<TranslationUnitDecl>(DC->getRedeclContext())) {
-        if (auto *ND = dyn_cast<NamespaceDecl>(D))
-          if (const IdentifierInfo *II = ND->getIdentifier())
-            if (II->isStr("std") || II->isStr("stdext"))
-              return false;
-        break;
-      }
-    }
-  }
+  if (HasLTOVisibilityPublicStd(RD))
+    return false;
----------------
nit: return !HasLTOVisibilityPublicStd(RD)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D71913/new/

https://reviews.llvm.org/D71913





More information about the cfe-commits mailing list