zig/src/analyze.hpp

28 lines
1019 B
C++
Raw Normal View History

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
#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);
TypeTableEntry *find_container(BlockContext *context, Buf *name);
BlockContext *new_block_context(AstNode *node, BlockContext *parent);
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);
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