Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(325)

Issue 986113002: tools/gn: Convert for loops to use the new range-based loops in C++11. (Closed)

Created:
5 years, 9 months ago by tfarina
Modified:
5 years, 9 months ago
Reviewers:
brettw, scottmg
CC:
chromium-reviews, tfarina, Dirk Pranke
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

tools/gn: Convert for loops to use the new range-based loops in C++11. range-based loops is one of the C++11 allowed features. See https://chromium-cpp.appspot.com/ and https://groups.google.com/a/chromium.org/forum/#!topic/chromium-dev/hpzz4EqbVmc. This patch was generated with the following command lines: $ ninja -C out/Debug -t compdb cxx > out/Debug/compile_commands.json $ cd out/Debug $ find ../../tools/gn -name '*.cc' | xargs -n 16 -P 32 \ ~/src/repos/llvm/build/bin/clang-modernize -loop-convert -p . -include \ tools/gn -format -style=Chromium $ ninja gn gn_unittests $ ./gn_unittests BUG=None TEST=gn && gn_unittests R=brettw@chromium.org Committed: https://crrev.com/b9cf968c8dd857a4f1d583e1bd716f32eede07e4 Cr-Commit-Position: refs/heads/master@{#322177}

Patch Set 1 #

Patch Set 2 : toplevel_target #

Patch Set 3 : self review #

Patch Set 4 : const #

Total comments: 10

Patch Set 5 : consts #

Patch Set 6 : generate_test_gn_data #

Total comments: 6

Patch Set 7 : more fixes #

Total comments: 6

Patch Set 8 : review fixes #

Unified diffs Side-by-side diffs Delta from patch set Stats (+97 lines, -110 lines) Patch
M tools/gn/command_clean.cc View 1 2 3 1 chunk +3 lines, -3 lines 0 comments Download
M tools/gn/command_desc.cc View 1 2 3 6 chunks +14 lines, -18 lines 0 comments Download
M tools/gn/err.cc View 1 2 3 4 5 6 1 chunk +2 lines, -2 lines 0 comments Download
M tools/gn/escape.cc View 1 2 3 4 2 chunks +13 lines, -13 lines 0 comments Download
M tools/gn/exec_process.cc View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
M tools/gn/generate_test_gn_data.cc View 1 2 3 4 5 2 chunks +4 lines, -4 lines 0 comments Download
M tools/gn/header_checker.cc View 1 2 3 2 chunks +8 lines, -9 lines 0 comments Download
M tools/gn/ninja_binary_target_writer.cc View 1 2 3 1 chunk +2 lines, -3 lines 0 comments Download
M tools/gn/ninja_build_writer.cc View 1 2 3 4 5 6 7 6 chunks +14 lines, -17 lines 0 comments Download
M tools/gn/ninja_copy_target_writer.cc View 1 2 3 1 chunk +1 line, -3 lines 0 comments Download
M tools/gn/ninja_target_writer.cc View 1 2 3 2 chunks +6 lines, -8 lines 0 comments Download
M tools/gn/ninja_toolchain_writer.cc View 1 2 3 4 5 6 7 1 chunk +3 lines, -3 lines 0 comments Download
M tools/gn/ninja_writer.cc View 1 2 3 1 chunk +5 lines, -5 lines 0 comments Download
M tools/gn/operators.cc View 1 2 3 1 chunk +2 lines, -2 lines 0 comments Download
M tools/gn/pattern.cc View 1 2 3 4 5 6 7 1 chunk +5 lines, -5 lines 0 comments Download
M tools/gn/standard_out.cc View 1 2 3 1 chunk +3 lines, -3 lines 0 comments Download
M tools/gn/substitution_pattern.cc View 1 2 3 1 chunk +7 lines, -7 lines 0 comments Download
M tools/gn/toolchain.cc View 1 2 3 1 chunk +3 lines, -3 lines 0 comments Download

Messages

