summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXin Tong <trent.xin.tong@gmail.com>2018-11-28 15:16:35 +0000
committerXin Tong <trent.xin.tong@gmail.com>2018-11-28 15:16:35 +0000
commit53e52e47e8a7683f19e46d0b34c6f564e08f4184 (patch)
tree5458a24daf83263e34163219227267cb4ccce53e
parentcc3fa3972b5f944c229e2c09a7e318b096040dc4 (diff)
downloadbcm5719-llvm-53e52e47e8a7683f19e46d0b34c6f564e08f4184.tar.gz
bcm5719-llvm-53e52e47e8a7683f19e46d0b34c6f564e08f4184.zip
[ThinLTO] Correct linkonce_any function import linkage. NFC.
Summary: This is a NFC as we do not import non-odr vague linkage when computing for import list for a module. Reviewers: tejohnson, pcc Subscribers: inglorion, dexonsmith, llvm-commits Differential Revision: https://reviews.llvm.org/D54928 llvm-svn: 347763
-rw-r--r--llvm/lib/Transforms/Utils/FunctionImportUtils.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/llvm/lib/Transforms/Utils/FunctionImportUtils.cpp b/llvm/lib/Transforms/Utils/FunctionImportUtils.cpp
index dd952ea1853..70be86d8d6c 100644
--- a/llvm/lib/Transforms/Utils/FunctionImportUtils.cpp
+++ b/llvm/lib/Transforms/Utils/FunctionImportUtils.cpp
@@ -124,7 +124,6 @@ FunctionImportGlobalProcessing::getLinkage(const GlobalValue *SGV,
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 @@ FunctionImportGlobalProcessing::getLinkage(const GlobalValue *SGV,
// 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();
OpenPOWER on IntegriCloud