diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2016-11-19 01:39:51 -0500 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2016-11-19 01:39:51 -0500 |
| commit | 8a81f8aa1388331624e4c073e2534d3a987a7d9a (patch) | |
| tree | 9bb160113429cf46e40cca3ea17337edfccdb974 /src/analyze.cpp | |
| parent | 19037014e5a25eaac9564d22cc04cf12fb6ef98e (diff) | |
| download | zig-8a81f8aa1388331624e4c073e2534d3a987a7d9a.tar.gz zig-8a81f8aa1388331624e4c073e2534d3a987a7d9a.zip | |
IR: implement compileVar builtin and more
* implicit array to slice cast
* fix if statements at global scope
* implement array type IR
Diffstat (limited to 'src/analyze.cpp')
| -rw-r--r-- | src/analyze.cpp | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/src/analyze.cpp b/src/analyze.cpp index e202ffc140..8daedbd4d2 100644 --- a/src/analyze.cpp +++ b/src/analyze.cpp @@ -869,12 +869,9 @@ static IrInstruction *analyze_const_value(CodeGen *g, BlockContext *scope, AstNo return result; } -static TypeTableEntry *analyze_type_expr_pointer_only(CodeGen *g, ImportTableEntry *import, - BlockContext *context, AstNode *node, bool pointer_only) +static TypeTableEntry *analyze_type_expr(CodeGen *g, ImportTableEntry *import, BlockContext *context, + AstNode *node) { - if (pointer_only) - zig_panic("TODO"); - IrInstruction *result = analyze_const_value(g, context, node, g->builtin_types.entry_type); if (result->type_entry->id == TypeTableEntryIdInvalid) return g->builtin_types.entry_invalid; @@ -883,13 +880,6 @@ static TypeTableEntry *analyze_type_expr_pointer_only(CodeGen *g, ImportTableEnt return result->static_value.data.x_type; } -// Calls analyze_expression on node, and then resolve_type. -static TypeTableEntry *analyze_type_expr(CodeGen *g, ImportTableEntry *import, BlockContext *context, - AstNode *node) -{ - return analyze_type_expr_pointer_only(g, import, context, node, false); -} - static bool fn_wants_full_static_eval(FnTableEntry *fn_table_entry) { assert(fn_table_entry); AstNodeFnProto *fn_proto = &fn_table_entry->proto_node->data.fn_proto; |
