diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2012-01-20 14:42:32 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2012-01-20 14:42:32 +0000 |
commit | 263109d822314305822796a2cc05e98304793051 (patch) | |
tree | c811363fbeb863c3a056ee162a1a7bfa2d775e7e /lib/MC | |
parent | 07df1b4d1a299d18159aa9396bb02892fed773ac (diff) | |
download | external_llvm-263109d822314305822796a2cc05e98304793051.zip external_llvm-263109d822314305822796a2cc05e98304793051.tar.gz external_llvm-263109d822314305822796a2cc05e98304793051.tar.bz2 |
Remove a bunch of unused variable assignments.
Found by the clang static analyzer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148541 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/MC')
-rw-r--r-- | lib/MC/ELFObjectWriter.cpp | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/lib/MC/ELFObjectWriter.cpp b/lib/MC/ELFObjectWriter.cpp index 8a66e04..36f94b4 100644 --- a/lib/MC/ELFObjectWriter.cpp +++ b/lib/MC/ELFObjectWriter.cpp @@ -1380,14 +1380,10 @@ uint64_t ELFObjectWriter::GetSectionAddressSize(const MCAsmLayout &Layout, void ELFObjectWriter::WriteDataSectionData(MCAssembler &Asm, const MCAsmLayout &Layout, const MCSectionELF &Section) { - uint64_t FileOff = OS.tell(); const MCSectionData &SD = Asm.getOrCreateSectionData(Section); - uint64_t Padding = OffsetToAlignment(FileOff, SD.getAlignment()); + uint64_t Padding = OffsetToAlignment(OS.tell(), SD.getAlignment()); WriteZeros(Padding); - FileOff += Padding; - - FileOff += GetSectionFileSize(Layout, SD); if (IsELFMetaDataSection(SD)) { for (MCSectionData::const_iterator i = SD.begin(), e = SD.end(); i != e; @@ -1553,16 +1549,13 @@ void ELFObjectWriter::WriteObject(MCAssembler &Asm, for (unsigned i = 0; i < NumRegularSections + 1; ++i) WriteDataSectionData(Asm, Layout, *Sections[i]); - FileOff = OS.tell(); - uint64_t Padding = OffsetToAlignment(FileOff, NaturalAlignment); + uint64_t Padding = OffsetToAlignment(OS.tell(), NaturalAlignment); WriteZeros(Padding); // ... then the section header table ... WriteSectionHeader(Asm, GroupMap, Layout, SectionIndexMap, SectionOffsetMap); - FileOff = OS.tell(); - // ... and then the remaining sections ... for (unsigned i = NumRegularSections + 1; i < NumSections; ++i) WriteDataSectionData(Asm, Layout, *Sections[i]); |