aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/ValueTracking.cpp
diff options
context:
space:
mode:
authorFangrui Song <i@maskray.me>2021-07-02 17:08:25 -0700
committerFangrui Song <i@maskray.me>2021-07-02 17:08:25 -0700
commit252a1eecc04080d852ba58c6727970c688eb1619 (patch)
tree8d098ebec0f70387376722a7e26a129ad0447475 /llvm/lib/Analysis/ValueTracking.cpp
parent6b0d266036f73f5ee9556d211a7d0946091ff3b2 (diff)
downloadllvm-252a1eecc04080d852ba58c6727970c688eb1619.zip
llvm-252a1eecc04080d852ba58c6727970c688eb1619.tar.gz
llvm-252a1eecc04080d852ba58c6727970c688eb1619.tar.bz2
[ThinLTO] Respect ClearDSOLocalOnDeclarations for unimported functions
D74751 added `ClearDSOLocalOnDeclarations` and dropped dso_local for isDeclarationForLinker `GlobalValue`s. It missed a case for imported declarations (`doImportAsDefinition` is false while `isPerformingImport` is true). This can lead to a linker error for a default visibility symbol in `ld.lld -shared`. When `ClearDSOLocalOnDeclarations` is true, we check `isPerformingImport() && !doImportAsDefinition(&GV)` along with `GV.isDeclarationForLinker()`. The new condition checks an imported declaration. This patch fixes a `LLVMPolly.so` link error using a trunk clang -DLLVM_ENABLE_LTO=Thin. Reviewed By: tejohnson Differential Revision: https://reviews.llvm.org/D104986
Diffstat (limited to 'llvm/lib/Analysis/ValueTracking.cpp')
0 files changed, 0 insertions, 0 deletions