From 6961c9a4c2fe8612db222bfd1693e38f7a43a2cd Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Tue, 29 Nov 2022 16:07:17 -0500 Subject: expr: Remove the synthetic flag Only diagnostics cares about this, and we can just check if the pointers are equal. --- src/parse.c | 9 --------- 1 file changed, 9 deletions(-) (limited to 'src/parse.c') diff --git a/src/parse.c b/src/parse.c index f7c114d..2136bb5 100644 --- a/src/parse.c +++ b/src/parse.c @@ -79,7 +79,6 @@ struct bfs_expr bfs_true = { .argv = &fake_true_arg, .pure = true, .always_true = true, - .synthetic = true, .cost = FAST_COST, .probability = 1.0, }; @@ -90,7 +89,6 @@ struct bfs_expr bfs_false = { .argv = &fake_false_arg, .pure = true, .always_false = true, - .synthetic = true, .cost = FAST_COST, .probability = 0.0, }; @@ -129,7 +127,6 @@ struct bfs_expr *bfs_expr_new(bfs_eval_fn *eval_fn, size_t argc, char **argv) { expr->pure = false; expr->always_true = false; expr->always_false = false; - expr->synthetic = false; expr->cost = FAST_COST; expr->probability = 0.5; expr->evaluations = 0; @@ -186,10 +183,6 @@ static struct bfs_expr *new_binary_expr(bfs_eval_fn *eval_fn, struct bfs_expr *l expr->rhs = rhs; assert(bfs_expr_has_children(expr)); - if (argv == &fake_and_arg || argv == &fake_or_arg) { - expr->synthetic = true; - } - expr->persistent_fds = lhs->persistent_fds + rhs->persistent_fds; if (lhs->ephemeral_fds > rhs->ephemeral_fds) { expr->ephemeral_fds = lhs->ephemeral_fds; @@ -2011,7 +2004,6 @@ static struct bfs_expr *parse_nohidden(struct parser_state *state, int arg1, int hidden->probability = 0.01; hidden->pure = true; - hidden->synthetic = true; if (parse_exclude(state, hidden) != 0) { return NULL; @@ -3639,7 +3631,6 @@ static struct bfs_expr *parse_whole_expr(struct parser_state *state) { goto fail; } init_print_expr(state, print); - print->synthetic = true; expr = new_binary_expr(eval_and, expr, print, &fake_and_arg); if (!expr) { -- cgit v1.2.3