summaryrefslogtreecommitdiffstats
path: root/Source/cmLinkLineDeviceComputer.cxx
diff options
context:
space:
mode:
authorPavel Solodovnikov <hellyeahdominate@gmail.com>2017-09-11 10:40:26 (GMT)
committerPavel Solodovnikov <hellyeahdominate@gmail.com>2017-09-12 13:22:47 (GMT)
commit7d5095796ab616cf9b709036387bb95ab9984141 (patch)
treec010e922adad95ef86ab4a3ac2a3abd63e9f33ef /Source/cmLinkLineDeviceComputer.cxx
parent00975e926199eea21763470e2ab876246e36669a (diff)
downloadCMake-7d5095796ab616cf9b709036387bb95ab9984141.zip
CMake-7d5095796ab616cf9b709036387bb95ab9984141.tar.gz
CMake-7d5095796ab616cf9b709036387bb95ab9984141.tar.bz2
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.
Diffstat (limited to 'Source/cmLinkLineDeviceComputer.cxx')
-rw-r--r--Source/cmLinkLineDeviceComputer.cxx18
1 files changed, 8 insertions, 10 deletions
diff --git a/Source/cmLinkLineDeviceComputer.cxx b/Source/cmLinkLineDeviceComputer.cxx
index 942e9b9..3beeae3 100644
--- a/Source/cmLinkLineDeviceComputer.cxx
+++ b/Source/cmLinkLineDeviceComputer.cxx
@@ -5,7 +5,6 @@
#include <set>
#include <sstream>
-#include <vector>
#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<std::string> 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 << " ";
}