diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2017-05-09 22:54:23 -0400 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2017-05-09 22:54:23 -0400 |
| commit | 623741171629055a22a35bb8278d81a81dcffbde (patch) | |
| tree | da0cc10fd43c5d167edc59dc587dba1befbb08b4 /src/analyze.cpp | |
| parent | 01f066de379caf545ec65c572f75cc1ed1312799 (diff) | |
| download | zig-623741171629055a22a35bb8278d81a81dcffbde.tar.gz zig-623741171629055a22a35bb8278d81a81dcffbde.zip | |
inline function call with builtin function instead...
...of special syntax.
partially reverts 41144a8566a6fbd779403f6b69424bb640c94a7f
closes #306
Diffstat (limited to 'src/analyze.cpp')
| -rw-r--r-- | src/analyze.cpp | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/src/analyze.cpp b/src/analyze.cpp index 8642389a23..932a47339a 100644 --- a/src/analyze.cpp +++ b/src/analyze.cpp @@ -2195,7 +2195,6 @@ void scan_decls(CodeGen *g, ScopeDecls *decls_scope, AstNode *node) { case NodeTypeVarLiteral: case NodeTypeTryExpr: case NodeTypeTestExpr: - case NodeTypeInlineExpr: zig_unreachable(); } } @@ -3304,8 +3303,7 @@ static uint32_t hash_const_val(ConstExprValue *const_val) { // TODO better hashing algorithm return 31643936; case TypeTableEntryIdFn: - return hash_ptr(const_val->data.x_fn.fn_entry) + - (const_val->data.x_fn.is_inline ? 4133894920 : 3983484790); + return 4133894920 ^ hash_ptr(const_val->data.x_fn.fn_entry); case TypeTableEntryIdNamespace: return hash_ptr(const_val->data.x_import); case TypeTableEntryIdBlock: @@ -3756,8 +3754,7 @@ bool const_values_equal(ConstExprValue *a, ConstExprValue *b) { case TypeTableEntryIdPureError: return a->data.x_pure_err == b->data.x_pure_err; case TypeTableEntryIdFn: - return a->data.x_fn.fn_entry == b->data.x_fn.fn_entry && - a->data.x_fn.is_inline == b->data.x_fn.is_inline; + return a->data.x_fn.fn_entry == b->data.x_fn.fn_entry; case TypeTableEntryIdBool: return a->data.x_bool == b->data.x_bool; case TypeTableEntryIdInt: @@ -3997,8 +3994,7 @@ void render_const_value(CodeGen *g, Buf *buf, ConstExprValue *const_val) { case TypeTableEntryIdFn: { FnTableEntry *fn_entry = const_val->data.x_fn.fn_entry; - const char *inline_str = const_val->data.x_fn.is_inline ? "inline " : ""; - buf_appendf(buf, "%s%s", inline_str, buf_ptr(&fn_entry->symbol_name)); + buf_appendf(buf, "%s", buf_ptr(&fn_entry->symbol_name)); return; } case TypeTableEntryIdBlock: @@ -4080,8 +4076,7 @@ void render_const_value(CodeGen *g, Buf *buf, ConstExprValue *const_val) { case TypeTableEntryIdBoundFn: { FnTableEntry *fn_entry = const_val->data.x_bound_fn.fn; - const char *inline_str = const_val->data.x_bound_fn.is_inline ? "inline " : ""; - buf_appendf(buf, "(%sbound fn %s)", inline_str, buf_ptr(&fn_entry->symbol_name)); + buf_appendf(buf, "(bound fn %s)", buf_ptr(&fn_entry->symbol_name)); return; } case TypeTableEntryIdStruct: |
