[llvm] r359300 - [yaml2obj] - Remove excessive variable. NFC.
George Rimar via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 26 05:45:54 PDT 2019
Author: grimar
Date: Fri Apr 26 05:45:54 2019
New Revision: 359300
URL: http://llvm.org/viewvc/llvm-project?rev=359300&view=rev
Log:
[yaml2obj] - Remove excessive variable. NFC.
`auto &Strtab` was used only once.
Modified:
llvm/trunk/tools/yaml2obj/yaml2elf.cpp
Modified: llvm/trunk/tools/yaml2obj/yaml2elf.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/yaml2obj/yaml2elf.cpp?rev=359300&r1=359299&r2=359300&view=diff
==============================================================================
--- llvm/trunk/tools/yaml2obj/yaml2elf.cpp (original)
+++ llvm/trunk/tools/yaml2obj/yaml2elf.cpp Fri Apr 26 05:45:54 2019
@@ -325,9 +325,9 @@ void ELFState<ELFT>::initSymtabSectionHe
SHeader.sh_name = DotShStrtab.getOffset(IsStatic ? ".symtab" : ".dynsym");
SHeader.sh_type = IsStatic ? ELF::SHT_SYMTAB : ELF::SHT_DYNSYM;
SHeader.sh_link = IsStatic ? getDotStrTabSecNo() : getDotDynStrSecNo();
- const auto &Symbols = IsStatic ? Doc.Symbols : Doc.DynamicSymbols;
- auto &Strtab = IsStatic ? DotStrtab : DotDynstr;
+
// One greater than symbol table index of the last local symbol.
+ const auto &Symbols = IsStatic ? Doc.Symbols : Doc.DynamicSymbols;
SHeader.sh_info = findFirstNonGlobal(Symbols) + 1;
SHeader.sh_entsize = sizeof(Elf_Sym);
SHeader.sh_addralign = 8;
@@ -352,7 +352,7 @@ void ELFState<ELFT>::initSymtabSectionHe
Syms.push_back(Sym);
}
- addSymbols(Symbols, Syms, Strtab);
+ addSymbols(Symbols, Syms, IsStatic ? DotStrtab : DotDynstr);
writeArrayData(
CBA.getOSAndAlignedOffset(SHeader.sh_offset, SHeader.sh_addralign),
More information about the llvm-commits
mailing list