Apply clang-format Change-Id: I4cec8add2eef76b2ec671dfba5a15ddb03067749 Reviewed-on: https://gn-review.googlesource.com/c/gn/+/21180 Reviewed-by: David Turner <digit@google.com> Commit-Queue: Takuto Ikuta <tikuta@google.com> Reviewed-by: Junji Watanabe <jwata@google.com>
diff --git a/src/base/sha2_unittest.cc b/src/base/sha2_unittest.cc index 99a08b0..1738170 100644 --- a/src/base/sha2_unittest.cc +++ b/src/base/sha2_unittest.cc
@@ -36,21 +36,21 @@ EXPECT_EQ("7ABC22C0AE5AF26CE93DBB94433A0E0B2E119D014F8E7F65BD56C61CCCCD9504", Sha256AsHexString("\xc9\x8c\x8e\x55")); EXPECT_EQ("02779466CDEC163811D078815C633F21901413081449002F24AA3E80F0B88EF7", - Sha256AsHexString(std::string(55, '\0'))); + Sha256AsHexString(std::string(55, '\0'))); EXPECT_EQ("D4817AA5497628E7C77E6B606107042BBBA3130888C5F47A375E6179BE789FBB", - Sha256AsHexString(std::string(56, '\0'))); + Sha256AsHexString(std::string(56, '\0'))); EXPECT_EQ("65A16CB7861335D5ACE3C60718B5052E44660726DA4CD13BB745381B235A1785", - Sha256AsHexString(std::string(57, '\0'))); + Sha256AsHexString(std::string(57, '\0'))); EXPECT_EQ("F5A5FD42D16A20302798EF6ED309979B43003D2320D9F0E8EA9831A92759FB4B", - Sha256AsHexString(std::string(64, '\0'))); + Sha256AsHexString(std::string(64, '\0'))); EXPECT_EQ("541B3E9DAA09B20BF85FA273E5CBD3E80185AA4EC298E765DB87742B70138A53", - Sha256AsHexString(std::string(1000, '\0'))); + Sha256AsHexString(std::string(1000, '\0'))); EXPECT_EQ("C2E686823489CED2017F6059B8B239318B6364F6DCD835D0A519105A1EADD6E4", - Sha256AsHexString(std::string(1000, 'A'))); + Sha256AsHexString(std::string(1000, 'A'))); EXPECT_EQ("F4D62DDEC0F3DD90EA1380FA16A5FF8DC4C54B21740650F24AFC4120903552B0", - Sha256AsHexString(std::string(1005, 'U'))); + Sha256AsHexString(std::string(1005, 'U'))); EXPECT_EQ("D29751F2649B32FF572B5E0A9F541EA660A50F94FF0BEEDFB0B692B924CC8025", - Sha256AsHexString(std::string(1000000, '\0'))); + Sha256AsHexString(std::string(1000000, '\0'))); } } // namespace
diff --git a/src/gn/function_rebase_path.cc b/src/gn/function_rebase_path.cc index a998785..92bd681 100644 --- a/src/gn/function_rebase_path.cc +++ b/src/gn/function_rebase_path.cc
@@ -4,8 +4,9 @@ #include <stddef.h> -#include "gn/build_settings.h" #include <utility> + +#include "gn/build_settings.h" #include "gn/filesystem_utils.h" #include "gn/functions.h" #include "gn/parse_tree.h" @@ -57,7 +58,8 @@ void AddCallLocationToError(const ParseNode* blame_node, Err* err) { if (blame_node && err->has_error()) { Err new_err(blame_node, err->message(), err->help_text()); - new_err.AppendSubErr(Err(err->location(), "The value that caused the error.")); + new_err.AppendSubErr( + Err(err->location(), "The value that caused the error.")); *err = std::move(new_err); } } @@ -107,9 +109,9 @@ if (err->has_error()) { return Value(); } - result.string_value() = RebasePath( - resolved.value(), - to_dir, scope->settings()->build_settings()->root_path_utf8()); + result.string_value() = + RebasePath(resolved.value(), to_dir, + scope->settings()->build_settings()->root_path_utf8()); MakeSlashEndingMatchInput(string_value, &result.string_value()); } else { SourceFile resolved_file = from_dir.ResolveRelativeFile( @@ -239,7 +241,8 @@ } const Value& inputs = args[kArgIndexInputs]; const ParseNode* inputs_origin = nullptr; - if (function->args() && function->args()->contents().size() > kArgIndexInputs) { + if (function->args() && + function->args()->contents().size() > kArgIndexInputs) { inputs_origin = function->args()->contents()[kArgIndexInputs].get(); }
diff --git a/src/gn/header_checker.cc b/src/gn/header_checker.cc index 70fd300..a100337 100644 --- a/src/gn/header_checker.cc +++ b/src/gn/header_checker.cc
@@ -133,16 +133,16 @@ using Node = Base::Node; // Since we only insert, we don't need to return success/failure. - // We can also assume that key uniqueness is checked before insertion if necessary, - // or that we simply overwrite (though BFS usually checks existence first). + // We can also assume that key uniqueness is checked before insertion if + // necessary, or that we simply overwrite (though BFS usually checks existence + // first). // - // In IsDependencyOf, we use the return value checking if it was already there. - // So we need an Insert that returns whether it was new. + // In IsDependencyOf, we use the return value checking if it was already + // there. So we need an Insert that returns whether it was new. bool Insert(const Target* target, const Target* src_target, bool is_public) { size_t hash = std::hash<const Target*>()(target); - Node* node = NodeLookup(hash, [target](const Node* n) { - return n->target == target; - }); + Node* node = NodeLookup( + hash, [target](const Node* n) { return n->target == target; }); if (node->is_valid()) return false; @@ -154,12 +154,12 @@ return true; } - // Returns the ChainLink for the given target, or a null-target ChainLink if not found. + // Returns the ChainLink for the given target, or a null-target ChainLink if + // not found. HeaderChecker::ChainLink GetLink(const Target* target) const { size_t hash = std::hash<const Target*>()(target); - const Node* node = NodeLookup(hash, [target](const Node* n) { - return n->target == target; - }); + const Node* node = NodeLookup( + hash, [target](const Node* n) { return n->target == target; }); if (node->is_valid()) return HeaderChecker::ChainLink(node->src_target, node->is_public);
diff --git a/src/gn/ninja_c_binary_target_writer.cc b/src/gn/ninja_c_binary_target_writer.cc index 862ac98..e4e3bbe 100644 --- a/src/gn/ninja_c_binary_target_writer.cc +++ b/src/gn/ninja_c_binary_target_writer.cc
@@ -157,8 +157,10 @@ #endif if (!target_->source_types_used().SwiftSourceUsed()) { - // Add extra files like pre compiled module to stamp files for phony targets. - stamp_files->insert(stamp_files->end(), extra_files.begin(), extra_files.end()); + // Add extra files like pre compiled module to stamp files for phony + // targets. + stamp_files->insert(stamp_files->end(), extra_files.begin(), + extra_files.end()); } WriteSourceSetStamp(*stamp_files); } else {
diff --git a/src/gn/resolved_target_data.h b/src/gn/resolved_target_data.h index d95459d..cc04fdb 100644 --- a/src/gn/resolved_target_data.h +++ b/src/gn/resolved_target_data.h
@@ -265,7 +265,8 @@ std::lock_guard<std::mutex> lock(info->mutex); if (!info->has_module_deps_information.load(std::memory_order_relaxed)) { ComputeModuleDepsInformation(info); - info->has_module_deps_information.store(true, std::memory_order_release); + info->has_module_deps_information.store(true, + std::memory_order_release); } } return info;
diff --git a/src/gn/runtime_deps.cc b/src/gn/runtime_deps.cc index abedb84..26bbda9 100644 --- a/src/gn/runtime_deps.cc +++ b/src/gn/runtime_deps.cc
@@ -42,10 +42,11 @@ // as a regular dep. `on_file` may be called more than once for the same output // file. template <typename F> -void RecursiveCollectRuntimeDeps(const Target* target, - bool is_target_data_dep, - F&& on_file, - std::unordered_map<const Target*, bool>* seen_targets) { +void RecursiveCollectRuntimeDeps( + const Target* target, + bool is_target_data_dep, + F&& on_file, + std::unordered_map<const Target*, bool>* seen_targets) { auto [found_seen_target, inserted] = seen_targets->try_emplace(target, is_target_data_dep); if (!inserted) {
diff --git a/src/util/sys_info_unittest.cc b/src/util/sys_info_unittest.cc index ab39cc8..76ca036 100644 --- a/src/util/sys_info_unittest.cc +++ b/src/util/sys_info_unittest.cc
@@ -14,7 +14,8 @@ TEST(SysInfoTest, NumberOfPerformanceProcessors) { int num_perf_processors = NumberOfPerformanceProcessors(); - // On all platforms this should be at least 1 (if implemented) or same as NumberOfProcessors + // On all platforms this should be at least 1 (if implemented) or same as + // NumberOfProcessors EXPECT_GT(num_perf_processors, 0); #if defined(OS_MACOSX) && defined(ARCH_CPU_ARM64)