From e8f78907830c525dccf1f4a5e6f97a15780c54ef Mon Sep 17 00:00:00 2001 From: Kimplul Date: Tue, 21 Jan 2025 20:32:39 +0200 Subject: add type visibility checks + Essentially require that each type used in a public symbol only use types that are exported out of the file as well --- src/ast.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/ast.c') diff --git a/src/ast.c b/src/ast.c index c7f32a0..5561745 100644 --- a/src/ast.c +++ b/src/ast.c @@ -149,6 +149,17 @@ void ast_set_flags(struct ast *node, enum ast_flags flags) node->f |= flags; } +static int _ast_set_flags(struct ast *node, enum ast_flags *flags) +{ + ast_set_flags(node, *flags); + return 0; +} + +void ast_set_flags_recurse(struct ast *node, enum ast_flags flags) +{ + ast_visit((ast_callback_t)_ast_set_flags, NULL, node, &flags); +} + void ast_clear_flags(struct ast *node, enum ast_flags flags) { node->f &= ~(flags); -- cgit v1.3