summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Pilgrim <llvm-dev@redking.me.uk>2019-11-18 13:57:20 +0000
committerSimon Pilgrim <llvm-dev@redking.me.uk>2019-11-18 13:57:34 +0000
commit5edf964fccfae77353ef944bf749a8e2a1f5380e (patch)
tree839c658a3e81f8bd1b875b4c14f2551558f3f64c
parent606c189215d1c78681e8020b6393019b0c0ea181 (diff)
downloadbcm5719-llvm-5edf964fccfae77353ef944bf749a8e2a1f5380e.tar.gz
bcm5719-llvm-5edf964fccfae77353ef944bf749a8e2a1f5380e.zip
Fix cppcheck shadow variable warning. NFC.
-rw-r--r--llvm/tools/llvm-objcopy/ELF/Object.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/tools/llvm-objcopy/ELF/Object.cpp b/llvm/tools/llvm-objcopy/ELF/Object.cpp
index dc2c7c8fa8b..a1073fe9dcb 100644
--- a/llvm/tools/llvm-objcopy/ELF/Object.cpp
+++ b/llvm/tools/llvm-objcopy/ELF/Object.cpp
@@ -2003,11 +2003,11 @@ static uint64_t layoutSegmentsForOnlyKeepDebug(std::vector<Segment *> &Segments,
uint64_t HdrEnd) {
uint64_t MaxOffset = 0;
for (Segment *Seg : Segments) {
- const SectionBase *Sec = Seg->firstSection();
- if (Seg->Type == PT_PHDR || !Sec)
+ const SectionBase *FirstSec = Seg->firstSection();
+ if (Seg->Type == PT_PHDR || !FirstSec)
continue;
- uint64_t Offset = Sec->Offset;
+ uint64_t Offset = FirstSec->Offset;
uint64_t FileSize = 0;
for (const SectionBase *Sec : Seg->Sections) {
uint64_t Size = Sec->Type == SHT_NOBITS ? 0 : Sec->Size;
OpenPOWER on IntegriCloud