[lld] r262972 - Assume GV is not null for now.
Rafael Espindola via llvm-commits
llvm-commits at lists.llvm.org
Tue Mar 8 16:31:07 PST 2016
Author: rafael
Date: Tue Mar 8 18:31:06 2016
New Revision: 262972
URL: http://llvm.org/viewvc/llvm-project?rev=262972&view=rev
Log:
Assume GV is not null for now.
It will come back when we add support for inline asm in .bc files.
Modified:
lld/trunk/ELF/InputFiles.cpp
Modified: lld/trunk/ELF/InputFiles.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/InputFiles.cpp?rev=262972&r1=262971&r2=262972&view=diff
==============================================================================
--- lld/trunk/ELF/InputFiles.cpp (original)
+++ lld/trunk/ELF/InputFiles.cpp Tue Mar 8 18:31:06 2016
@@ -438,17 +438,15 @@ void BitcodeFile::parse(DenseSet<StringR
}
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);
More information about the llvm-commits
mailing list