aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/Analysis.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2016-01-15 18:23:46 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2016-01-15 18:23:46 +0000
commit79db917139bb0314b5e53a18996d84c57eeeb2fb (patch)
tree0f639d14b297840d3b1f4c6f30ca01f0b07eb742 /llvm/lib/CodeGen/Analysis.cpp
parent06a9b6f5d183ef197cd387a840b577fd53803f8a (diff)
downloadllvm-79db917139bb0314b5e53a18996d84c57eeeb2fb.zip
llvm-79db917139bb0314b5e53a18996d84c57eeeb2fb.tar.gz
llvm-79db917139bb0314b5e53a18996d84c57eeeb2fb.tar.bz2
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
Diffstat (limited to 'llvm/lib/CodeGen/Analysis.cpp')
-rw-r--r--llvm/lib/CodeGen/Analysis.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/Analysis.cpp b/llvm/lib/CodeGen/Analysis.cpp
index 75579a2..97b692f 100644
--- a/llvm/lib/CodeGen/Analysis.cpp
+++ b/llvm/lib/CodeGen/Analysis.cpp
@@ -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;