[llvm] f3df0cf - Remove unnecessary copy
David Blaikie via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 7 11:20:23 PDT 2023
Author: David Blaikie
Date: 2023-06-07T18:02:58Z
New Revision: f3df0cf3b00b33013f0d728063d0a0ef4bf58450
URL: https://github.com/llvm/llvm-project/commit/f3df0cf3b00b33013f0d728063d0a0ef4bf58450
DIFF: https://github.com/llvm/llvm-project/commit/f3df0cf3b00b33013f0d728063d0a0ef4bf58450.diff
LOG: Remove unnecessary copy
Added:
Modified:
llvm/lib/ObjCopy/ELF/ELFObject.cpp
Removed:
################################################################################
diff --git a/llvm/lib/ObjCopy/ELF/ELFObject.cpp b/llvm/lib/ObjCopy/ELF/ELFObject.cpp
index 221371bbea91d..54a4ca5a76ed0 100644
--- a/llvm/lib/ObjCopy/ELF/ELFObject.cpp
+++ b/llvm/lib/ObjCopy/ELF/ELFObject.cpp
@@ -2317,7 +2317,7 @@ static uint64_t layoutSections(Range Sections, uint64_t Offset) {
for (auto &Sec : Sections) {
Sec.Index = Index++;
if (Sec.ParentSegment != nullptr) {
- auto Segment = *Sec.ParentSegment;
+ const Segment &Segment = *Sec.ParentSegment;
Sec.Offset =
Segment.Offset + (Sec.OriginalOffset - Segment.OriginalOffset);
} else
More information about the llvm-commits
mailing list