2016-09-30 14:21:21 +08:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2016 Andrew Kelley
|
|
|
|
*
|
|
|
|
* This file is part of zig, which is MIT licensed.
|
|
|
|
* See http://opensource.org/licenses/MIT
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef ZIG_IR_HPP
|
|
|
|
#define ZIG_IR_HPP
|
|
|
|
|
|
|
|
#include "all_types.hpp"
|
|
|
|
|
2017-01-05 12:21:33 +08:00
|
|
|
bool ir_gen(CodeGen *g, AstNode *node, Scope *scope, IrExecutable *ir_executable);
|
|
|
|
bool ir_gen_fn(CodeGen *g, FnTableEntry *fn_entry);
|
2016-09-30 14:21:21 +08:00
|
|
|
|
2016-12-05 12:52:43 +08:00
|
|
|
IrInstruction *ir_eval_const_value(CodeGen *codegen, Scope *scope, AstNode *node,
|
2016-12-07 11:04:55 +08:00
|
|
|
TypeTableEntry *expected_type, size_t *backward_branch_count, size_t backward_branch_quota,
|
2016-12-19 09:52:40 +08:00
|
|
|
FnTableEntry *fn_entry, Buf *c_import_buf, AstNode *source_node, Buf *exec_name,
|
|
|
|
IrExecutable *parent_exec);
|
2016-12-05 12:52:43 +08:00
|
|
|
|
2016-10-06 13:09:01 +08:00
|
|
|
TypeTableEntry *ir_analyze(CodeGen *g, IrExecutable *old_executable, IrExecutable *new_executable,
|
2016-10-27 13:08:06 +08:00
|
|
|
TypeTableEntry *expected_type, AstNode *expected_type_source_node);
|
2016-09-30 14:21:21 +08:00
|
|
|
|
2016-10-16 14:19:01 +08:00
|
|
|
bool ir_has_side_effects(IrInstruction *instruction);
|
2016-11-17 17:00:02 +08:00
|
|
|
ConstExprValue *const_ptr_pointee(ConstExprValue *const_val);
|
2016-10-16 14:19:01 +08:00
|
|
|
|
2017-01-12 16:15:06 +08:00
|
|
|
FnTableEntry *ir_create_inline_fn(CodeGen *codegen, Buf *fn_name, VariableTableEntry *var, Scope *parent_scope);
|
|
|
|
|
2016-09-30 14:21:21 +08:00
|
|
|
#endif
|