From 034e2e7a8e37a3388ad444c9c5080da9cab146f2 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Wed, 26 Aug 2015 21:42:36 +0000 Subject: [PATCH] Define types close to use. NFC. llvm-svn: 246085 --- lld/ELF/Writer.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lld/ELF/Writer.cpp b/lld/ELF/Writer.cpp index 430b9c12f321..3b01631d123a 100644 --- a/lld/ELF/Writer.cpp +++ b/lld/ELF/Writer.cpp @@ -235,9 +235,7 @@ template void SymbolTableSection::writeTo(uint8_t *Buf) { auto *ESym = reinterpret_cast(Buf); ESym->st_name = Builder.getOffset(Name); - uint8_t Binding = 0; SymbolBody *Body = Sym->Body; - uint8_t Type = 0; const SectionChunk *Section = nullptr; const Elf_Sym *InputSym = nullptr; @@ -259,10 +257,10 @@ template void SymbolTableSection::writeTo(uint8_t *Buf) { } if (InputSym) { - Type = InputSym->getType(); - Binding = InputSym->getBinding(); + uint8_t Type = InputSym->getType(); + uint8_t Binding = InputSym->getBinding(); + ESym->setBindingAndType(Binding, Type); } - ESym->setBindingAndType(Binding, Type); if (Section) { OutputSection *Out = Section->getOutputSection();