summaryrefslogtreecommitdiffstats
path: root/llvm/tools/yaml2obj
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2016-05-27 12:30:51 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2016-05-27 12:30:51 +0000
commit4fed928f53dbea24914bc0db307e0988c6e44c8c (patch)
treed6c73577b5531048e54fb19c78b8e316b7fc66ad /llvm/tools/yaml2obj
parentc91e38c5ebf6f0cfbb29eff66c5ff6db43c3ee45 (diff)
downloadbcm5719-llvm-4fed928f53dbea24914bc0db307e0988c6e44c8c.tar.gz
bcm5719-llvm-4fed928f53dbea24914bc0db307e0988c6e44c8c.zip
Avoid some copies by using const references.
clang-tidy's performance-unnecessary-copy-initialization with some manual fixes. No functional changes intended. llvm-svn: 270988
Diffstat (limited to 'llvm/tools/yaml2obj')
-rw-r--r--llvm/tools/yaml2obj/yaml2macho.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/tools/yaml2obj/yaml2macho.cpp b/llvm/tools/yaml2obj/yaml2macho.cpp
index 57f36d6a90d..9faa767e9a6 100644
--- a/llvm/tools/yaml2obj/yaml2macho.cpp
+++ b/llvm/tools/yaml2obj/yaml2macho.cpp
@@ -116,7 +116,7 @@ template <>
size_t writeLoadCommandData<MachO::segment_command>(MachOYAML::LoadCommand &LC,
raw_ostream &OS) {
size_t BytesWritten = 0;
- for (auto Sec : LC.Sections) {
+ for (const auto &Sec : LC.Sections) {
auto TempSec = constructSection<MachO::section>(Sec);
OS.write(reinterpret_cast<const char *>(&(TempSec)),
sizeof(MachO::section));
@@ -130,7 +130,7 @@ size_t
writeLoadCommandData<MachO::segment_command_64>(MachOYAML::LoadCommand &LC,
raw_ostream &OS) {
size_t BytesWritten = 0;
- for (auto Sec : LC.Sections) {
+ for (const auto &Sec : LC.Sections) {
auto TempSec = constructSection<MachO::section_64>(Sec);
TempSec.reserved3 = Sec.reserved3;
OS.write(reinterpret_cast<const char *>(&(TempSec)),
OpenPOWER on IntegriCloud