diff options
author | Pavel Solodovnikov <hellyeahdominate@gmail.com> | 2017-09-11 10:40:26 (GMT) |
---|---|---|
committer | Pavel Solodovnikov <hellyeahdominate@gmail.com> | 2017-09-12 13:22:47 (GMT) |
commit | 7d5095796ab616cf9b709036387bb95ab9984141 (patch) | |
tree | c010e922adad95ef86ab4a3ac2a3abd63e9f33ef /Source/cmMakefileLibraryTargetGenerator.cxx | |
parent | 00975e926199eea21763470e2ab876246e36669a (diff) | |
download | CMake-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/cmMakefileLibraryTargetGenerator.cxx')
-rw-r--r-- | Source/cmMakefileLibraryTargetGenerator.cxx | 36 |
1 files changed, 14 insertions, 22 deletions
diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx b/Source/cmMakefileLibraryTargetGenerator.cxx index 2faef67..34c285c 100644 --- a/Source/cmMakefileLibraryTargetGenerator.cxx +++ b/Source/cmMakefileLibraryTargetGenerator.cxx @@ -419,11 +419,10 @@ void cmMakefileLibraryTargetGenerator::WriteDeviceLibraryRules( cmSystemTools::ExpandListArgument(linkRule, real_link_commands); // Expand placeholders. - for (std::vector<std::string>::iterator i = real_link_commands.begin(); - i != real_link_commands.end(); ++i) { - *i = launcher + *i; - rulePlaceholderExpander->ExpandRuleVariables(this->LocalGenerator, *i, - vars); + for (std::string& real_link_command : real_link_commands) { + real_link_command = launcher + real_link_command; + rulePlaceholderExpander->ExpandRuleVariables(this->LocalGenerator, + real_link_command, vars); } // Restore path conversion to normal shells. this->LocalGenerator->SetLinkScriptShell(false); @@ -897,10 +896,8 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules( std::vector<std::string>::iterator osi = object_strings.begin(); { vars.Objects = osi->c_str(); - for (std::vector<std::string>::const_iterator i = - archiveCreateCommands.begin(); - i != archiveCreateCommands.end(); ++i) { - std::string cmd = launcher + *i; + for (std::string const& acc : archiveCreateCommands) { + std::string cmd = launcher + acc; rulePlaceholderExpander->ExpandRuleVariables(this->LocalGenerator, cmd, vars); real_link_commands.push_back(cmd); @@ -909,10 +906,8 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules( // Append to the archive with the other object sets. for (++osi; osi != object_strings.end(); ++osi) { vars.Objects = osi->c_str(); - for (std::vector<std::string>::const_iterator i = - archiveAppendCommands.begin(); - i != archiveAppendCommands.end(); ++i) { - std::string cmd = launcher + *i; + for (std::string const& aac : archiveAppendCommands) { + std::string cmd = launcher + aac; rulePlaceholderExpander->ExpandRuleVariables(this->LocalGenerator, cmd, vars); real_link_commands.push_back(cmd); @@ -920,10 +915,8 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules( } // Finish the archive. vars.Objects = ""; - for (std::vector<std::string>::const_iterator i = - archiveFinishCommands.begin(); - i != archiveFinishCommands.end(); ++i) { - std::string cmd = launcher + *i; + for (std::string const& afc : archiveFinishCommands) { + std::string cmd = launcher + afc; rulePlaceholderExpander->ExpandRuleVariables(this->LocalGenerator, cmd, vars); // If there is no ranlib the command will be ":". Skip it. @@ -945,11 +938,10 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules( } // Expand placeholders. - for (std::vector<std::string>::iterator i = real_link_commands.begin(); - i != real_link_commands.end(); ++i) { - *i = launcher + *i; - rulePlaceholderExpander->ExpandRuleVariables(this->LocalGenerator, *i, - vars); + for (std::string& real_link_command : real_link_commands) { + real_link_command = launcher + real_link_command; + rulePlaceholderExpander->ExpandRuleVariables(this->LocalGenerator, + real_link_command, vars); } } |