[PATCH] D54928: [ThinLTO] Correct linkonce_any function import linkage. NFC.

Xin Tong via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 26 21:09:44 PST 2018


trentxintong created this revision.
trentxintong added reviewers: tejohnson, pcc.
Herald added subscribers: dexonsmith, inglorion.

This is a NFC as we do not import non-odr vague linkage when computing
for import list for a module.


Repository:
  rL LLVM

https://reviews.llvm.org/D54928

Files:
  lib/Transforms/Utils/FunctionImportUtils.cpp


Index: lib/Transforms/Utils/FunctionImportUtils.cpp
===================================================================
--- lib/Transforms/Utils/FunctionImportUtils.cpp
+++ lib/Transforms/Utils/FunctionImportUtils.cpp
@@ -124,7 +124,6 @@
     return SGV->getLinkage();
 
   switch (SGV->getLinkage()) {
-  case GlobalValue::LinkOnceAnyLinkage:
   case GlobalValue::LinkOnceODRLinkage:
   case GlobalValue::ExternalLinkage:
     // External and linkonce definitions are converted to available_externally
@@ -144,11 +143,13 @@
     // An imported available_externally declaration stays that way.
     return SGV->getLinkage();
 
+  case GlobalValue::LinkOnceAnyLinkage:
   case GlobalValue::WeakAnyLinkage:
-    // Can't import weak_any definitions correctly, or we might change the
-    // program semantics, since the linker will pick the first weak_any
-    // definition and importing would change the order they are seen by the
-    // linker. The module linking caller needs to enforce this.
+    // Can't import linkonce_any/weak_any definitions correctly, or we might
+    // change the program semantics, since the linker will pick the first
+    // linkonce_any/weak_any definition and importing would change the order
+    // they are seen by the linker. The module linking caller needs to enforce
+    // this.
     assert(!doImportAsDefinition(SGV));
     // If imported as a declaration, it becomes external_weak.
     return SGV->getLinkage();


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D54928.175392.patch
Type: text/x-patch
Size: 1457 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181127/77a308d3/attachment.bin>


More information about the llvm-commits mailing list