summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2016-04-27 23:48:11 +0000
committerPeter Collingbourne <peter@pcc.me.uk>2016-04-27 23:48:11 +0000
commitedf843248093d5d72882540613cede8cfd0a2dc3 (patch)
tree891431dc3f548a41e1d14ee7e1c34f7b222295ae /llvm/lib
parent8eccdad5ecf64ee5e7de261879fc78210d7769e1 (diff)
downloadbcm5719-llvm-edf843248093d5d72882540613cede8cfd0a2dc3.tar.gz
bcm5719-llvm-edf843248093d5d72882540613cede8cfd0a2dc3.zip
LTO: Don't bother trying to mangle unnamed globals, as they can't be preserved with MustPreserveSymbols.
Summary: Should fix sanitizer-windows bot. Reviewers: joker.eph Subscribers: llvm-commits, joker.eph Differential Revision: http://reviews.llvm.org/D19635 llvm-svn: 267820
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/LTO/LTOCodeGenerator.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/LTO/LTOCodeGenerator.cpp b/llvm/lib/LTO/LTOCodeGenerator.cpp
index 01304641598..1aa836780c0 100644
--- a/llvm/lib/LTO/LTOCodeGenerator.cpp
+++ b/llvm/lib/LTO/LTOCodeGenerator.cpp
@@ -381,6 +381,10 @@ void LTOCodeGenerator::applyScopeRestrictions() {
// candidate GlobalValue if it can be internalized or not.
SmallString<64> MangledName;
auto mustPreserveGV = [&](const GlobalValue &GV) -> bool {
+ // Unnamed globals can't be mangled, but they can't be preserved either.
+ if (!GV.hasName())
+ return false;
+
// Need to mangle the GV as the "MustPreserveSymbols" StringSet is filled
// with the linker supplied name, which on Darwin includes a leading
// underscore.
OpenPOWER on IntegriCloud