[llvm] r228888 - Use the existing SymbolTableIndex instead of doing a lookup. NFC.
Rafael Espindola
rafael.espindola at gmail.com
Wed Feb 11 15:33:47 PST 2015
Author: rafael
Date: Wed Feb 11 17:33:46 2015
New Revision: 228888
URL: http://llvm.org/viewvc/llvm-project?rev=228888&view=rev
Log:
Use the existing SymbolTableIndex instead of doing a lookup. NFC.
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=228888&r1=228887&r2=228888&view=diff
==============================================================================
--- llvm/trunk/lib/MC/ELFObjectWriter.cpp (original)
+++ llvm/trunk/lib/MC/ELFObjectWriter.cpp Wed Feb 11 17:33:46 2015
@@ -1509,11 +1509,7 @@ void ELFObjectWriter::WriteSection(MCAss
case ELF::SHT_REL:
case ELF::SHT_RELA: {
- const MCSectionELF *SymtabSection;
- const MCSectionELF *InfoSection;
- SymtabSection =
- Asm.getContext().getELFSection(".symtab", ELF::SHT_SYMTAB, 0);
- sh_link = SectionIndexMap.lookup(SymtabSection);
+ sh_link = SymbolTableIndex;
assert(sh_link && ".symtab not found");
// Remove ".rel" and ".rela" prefixes.
@@ -1522,8 +1518,8 @@ void ELFObjectWriter::WriteSection(MCAss
StringRef GroupName =
Section.getGroup() ? Section.getGroup()->getName() : "";
- InfoSection = Asm.getContext().getELFSection(SectionName, ELF::SHT_PROGBITS,
- 0, 0, GroupName);
+ const MCSectionELF *InfoSection = Asm.getContext().getELFSection(
+ SectionName, ELF::SHT_PROGBITS, 0, 0, GroupName);
sh_info = SectionIndexMap.lookup(InfoSection);
break;
}
More information about the llvm-commits
mailing list