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);
|
2016-01-27 15:01:49 +08:00
|
|
|
ErrorMsg *add_node_error(CodeGen *g, AstNode *node, Buf *msg);
|
2016-02-28 13:06:46 +08:00
|
|
|
ErrorMsg *add_error_note(CodeGen *g, ErrorMsg *parent_msg, 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 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);
|
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);
|
2016-01-31 16:20:47 +08:00
|
|
|
TypeTableEntry **get_c_int_type_ptr(CodeGen *g, CIntType c_int_type);
|
|
|
|
TypeTableEntry *get_c_int_type(CodeGen *g, CIntType c_int_type);
|
|
|
|
TypeTableEntry *get_typedecl_type(CodeGen *g, const char *name, TypeTableEntry *child_type);
|
2016-02-08 09:32:19 +08:00
|
|
|
TypeTableEntry *get_fn_type(CodeGen *g, FnTypeId *fn_type_id);
|
2016-01-31 16:20:47 +08:00
|
|
|
TypeTableEntry *get_maybe_type(CodeGen *g, TypeTableEntry *child_type);
|
|
|
|
TypeTableEntry *get_array_type(CodeGen *g, TypeTableEntry *child_type, uint64_t array_size);
|
2016-04-09 23:55:53 +08:00
|
|
|
TypeTableEntry *get_slice_type(CodeGen *g, TypeTableEntry *child_type, bool is_const);
|
2016-01-31 16:20:47 +08:00
|
|
|
TypeTableEntry *get_partial_container_type(CodeGen *g, ImportTableEntry *import,
|
|
|
|
ContainerKind kind, AstNode *decl_node, const char *name);
|
|
|
|
TypeTableEntry *get_smallest_unsigned_int_type(CodeGen *g, uint64_t x);
|
2016-01-18 23:50:10 +08:00
|
|
|
bool handle_is_ptr(TypeTableEntry *type_entry);
|
2016-02-16 07:52:37 +08:00
|
|
|
void find_libc_include_path(CodeGen *g);
|
|
|
|
void find_libc_lib_path(CodeGen *g);
|
2016-01-27 15:01:49 +08:00
|
|
|
|
2016-01-31 16:20:47 +08:00
|
|
|
TypeTableEntry *get_underlying_type(TypeTableEntry *type_entry);
|
2016-02-03 15:42:24 +08:00
|
|
|
bool type_has_bits(TypeTableEntry *type_entry);
|
|
|
|
uint64_t get_memcpy_align(CodeGen *g, TypeTableEntry *type_entry);
|
2016-01-31 16:20:47 +08:00
|
|
|
|
2016-02-28 13:06:46 +08:00
|
|
|
|
|
|
|
ImportTableEntry *add_source_file(CodeGen *g, PackageTableEntry *package,
|
|
|
|
Buf *abs_full_path, Buf *src_dirname, Buf *src_basename, Buf *source_code);
|
|
|
|
|
2015-12-01 00:14:58 +08:00
|
|
|
#endif
|