diff options
author | Fangrui Song <i@maskray.me> | 2021-07-02 17:08:25 -0700 |
---|---|---|
committer | Fangrui Song <i@maskray.me> | 2021-07-02 17:08:25 -0700 |
commit | 252a1eecc04080d852ba58c6727970c688eb1619 (patch) | |
tree | 8d098ebec0f70387376722a7e26a129ad0447475 /llvm/lib/Analysis/ValueTracking.cpp | |
parent | 6b0d266036f73f5ee9556d211a7d0946091ff3b2 (diff) | |
download | llvm-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