Skip to content

Commit 226edba

Browse files
typelessclaude
andcommitted
Apply clang-format
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 1bd3e7c commit 226edba

1 file changed

Lines changed: 32 additions & 32 deletions

File tree

src/graph/builder.cpp

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@ auto process_conditional(
449449
auto is_context_active(BuilderContext const& ctx) -> bool
450450
{
451451
for (auto const& guard : ctx.condition_stack) {
452-
auto const* cond = get_condition_node(ctx.state->graph,guard.condition);
452+
auto const* cond = get_condition_node(ctx.state->graph, guard.condition);
453453
if (cond && cond->current_value != guard.polarity) {
454454
return false;
455455
}
@@ -655,7 +655,7 @@ auto expand_glob_pattern(
655655
auto pattern_path_sv = is_empty(ctx.current_dir) ? path : pool.get(pup::path::normalize(pool.get(pup::path::join(str(ctx.current_dir), path))));
656656
auto glob = parser::Glob { pattern_path_sv };
657657
auto build_root_name = get_build_root_name(ctx.state->graph);
658-
for (auto id : nodes_of_type(ctx.state->graph,NodeType::Generated)) {
658+
for (auto id : nodes_of_type(ctx.state->graph, NodeType::Generated)) {
659659
auto node_path_sv = get_full_path(ctx.state->graph, id, ctx.state->path_cache);
660660
if (node_path_sv.empty()) {
661661
continue;
@@ -741,7 +741,7 @@ auto process_generated_rules(
741741
for (auto input_id_val : gen_rule.inputs) {
742742
auto input_id = resolve_input_node(ctx, pool.get(input_id_val));
743743
if (input_id) {
744-
(void)add_edge(ctx.state->graph,*input_id, *gen_cmd_id);
744+
(void)add_edge(ctx.state->graph, *input_id, *gen_cmd_id);
745745
gen_input_ids.push_back(*input_id);
746746
}
747747
}
@@ -765,18 +765,18 @@ auto process_generated_rules(
765765
// Regular file path - create edge directly (skip glob patterns)
766766
auto oi_node = resolve_input_node(ctx, oi);
767767
if (oi_node) {
768-
(void)add_order_only_edge(ctx.state->graph,*oi_node, *gen_cmd_id);
768+
(void)add_order_only_edge(ctx.state->graph, *oi_node, *gen_cmd_id);
769769
}
770770
}
771771
}
772772

773773
// Add edge from generated command to parent command (dep-scan runs before compile)
774-
(void)add_edge(ctx.state->graph,*gen_cmd_id, parent_cmd_id);
774+
(void)add_edge(ctx.state->graph, *gen_cmd_id, parent_cmd_id);
775775

776776
// Store generated rule info and operands on the node.
777777
// outputs intentionally left empty: generated rules are dep-scan commands
778778
// whose output is captured via generated_output, not %o expansion.
779-
if (auto* node = get_command_node(ctx.state->graph,*gen_cmd_id)) {
779+
if (auto* node = get_command_node(ctx.state->graph, *gen_cmd_id)) {
780780
node->generated_output = gen_rule.outputs.empty() ? GeneratedOutput {} : gen_rule.outputs[0];
781781
node->output_action = gen_rule.action;
782782
node->parent_command = gen_rule.parent_command;
@@ -1158,7 +1158,7 @@ auto process_conditional(
11581158
.current_value = condition_true,
11591159
};
11601160

1161-
auto cond_id_result = add_condition_node(ctx.state->graph,std::move(cond_node));
1161+
auto cond_id_result = add_condition_node(ctx.state->graph, std::move(cond_node));
11621162
if (!cond_id_result) {
11631163
return pup::unexpected<Error>(cond_id_result.error());
11641164
}
@@ -1359,7 +1359,7 @@ auto process_import(
13591359
auto const* existing_node_id = state.imported_env_var_nodes.find(var_name_id);
13601360
auto const name_id = intern(node_name_buf.view());
13611361
if (existing_node_id) {
1362-
auto* existing = get_file_node(ctx.state->graph,*existing_node_id);
1362+
auto* existing = get_file_node(ctx.state->graph, *existing_node_id);
13631363
if (existing && existing->name != name_id) {
13641364
existing->name = name_id;
13651365
existing->content_hash = content_hash;
@@ -1371,7 +1371,7 @@ auto process_import(
13711371
.parent_dir = state.env_var_dir_id,
13721372
.content_hash = content_hash,
13731373
};
1374-
auto result = add_file_node(ctx.state->graph,std::move(node));
1374+
auto result = add_file_node(ctx.state->graph, std::move(node));
13751375
if (result) {
13761376
state.imported_env_var_nodes.insert(var_name_id, *result);
13771377
}
@@ -1666,7 +1666,7 @@ auto expand_rule(
16661666
if (!input_id) {
16671667
return pup::unexpected<Error>(input_id.error());
16681668
}
1669-
auto edge_result = add_edge(ctx.state->graph,*input_id, *cmd_id);
1669+
auto edge_result = add_edge(ctx.state->graph, *input_id, *cmd_id);
16701670
if (!edge_result) {
16711671
return pup::unexpected<Error>(edge_result.error());
16721672
}
@@ -1682,14 +1682,14 @@ auto expand_rule(
16821682
}
16831683

16841684
// Check for duplicate output - another command already produces this file
1685-
auto output_inputs = get_inputs(ctx.state->graph,*output_id);
1685+
auto output_inputs = get_inputs(ctx.state->graph, *output_id);
16861686
if (!output_inputs.empty()) {
16871687
for (auto existing_id : output_inputs) {
16881688
if (node_id::is_command(existing_id)) {
16891689
// Check if this is a phi-node case (complementary guards)
16901690
// Allow multiple commands producing the same output if they have
16911691
// mutually exclusive guards (same condition, opposite polarity)
1692-
auto const* existing_cmd = get_command_node(ctx.state->graph,existing_id);
1692+
auto const* existing_cmd = get_command_node(ctx.state->graph, existing_id);
16931693
if (existing_cmd && are_guards_mutually_exclusive(existing_cmd->guards, ctx.condition_stack)) {
16941694
continue;
16951695
}
@@ -1706,7 +1706,7 @@ auto expand_rule(
17061706
}
17071707
}
17081708

1709-
auto edge_result = add_edge(ctx.state->graph,*cmd_id, *output_id);
1709+
auto edge_result = add_edge(ctx.state->graph, *cmd_id, *output_id);
17101710
if (!edge_result) {
17111711
return pup::unexpected<Error>(edge_result.error());
17121712
}
@@ -1755,13 +1755,13 @@ auto expand_rule(
17551755
auto group_id_result = get_or_create_group_node(ctx, state, str(dir), str(*output_oo_group));
17561756
if (group_id_result) {
17571757
// Add edge: file → group (file is member of group)
1758-
(void)add_edge(ctx.state->graph,*output_id, *group_id_result, LinkType::Group);
1758+
(void)add_edge(ctx.state->graph, *output_id, *group_id_result, LinkType::Group);
17591759
}
17601760
}
17611761
}
17621762

17631763
// Store explicit operands on the command node for expand_instruction()
1764-
if (auto* cmd = get_command_node(ctx.state->graph,*cmd_id)) {
1764+
if (auto* cmd = get_command_node(ctx.state->graph, *cmd_id)) {
17651765
cmd->inputs = std::move(input_ids);
17661766
cmd->outputs = std::move(output_ids);
17671767
}
@@ -1775,7 +1775,7 @@ auto expand_rule(
17751775
}
17761776
auto oi_node = resolve_input_node(ctx, oi_sv);
17771777
if (oi_node) {
1778-
(void)add_order_only_edge(ctx.state->graph,*oi_node, *cmd_id);
1778+
(void)add_order_only_edge(ctx.state->graph, *oi_node, *cmd_id);
17791779
}
17801780
}
17811781

@@ -2003,7 +2003,7 @@ auto get_or_create_directory_node(
20032003
}
20042004
auto parent_id = *parent_id_result;
20052005

2006-
if (auto existing = find_by_dir_name(ctx.state->graph,parent_id, basename_sv)) {
2006+
if (auto existing = find_by_dir_name(ctx.state->graph, parent_id, basename_sv)) {
20072007
return *existing;
20082008
}
20092009

@@ -2013,7 +2013,7 @@ auto get_or_create_directory_node(
20132013
.parent_dir = parent_id,
20142014
};
20152015

2016-
return add_file_node(ctx.state->graph,std::move(node));
2016+
return add_file_node(ctx.state->graph, std::move(node));
20172017
}
20182018

20192019
auto get_or_create_file_node(
@@ -2034,7 +2034,7 @@ auto get_or_create_file_node(
20342034
auto lookup_path_sv = global_pool().get(pup::strip_path_prefix(path, build_root_name));
20352035

20362036
if (lookup_path_sv != path) {
2037-
if (auto existing = find_by_path(ctx.state->graph,lookup_path_sv, BUILD_ROOT_ID)) {
2037+
if (auto existing = find_by_path(ctx.state->graph, lookup_path_sv, BUILD_ROOT_ID)) {
20382038
return *existing;
20392039
}
20402040
}
@@ -2044,7 +2044,7 @@ auto get_or_create_file_node(
20442044
if (type == NodeType::Generated && path.starts_with("..")) {
20452045
auto norm_output_sv = normalize_to_output_relative(path, str(ctx.options.source_root), str(ctx.options.output_root));
20462046
if (norm_output_sv != path) {
2047-
if (auto existing = find_by_path(ctx.state->graph,norm_output_sv, BUILD_ROOT_ID)) {
2047+
if (auto existing = find_by_path(ctx.state->graph, norm_output_sv, BUILD_ROOT_ID)) {
20482048
return *existing;
20492049
}
20502050
}
@@ -2067,7 +2067,7 @@ auto get_or_create_file_node(
20672067
// by expand_outputs. This handles paths without the build prefix.
20682068
if (type == NodeType::Generated && !build_root_name.empty()) {
20692069
auto lookup_path2 = pool.get(pup::strip_path_prefix(normalized, build_root_name));
2070-
if (auto existing = find_by_path(ctx.state->graph,lookup_path2, BUILD_ROOT_ID)) {
2070+
if (auto existing = find_by_path(ctx.state->graph, lookup_path2, BUILD_ROOT_ID)) {
20712071
return *existing;
20722072
}
20732073
}
@@ -2087,7 +2087,7 @@ auto get_or_create_file_node(
20872087
}
20882088
auto parent_id = *parent_id_result;
20892089

2090-
if (auto existing = find_by_dir_name(ctx.state->graph,parent_id, basename_sv)) {
2090+
if (auto existing = find_by_dir_name(ctx.state->graph, parent_id, basename_sv)) {
20912091
return *existing;
20922092
}
20932093

@@ -2097,7 +2097,7 @@ auto get_or_create_file_node(
20972097
.parent_dir = parent_id,
20982098
};
20992099

2100-
return add_file_node(ctx.state->graph,std::move(node));
2100+
return add_file_node(ctx.state->graph, std::move(node));
21012101
}
21022102

21032103
auto resolve_input_node(
@@ -2135,7 +2135,7 @@ auto resolve_input_node(
21352135
// - Generated/Ghost files are under BUILD_ROOT_ID at source-relative paths
21362136

21372137
// First check if node exists under BUILD_ROOT_ID (generated files)
2138-
if (auto existing = find_by_path(ctx.state->graph,normalized_path, BUILD_ROOT_ID)) {
2138+
if (auto existing = find_by_path(ctx.state->graph, normalized_path, BUILD_ROOT_ID)) {
21392139
return *existing;
21402140
}
21412141

@@ -2147,7 +2147,7 @@ auto resolve_input_node(
21472147
}
21482148

21492149
// Check under SOURCE_ROOT_ID (source files)
2150-
if (auto existing = find_by_path(ctx.state->graph,normalized_path, SOURCE_ROOT_ID)) {
2150+
if (auto existing = find_by_path(ctx.state->graph, normalized_path, SOURCE_ROOT_ID)) {
21512151
return *existing;
21522152
}
21532153

@@ -2208,7 +2208,7 @@ auto get_or_create_group_node(
22082208
gb += name;
22092209
gb += '>';
22102210
auto group_basename = gb.view();
2211-
if (auto existing = find_by_dir_name(ctx.state->graph,parent_id, group_basename)) {
2211+
if (auto existing = find_by_dir_name(ctx.state->graph, parent_id, group_basename)) {
22122212
state.group_nodes.insert(key_id, *existing);
22132213
return *existing;
22142214
}
@@ -2220,7 +2220,7 @@ auto get_or_create_group_node(
22202220
.parent_dir = parent_id,
22212221
};
22222222

2223-
auto result = add_file_node(ctx.state->graph,std::move(node));
2223+
auto result = add_file_node(ctx.state->graph, std::move(node));
22242224
if (result) {
22252225
state.group_nodes.insert(key_id, *result);
22262226
}
@@ -2245,7 +2245,7 @@ auto create_command_node(
22452245
.guards = ctx.condition_stack,
22462246
};
22472247

2248-
auto cmd_id_result = add_command_node(ctx.state->graph,std::move(node));
2248+
auto cmd_id_result = add_command_node(ctx.state->graph, std::move(node));
22492249
if (!cmd_id_result) {
22502250
return cmd_id_result;
22512251
}
@@ -2254,15 +2254,15 @@ auto create_command_node(
22542254

22552255
// Add sticky edges from Tupfile and included files to this command
22562256
for (auto src_id : ctx.sticky_sources) {
2257-
(void)add_edge(ctx.state->graph,src_id, cmd_id, LinkType::Sticky);
2257+
(void)add_edge(ctx.state->graph, src_id, cmd_id, LinkType::Sticky);
22582258
}
22592259

22602260
// Add sticky edges from used config variables (fine-grained dependency tracking)
22612261
auto const* cv = ctx.used_config_vars.data();
22622262
for (std::size_t i = 0, n = ctx.used_config_vars.size(); i < n; ++i) {
22632263
auto const* node_id = state.config_var_nodes.find(cv[i]);
22642264
if (node_id) {
2265-
(void)add_edge(ctx.state->graph,*node_id, cmd_id, LinkType::Sticky);
2265+
(void)add_edge(ctx.state->graph, *node_id, cmd_id, LinkType::Sticky);
22662266
}
22672267
}
22682268

@@ -2271,7 +2271,7 @@ auto create_command_node(
22712271
for (std::size_t i = 0, n = ctx.condition_config_vars.size(); i < n; ++i) {
22722272
auto const* node_id = state.config_var_nodes.find(ccv[i]);
22732273
if (node_id) {
2274-
(void)add_edge(ctx.state->graph,*node_id, cmd_id, LinkType::Sticky);
2274+
(void)add_edge(ctx.state->graph, *node_id, cmd_id, LinkType::Sticky);
22752275
}
22762276
}
22772277

@@ -2280,7 +2280,7 @@ auto create_command_node(
22802280
for (std::size_t i = 0, n = ctx.used_env_vars.size(); i < n; ++i) {
22812281
auto const* node_id = state.imported_env_var_nodes.find(uev[i]);
22822282
if (node_id) {
2283-
(void)add_edge(ctx.state->graph,*node_id, cmd_id, LinkType::Sticky);
2283+
(void)add_edge(ctx.state->graph, *node_id, cmd_id, LinkType::Sticky);
22842284
}
22852285
}
22862286

0 commit comments

Comments
 (0)