From 7d5095796ab616cf9b709036387bb95ab9984141 Mon Sep 17 00:00:00 2001 From: Pavel Solodovnikov Date: Mon, 11 Sep 2017 13:40:26 +0300 Subject: Meta: modernize old-fashioned loops to range-based `for`. Changes done via `clang-tidy` with some manual fine-tuning for the variable naming and `auto` type deduction where appropriate. --- Source/cmLinkLineDeviceComputer.cxx | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'Source/cmLinkLineDeviceComputer.cxx') diff --git a/Source/cmLinkLineDeviceComputer.cxx b/Source/cmLinkLineDeviceComputer.cxx index 942e9b92ca..3beeae3217 100644 --- a/Source/cmLinkLineDeviceComputer.cxx +++ b/Source/cmLinkLineDeviceComputer.cxx @@ -5,7 +5,6 @@ #include #include -#include #include "cmComputeLinkInformation.h" #include "cmGeneratorTarget.h" @@ -32,14 +31,13 @@ std::string cmLinkLineDeviceComputer::ComputeLinkLibraries( typedef cmComputeLinkInformation::ItemVector ItemVector; ItemVector const& items = cli.GetItems(); std::string config = cli.GetConfig(); - for (ItemVector::const_iterator li = items.begin(); li != items.end(); - ++li) { - if (!li->Target) { + for (auto const& item : items) { + if (!item.Target) { continue; } bool skippable = false; - switch (li->Target->GetType()) { + switch (item.Target->GetType()) { case cmStateEnums::SHARED_LIBRARY: case cmStateEnums::MODULE_LIBRARY: case cmStateEnums::INTERFACE_LIBRARY: @@ -49,7 +47,7 @@ std::string cmLinkLineDeviceComputer::ComputeLinkLibraries( // If a static library is resolving its device linking, it should // be removed for other device linking skippable = - li->Target->GetPropertyAsBool("CUDA_RESOLVE_DEVICE_SYMBOLS"); + item.Target->GetPropertyAsBool("CUDA_RESOLVE_DEVICE_SYMBOLS"); break; default: break; @@ -60,16 +58,16 @@ std::string cmLinkLineDeviceComputer::ComputeLinkLibraries( } std::set langs; - li->Target->GetLanguages(langs, config); + item.Target->GetLanguages(langs, config); if (langs.count("CUDA") == 0) { continue; } - if (li->IsPath) { + if (item.IsPath) { fout << this->ConvertToOutputFormat( - this->ConvertToLinkReference(li->Value)); + this->ConvertToLinkReference(item.Value)); } else { - fout << li->Value; + fout << item.Value; } fout << " "; } -- cgit v1.2.1