From dbf3ed3db10f9fa9157d661704e16ba5b73b0e84 Mon Sep 17 00:00:00 2001 From: Kimplul Date: Thu, 22 Aug 2024 15:48:52 +0300 Subject: disable ast dump when DEBUG=0 + Also optimize ast dump generation a little bit --- include/ek/ast.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'include') diff --git a/include/ek/ast.h b/include/ek/ast.h index 610efb6..9107e8a 100644 --- a/include/ek/ast.h +++ b/include/ek/ast.h @@ -665,11 +665,19 @@ struct ast *clone_ast_list(struct ast *l); struct type *clone_type(struct type *n); struct type *clone_type_list(struct type *l); +#if defined(DEBUG) void ast_dump_list(int depth, struct ast *root); void ast_dump(int depth, struct ast *node); void type_dump_list(struct type *root); void type_dump(struct type *node); +#else +#define ast_dump_list(depth, root) +#define ast_dump(depth, root) + +#define type_dump_list(root) +#define type_dump(root) +#endif /* DEBUG */ void ast_append(struct ast **list, struct ast *elem); void type_append(struct type **list, struct type *elem); -- cgit v1.3