1 /*
2  * Copyright (c) 2021 Andrew Kelley
3  *
4  * This file is part of zig, which is MIT licensed.
5  * See http://opensource.org/licenses/MIT
6  */
7 
8 #ifndef ZIG_ASTGEN_HPP
9 #define ZIG_ASTGEN_HPP
10 
11 #include "all_types.hpp"
12 
13 bool stage1_astgen(CodeGen *g, AstNode *node, Scope *scope, Stage1Zir *stage1_zir,
14         ZigFn *fn, bool in_c_import_scope);
15 bool stage1_astgen_fn(CodeGen *g, ZigFn *fn_entry);
16 
17 bool ir_inst_src_has_side_effects(Stage1ZirInst *inst);
18 
19 ZigVar *create_local_var(CodeGen *codegen, AstNode *node, Scope *parent_scope,
20         Buf *name, bool src_is_const, bool gen_is_const, bool is_shadowable, Stage1ZirInst *is_comptime,
21         bool skip_name_check);
22 
23 ResultLoc *no_result_loc(void);
24 
25 void invalidate_exec(Stage1Zir *exec, ErrorMsg *msg);
26 
27 AstNode *ast_field_to_symbol_node(AstNode *err_set_field_node);
28 void ir_add_call_stack_errors_gen(CodeGen *codegen, Stage1Air *exec, ErrorMsg *err_msg,
29         int limit);
30 
31 void destroy_instruction_src(Stage1ZirInst *inst);
32 
33 bool ir_should_inline(Stage1Zir *exec, Scope *scope);
34 Buf *get_anon_type_name(CodeGen *codegen, Stage1Zir *exec, const char *kind_name,
35         Scope *scope, AstNode *source_node, Buf *out_bare_name, ResultLoc *result_loc);
36 
37 #endif
38