[lld] r282850 - [ELF] - Removed excessive variables. NFC.
George Rimar via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 30 06:44:04 PDT 2016
Author: grimar
Date: Fri Sep 30 08:44:02 2016
New Revision: 282850
URL: http://llvm.org/viewvc/llvm-project?rev=282850&view=rev
Log:
[ELF] - Removed excessive variables. NFC.
Modified:
lld/trunk/ELF/ELFCreator.cpp
Modified: lld/trunk/ELF/ELFCreator.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/ELFCreator.cpp?rev=282850&r1=282849&r2=282850&view=diff
==============================================================================
--- lld/trunk/ELF/ELFCreator.cpp (original)
+++ lld/trunk/ELF/ELFCreator.cpp Fri Sep 30 08:44:02 2016
@@ -60,18 +60,16 @@ ELFCreator<ELFT>::ELFCreator(std::uint16
template <class ELFT>
typename ELFCreator<ELFT>::Section
ELFCreator<ELFT>::addSection(StringRef Name) {
- std::size_t NameOff = SecHdrStrTabBuilder.add(Name);
auto Shdr = new (Alloc) Elf_Shdr{};
- Shdr->sh_name = NameOff;
+ Shdr->sh_name = SecHdrStrTabBuilder.add(Name);
Sections.push_back(Shdr);
return {Shdr, Sections.size()};
}
template <class ELFT>
typename ELFCreator<ELFT>::Symbol ELFCreator<ELFT>::addSymbol(StringRef Name) {
- std::size_t NameOff = StrTabBuilder.add(Name);
auto Sym = new (Alloc) Elf_Sym{};
- Sym->st_name = NameOff;
+ Sym->st_name = StrTabBuilder.add(Name);
StaticSymbols.push_back(Sym);
return {Sym, StaticSymbols.size()};
}
More information about the llvm-commits
mailing list