diff options
| author | Mehdi Amini <mehdi.amini@apple.com> | 2016-04-20 04:18:11 +0000 |
|---|---|---|
| committer | Mehdi Amini <mehdi.amini@apple.com> | 2016-04-20 04:18:11 +0000 |
| commit | bb3a1d92f3621f617a308731806eb95e1d763856 (patch) | |
| tree | 775cd458695bc84cacc314ac0bb7ef0dacda28c3 /llvm | |
| parent | f40dd3278e48ab00a0fc0ec4373965ac212e762c (diff) | |
| download | bcm5719-llvm-bb3a1d92f3621f617a308731806eb95e1d763856.tar.gz bcm5719-llvm-bb3a1d92f3621f617a308731806eb95e1d763856.zip | |
ThinLTO: never promote as external weak
This linkage is *not* intended to express that a declaration refers
to a weak symbol, but that the symbol might not be present at link
time. I don't believe it was the intent.
From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 266856
Diffstat (limited to 'llvm')
| -rw-r--r-- | llvm/lib/Transforms/Utils/FunctionImportUtils.cpp | 2 | ||||
| -rw-r--r-- | llvm/test/Linker/funcimport.ll | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Utils/FunctionImportUtils.cpp b/llvm/lib/Transforms/Utils/FunctionImportUtils.cpp index 07830750d29..c0628b3bd49 100644 --- a/llvm/lib/Transforms/Utils/FunctionImportUtils.cpp +++ b/llvm/lib/Transforms/Utils/FunctionImportUtils.cpp @@ -132,7 +132,7 @@ FunctionImportGlobalProcessing::getLinkage(const GlobalValue *SGV) { // linker. The module linking caller needs to enforce this. assert(!doImportAsDefinition(SGV)); // If imported as a declaration, it becomes external_weak. - return GlobalValue::ExternalWeakLinkage; + return SGV->getLinkage(); case GlobalValue::WeakODRLinkage: // For weak_odr linkage, there is a guarantee that all copies will be diff --git a/llvm/test/Linker/funcimport.ll b/llvm/test/Linker/funcimport.ll index f88fcab8a21..53dbc6d849a 100644 --- a/llvm/test/Linker/funcimport.ll +++ b/llvm/test/Linker/funcimport.ll @@ -98,7 +98,7 @@ ; reference should turned into an external_weak declaration. ; RUN: llvm-link %t2.bc -summary-index=%t3.thinlto.bc -import=callweakfunc:%t.bc -import=weakfunc:%t.bc -S 2>&1 | FileCheck %s --check-prefix=IMPORTWEAKFUNC ; IMPORTWEAKFUNC-DAG: Ignoring import request for weak-any function weakfunc -; IMPORTWEAKFUNC-DAG: declare extern_weak void @weakfunc +; IMPORTWEAKFUNC-DAG: declare void @weakfunc ; IMPORTWEAKFUNC-DAG: define available_externally void @callweakfunc ; IMPORTWEAKFUNC-NOT: @weakvar = extern_weak global i32, align 4 |

