aboutsummaryrefslogtreecommitdiff
path: root/src/eval.hpp
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2016-04-14 10:40:08 -0700
committerAndrew Kelley <superjoe30@gmail.com>2016-04-14 10:40:08 -0700
commit579856e502eab87ea8a73a76dc63a2108e5a8cc8 (patch)
treefeb34b0985b29f45073ac81e21982a368e0a3542 /src/eval.hpp
parent5a479720ec5786145dac6c85deae4e322bd5972e (diff)
parentfcedc35551cc6b14756499414e47c33004de3be4 (diff)
downloadzig-579856e502eab87ea8a73a76dc63a2108e5a8cc8.tar.gz
zig-579856e502eab87ea8a73a76dc63a2108e5a8cc8.zip
Merge branch 'eval'
Diffstat (limited to 'src/eval.hpp')
-rw-r--r--src/eval.hpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/eval.hpp b/src/eval.hpp
new file mode 100644
index 0000000000..e0236b7146
--- /dev/null
+++ b/src/eval.hpp
@@ -0,0 +1,26 @@
+/*
+ * Copyright (c) 2016 Andrew Kelley
+ *
+ * This file is part of zig, which is MIT licensed.
+ * See http://opensource.org/licenses/MIT
+ */
+
+#ifndef ZIG_EVAL_HPP
+#define ZIG_EVAL_HPP
+
+#include "all_types.hpp"
+
+bool eval_fn(CodeGen *g, AstNode *node, FnTableEntry *fn, ConstExprValue *out_val, int branch_quota,
+ AstNode *struct_node);
+
+bool const_values_equal(ConstExprValue *a, ConstExprValue *b, TypeTableEntry *type_entry);
+int eval_const_expr_bin_op(ConstExprValue *op1_val, TypeTableEntry *op1_type,
+ BinOpType bin_op, ConstExprValue *op2_val, TypeTableEntry *op2_type, ConstExprValue *out_val);
+
+void eval_const_expr_implicit_cast(CastOp cast_op,
+ ConstExprValue *other_val, TypeTableEntry *other_type,
+ ConstExprValue *const_val, TypeTableEntry *new_type);
+
+void eval_min_max_value(CodeGen *g, TypeTableEntry *type_entry, ConstExprValue *const_val, bool is_max);
+
+#endif