summaryrefslogtreecommitdiffstats
path: root/lld/ELF
diff options
context:
space:
mode:
authorGeorge Rimar <grimar@accesssoftek.com>2016-09-30 13:44:02 +0000
committerGeorge Rimar <grimar@accesssoftek.com>2016-09-30 13:44:02 +0000
commit3da3ffa67f7c5cca532d7f25d397dd3af6189087 (patch)
treef2bdb7f60f6463ff38a9d170dec7ea35f9f63062 /lld/ELF
parentf85ac77c9f9e31cb7a9d8f80ea31a4c677cb45be (diff)
downloadbcm5719-llvm-3da3ffa67f7c5cca532d7f25d397dd3af6189087.tar.gz
bcm5719-llvm-3da3ffa67f7c5cca532d7f25d397dd3af6189087.zip
[ELF] - Removed excessive variables. NFC.
llvm-svn: 282850
Diffstat (limited to 'lld/ELF')
-rw-r--r--lld/ELF/ELFCreator.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/lld/ELF/ELFCreator.cpp b/lld/ELF/ELFCreator.cpp
index 43aa4ac8729..7ca5c4fe392 100644
--- a/lld/ELF/ELFCreator.cpp
+++ b/lld/ELF/ELFCreator.cpp
@@ -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()};
}
OpenPOWER on IntegriCloud