[llvm] r238479 - Avoid warnings when building without asserts.
Rafael Espindola
rafael.espindola at gmail.com
Thu May 28 13:19:31 PDT 2015
Author: rafael
Date: Thu May 28 15:19:31 2015
New Revision: 238479
URL: http://llvm.org/viewvc/llvm-project?rev=238479&view=rev
Log:
Avoid warnings when building without asserts.
Modified:
llvm/trunk/lib/MC/ELFObjectWriter.cpp
Modified: llvm/trunk/lib/MC/ELFObjectWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/ELFObjectWriter.cpp?rev=238479&r1=238478&r2=238479&view=diff
==============================================================================
--- llvm/trunk/lib/MC/ELFObjectWriter.cpp (original)
+++ llvm/trunk/lib/MC/ELFObjectWriter.cpp Thu May 28 15:19:31 2015
@@ -961,19 +961,14 @@ void ELFObjectWriter::computeSymbolTable
for (ELFSymbolData &MSD : ExternalSymbolData) {
MSD.StringIndex = StrTabBuilder.getOffset(MSD.Name);
MSD.Symbol->setIndex(Index++);
- MCSymbolData &Data = MSD.Symbol->getData();
- assert(((Data.getFlags() & ELF_STB_Global) ||
- (Data.getFlags() & ELF_STB_Weak)) &&
- "External symbol requires STB_GLOBAL or STB_WEAK flag");
WriteSymbol(Writer, MSD, Layout);
- assert(MCELF::GetBinding(Data) != ELF::STB_LOCAL);
+ assert(MCELF::GetBinding(MSD.Symbol->getData()) != ELF::STB_LOCAL);
}
for (ELFSymbolData &MSD : UndefinedSymbolData) {
MSD.StringIndex = StrTabBuilder.getOffset(MSD.Name);
MSD.Symbol->setIndex(Index++);
- MCSymbolData &Data = MSD.Symbol->getData();
WriteSymbol(Writer, MSD, Layout);
- assert(MCELF::GetBinding(Data) != ELF::STB_LOCAL);
+ assert(MCELF::GetBinding(MSD.Symbol->getData()) != ELF::STB_LOCAL);
}
uint64_t SecEnd = OS.tell();
More information about the llvm-commits
mailing list