summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorFangrui Song <maskray@google.com>2018-11-17 01:15:55 +0000
committerFangrui Song <maskray@google.com>2018-11-17 01:15:55 +0000
commit5ec95dbd74c20303fe9add19cf29e40f203d0066 (patch)
tree1479f88f044cf886293418c4a1559dbbab9d70bc /llvm
parentddfb07567dca97db37b5d165d458866cf8aa0011 (diff)
downloadbcm5719-llvm-5ec95dbd74c20303fe9add19cf29e40f203d0066.tar.gz
bcm5719-llvm-5ec95dbd74c20303fe9add19cf29e40f203d0066.zip
[llvm-objcopy] Use llvm::all_of and rename the variables "Segment" to avoid confusion with the type of the same name
llvm-svn: 347123
Diffstat (limited to 'llvm')
-rw-r--r--llvm/tools/llvm-objcopy/ELF/Object.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/llvm/tools/llvm-objcopy/ELF/Object.cpp b/llvm/tools/llvm-objcopy/ELF/Object.cpp
index c2af99fc197..b9d211b58ec 100644
--- a/llvm/tools/llvm-objcopy/ELF/Object.cpp
+++ b/llvm/tools/llvm-objcopy/ELF/Object.cpp
@@ -1540,10 +1540,10 @@ void BinaryWriter::finalize() {
// loading and physical addresses are intended for ROM loading.
// However, if no segment has a physical address, we'll fallback to using
// virtual addresses for all.
- if (std::all_of(std::begin(OrderedSegments), std::end(OrderedSegments),
- [](const Segment *Segment) { return Segment->PAddr == 0; }))
- for (const auto &Segment : OrderedSegments)
- Segment->PAddr = Segment->VAddr;
+ if (all_of(OrderedSegments,
+ [](const Segment *Seg) { return Seg->PAddr == 0; }))
+ for (Segment *Seg : OrderedSegments)
+ Seg->PAddr = Seg->VAddr;
std::stable_sort(std::begin(OrderedSegments), std::end(OrderedSegments),
compareSegmentsByPAddr);
@@ -1558,8 +1558,8 @@ void BinaryWriter::finalize() {
uint64_t Offset = 0;
// Modify the first segment so that there is no gap at the start. This allows
- // our layout algorithm to proceed as expected while not out writing out the
- // gap at the start.
+ // our layout algorithm to proceed as expected while not writing out the gap
+ // at the start.
if (!OrderedSegments.empty()) {
auto Seg = OrderedSegments[0];
auto Sec = Seg->firstSection();
OpenPOWER on IntegriCloud