mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 11:13:28 +01:00
Don't try to check all uses if lazy loading.
This means that LTO_SYMBOL_SCOPE_DEFAULT_CAN_BE_HIDDEN will not be set in a few cases. This should have no impact in ld64 since it doesn't use lazy loading when merging modules and that is when it checks LTO_SYMBOL_SCOPE_DEFAULT_CAN_BE_HIDDEN. llvm-svn: 257915
This commit is contained in:
parent
4f2e6d2b92
commit
2fb2eb1333
@ -639,6 +639,11 @@ bool llvm::canBeOmittedFromSymbolTable(const GlobalValue *GV) {
|
||||
if (isa<GlobalAlias>(GV))
|
||||
return false;
|
||||
|
||||
// If we don't see every use, we have to be conservative and assume the value
|
||||
// address is significant.
|
||||
if (GV->getParent()->getMaterializer())
|
||||
return false;
|
||||
|
||||
GlobalStatus GS;
|
||||
if (GlobalStatus::analyzeGlobal(GV, GS))
|
||||
return false;
|
||||
|
11
test/LTO/X86/pr25919.ll
Normal file
11
test/LTO/X86/pr25919.ll
Normal file
@ -0,0 +1,11 @@
|
||||
; RUN: llvm-as < %s >%t1
|
||||
; RUN: llvm-lto -list-symbols-only %t1 | FileCheck %s
|
||||
|
||||
; This tests that we don't crash trying to find all uses in a lazily loaded
|
||||
; module.
|
||||
; CHECK: foo
|
||||
|
||||
target triple = "x86_64-unknown-linux-gnu"
|
||||
define linkonce_odr void @foo() {
|
||||
ret void
|
||||
}
|
Loading…
Reference in New Issue
Block a user