From 708453d99ff4b16a3c0df889a64d6593fac3d6e9 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Wed, 9 Mar 2016 00:31:06 +0000 Subject: [PATCH] Assume GV is not null for now. It will come back when we add support for inline asm in .bc files. llvm-svn: 262972 --- lld/ELF/InputFiles.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/lld/ELF/InputFiles.cpp b/lld/ELF/InputFiles.cpp index 96499ea..2986cb0 100644 --- a/lld/ELF/InputFiles.cpp +++ b/lld/ELF/InputFiles.cpp @@ -438,17 +438,15 @@ void BitcodeFile::parse(DenseSet &ComdatGroups) { } for (const BasicSymbolRef &Sym : Obj->symbols()) { - uint8_t Visibility = STV_DEFAULT; const GlobalValue *GV = Obj->getSymbolGV(Sym.getRawDataRefImpl()); + assert(GV); uint32_t Flags = Sym.getFlags(); - if (GV) { - if (const Comdat *C = GV->getComdat()) - if (!KeptComdats.count(C)) - continue; - if (!(Flags & object::BasicSymbolRef::SF_Global)) + if (const Comdat *C = GV->getComdat()) + if (!KeptComdats.count(C)) continue; - Visibility = getGvVisibility(GV); - } + if (!(Flags & object::BasicSymbolRef::SF_Global)) + continue; + uint8_t Visibility = getGvVisibility(GV); SmallString<64> Name; raw_svector_ostream OS(Name); -- 2.7.4