Total messages: 17 (2 generated)
tfarina
Is this OK?
5 years, 9 months ago (2015-03-08 17:55:01 UTC) #1
tfarina
Scott, could you review this to me?
5 years, 9 months ago (2015-03-12 21:42:23 UTC) #3
scottmg
It looks like a lot of these could be `for (const auto& ...)` rather than ...
5 years, 9 months ago (2015-03-12 21:54:54 UTC) #4
tfarina
Done.
5 years, 9 months ago (2015-03-12 23:21:39 UTC) #5
tfarina
Ping?
5 years, 9 months ago (2015-03-13 19:25:56 UTC) #6
scottmg
It looks like there's still a bunch more that could be const? https://codereview.chromium.org/986113002/diff/60001/tools/gn/escape.cc File tools/gn/escape.cc ...
5 years, 9 months ago (2015-03-13 19:58:30 UTC) #7
tfarina
https://codereview.chromium.org/986113002/diff/60001/tools/gn/escape.cc File tools/gn/escape.cc (right): https://codereview.chromium.org/986113002/diff/60001/tools/gn/escape.cc#newcode47 tools/gn/escape.cc:47: for (auto& elem : str) On 2015/03/13 19:58:30, scottmg ...
5 years, 9 months ago (2015-03-13 23:27:50 UTC) #8
scottmg
https://codereview.chromium.org/986113002/diff/100001/tools/gn/err.cc File tools/gn/err.cc (right): https://codereview.chromium.org/986113002/diff/100001/tools/gn/err.cc#newcode67 tools/gn/err.cc:67: for (auto& range : ranges) const? https://codereview.chromium.org/986113002/diff/100001/tools/gn/ninja_build_writer.cc File tools/gn/ninja_build_writer.cc ...
5 years, 9 months ago (2015-03-16 16:20:51 UTC) #9
tfarina
Sorry for the delay. I was traveling. PTAL. https://codereview.chromium.org/986113002/diff/100001/tools/gn/err.cc File tools/gn/err.cc (right): https://codereview.chromium.org/986113002/diff/100001/tools/gn/err.cc#newcode67 tools/gn/err.cc:67: for ...
5 years, 9 months ago (2015-03-22 19:59:54 UTC) #10
scottmg
https://codereview.chromium.org/986113002/diff/120001/tools/gn/ninja_build_writer.cc File tools/gn/ninja_build_writer.cc (right): https://codereview.chromium.org/986113002/diff/120001/tools/gn/ninja_build_writer.cc#newcode261 tools/gn/ninja_build_writer.cc:261: for (const auto target : default_toolchain_targets_) { const auto& ...
5 years, 9 months ago (2015-03-23 17:24:20 UTC) #11
tfarina
https://codereview.chromium.org/986113002/diff/120001/tools/gn/ninja_build_writer.cc File tools/gn/ninja_build_writer.cc (right): https://codereview.chromium.org/986113002/diff/120001/tools/gn/ninja_build_writer.cc#newcode261 tools/gn/ninja_build_writer.cc:261: for (const auto target : default_toolchain_targets_) { On 2015/03/23 ...
5 years, 9 months ago (2015-03-25 14:14:32 UTC) #12
scottmg
lgtm
5 years, 9 months ago (2015-03-25 16:56:42 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/986113002/140001
5 years, 9 months ago (2015-03-25 16:57:24 UTC) #15
commit-bot: I haz the power
Committed patchset #8 (id:140001)
5 years, 9 months ago (2015-03-25 17:02:23 UTC) #16
commit-bot: I haz the power
5 years, 9 months ago (2015-03-25 17:03:30 UTC) #17
Message was sent while issue was closed.
Patchset 8 (id:??) landed as
https://crrev.com/b9cf968c8dd857a4f1d583e1bd716f32eede07e4
Cr-Commit-Position: refs/heads/master@{#322177}

Powered by Google App Engine
This is Rietveld 408576698