summaryrefslogtreecommitdiffstats
path: root/llvm/lib/LTO
diff options
context:
space:
mode:
authorMehdi Amini <mehdi.amini@apple.com>2016-05-05 18:14:55 +0000
committerMehdi Amini <mehdi.amini@apple.com>2016-05-05 18:14:55 +0000
commit2ee1874aa8587df9c7b44f3de4cd5f5f31a8c5ed (patch)
treeb4c354c18963d8482c7ec1b36bf2a9916dab10e1 /llvm/lib/LTO
parent0e881d61c1712f636782f298fb6b1bf4a4ccee7d (diff)
downloadbcm5719-llvm-2ee1874aa8587df9c7b44f3de4cd5f5f31a8c5ed.tar.gz
bcm5719-llvm-2ee1874aa8587df9c7b44f3de4cd5f5f31a8c5ed.zip
LTOCodeGenerator: handle correctly "unnamed" symbol
This should fix the assertions in a clang LTO bootstrap we're seeing. From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 268658
Diffstat (limited to 'llvm/lib/LTO')
-rw-r--r--llvm/lib/LTO/LTOCodeGenerator.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/LTO/LTOCodeGenerator.cpp b/llvm/lib/LTO/LTOCodeGenerator.cpp
index cad5d8eda51..1980965b169 100644
--- a/llvm/lib/LTO/LTOCodeGenerator.cpp
+++ b/llvm/lib/LTO/LTOCodeGenerator.cpp
@@ -364,7 +364,7 @@ static void preserveDiscardableGVs(
}
llvm::Type *i8PTy = llvm::Type::getInt8PtrTy(TheModule.getContext());
auto mayPreserveGlobal = [&](GlobalValue &GV) {
- if (!GV.isDiscardableIfUnused() || GV.isDeclaration())
+ if (!GV.isDiscardableIfUnused() || GV.isDeclaration() || !GV.hasName())
return;
if (!mustPreserveGV(GV))
return;
OpenPOWER on IntegriCloud