aboutsummaryrefslogtreecommitdiff
path: root/lib/LTO/LTO.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/LTO/LTO.cpp')
-rw-r--r--lib/LTO/LTO.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/LTO/LTO.cpp b/lib/LTO/LTO.cpp
index 6b11f690ef3..d8e5d6ed6be 100644
--- a/lib/LTO/LTO.cpp
+++ b/lib/LTO/LTO.cpp
@@ -356,7 +356,10 @@ static void thinLTOInternalizeAndPromoteGUID(
// Ignore local and appending linkage values since the linker
// doesn't resolve them.
!GlobalValue::isLocalLinkage(S->linkage()) &&
- !GlobalValue::isAppendingLinkage(S->linkage()))
+ S->linkage() != GlobalValue::AppendingLinkage &&
+ // We can't internalize available_externally globals because this
+ // can break function pointer equality.
+ S->linkage() != GlobalValue::AvailableExternallyLinkage)
S->setLinkage(GlobalValue::InternalLinkage);
}
}