[llvm] r268658 - LTOCodeGenerator: handle correctly "unnamed" symbol
Mehdi Amini via llvm-commits
llvm-commits at lists.llvm.org
Thu May 5 11:14:56 PDT 2016
Author: mehdi_amini
Date: Thu May 5 13:14:55 2016
New Revision: 268658
URL: http://llvm.org/viewvc/llvm-project?rev=268658&view=rev
Log:
LTOCodeGenerator: handle correctly "unnamed" symbol
This should fix the assertions in a clang LTO bootstrap we're seeing.
From: Mehdi Amini <mehdi.amini at apple.com>
Modified:
llvm/trunk/lib/LTO/LTOCodeGenerator.cpp
Modified: llvm/trunk/lib/LTO/LTOCodeGenerator.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/LTO/LTOCodeGenerator.cpp?rev=268658&r1=268657&r2=268658&view=diff
==============================================================================
--- llvm/trunk/lib/LTO/LTOCodeGenerator.cpp (original)
+++ llvm/trunk/lib/LTO/LTOCodeGenerator.cpp Thu May 5 13:14:55 2016
@@ -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;
More information about the llvm-commits
mailing list