2015-12-01 00:14:58 +08:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2015 Andrew Kelley
|
|
|
|
*
|
|
|
|
* This file is part of zig, which is MIT licensed.
|
|
|
|
* See http://opensource.org/licenses/MIT
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef ZIG_ANALYZE_HPP
|
|
|
|
#define ZIG_ANALYZE_HPP
|
|
|
|
|
2016-01-11 06:13:39 +08:00
|
|
|
#include "all_types.hpp"
|
2015-12-09 05:15:34 +08:00
|
|
|
|
2015-12-01 13:53:37 +08:00
|
|
|
void semantic_analyze(CodeGen *g);
|
2015-12-01 17:29:21 +08:00
|
|
|
void add_node_error(CodeGen *g, AstNode *node, Buf *msg);
|
2015-12-09 05:15:34 +08:00
|
|
|
TypeTableEntry *new_type_table_entry(TypeTableEntryId id);
|
2016-01-14 09:15:51 +08:00
|
|
|
TypeTableEntry *get_pointer_to_type(CodeGen *g, TypeTableEntry *child_type, bool is_const);
|
2015-12-15 14:10:18 +08:00
|
|
|
VariableTableEntry *find_variable(BlockContext *context, Buf *name);
|
2016-01-11 08:27:58 +08:00
|
|
|
TypeTableEntry *find_container(BlockContext *context, Buf *name);
|
2015-12-15 13:01:39 +08:00
|
|
|
BlockContext *new_block_context(AstNode *node, BlockContext *parent);
|
2016-01-11 06:13:39 +08:00
|
|
|
Expr *get_resolved_expr(AstNode *node);
|
|
|
|
NumLitCodeGen *get_resolved_num_lit(AstNode *node);
|
|
|
|
TopLevelDecl *get_resolved_top_level_decl(AstNode *node);
|
2016-01-14 09:15:51 +08:00
|
|
|
bool is_node_void_expr(AstNode *node);
|
2016-01-15 08:04:35 +08:00
|
|
|
TypeTableEntry **get_int_type_ptr(CodeGen *g, bool is_signed, int size_in_bits);
|
|
|
|
TypeTableEntry *get_int_type(CodeGen *g, bool is_signed, int size_in_bits);
|
2015-12-01 00:14:58 +08:00
|
|
|
|
|
|
|
#endif
|