[ELF] - Removed excessive variables. NFC.

llvm-svn: 282850
This commit is contained in:
George Rimar
2016-09-30 13:44:02 +00:00
parent f85ac77c9f
commit 3da3ffa67f

View File

@@ -60,18 +60,16 @@ ELFCreator<ELFT>::ELFCreator(std::uint16_t Type, std::uint16_t Machine) {
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()};
}