diff options
| author | Ginger Bill <bill@gingerbill.org> | 2017-06-12 21:21:18 +0100 |
|---|---|---|
| committer | Ginger Bill <bill@gingerbill.org> | 2017-06-12 21:21:18 +0100 |
| commit | ccda456c0a96f849e408bd707eca0a3baf9202b1 (patch) | |
| tree | 57abf5f3bbb1e103165bbb90d78f6a14d3a9e27f /src/ir.cpp | |
| parent | 83bad13e9e1bebd474768edf1a30e0682013149b (diff) | |
`foreign` blocks for procedures
Diffstat (limited to 'src/ir.cpp')
| -rw-r--r-- | src/ir.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/ir.cpp b/src/ir.cpp index da7b052c9..2fafd7a8c 100644 --- a/src/ir.cpp +++ b/src/ir.cpp @@ -5790,6 +5790,12 @@ void ir_build_stmt_internal(irProcedure *proc, AstNode *node) { case_ast_node(bs, EmptyStmt, node); case_end; + case_ast_node(fb, ForeignBlockDecl, node); + for_array(i, fb->decls) { + ir_build_stmt(proc, fb->decls[i]); + } + case_end; + case_ast_node(us, UsingStmt, node); for_array(i, us->list) { AstNode *decl = unparen_expr(us->list[i]); @@ -5943,8 +5949,8 @@ void ir_build_stmt_internal(irProcedure *proc, AstNode *node) { // FFI - Foreign function interace String original_name = e->token.string; String name = original_name; - if (pd->foreign_name.len > 0) { - name = pd->foreign_name; + if (pd->link_name.len > 0) { + name = pd->link_name; } irValue *value = ir_value_procedure(proc->module->allocator, @@ -7251,9 +7257,7 @@ void ir_gen_tree(irGen *s) { name = e->token.string; // NOTE(bill): Don't use the mangled name ir_add_foreign_library_path(m, e->Procedure.foreign_library); } - if (pd->foreign_name.len > 0) { - name = pd->foreign_name; - } else if (pd->link_name.len > 0) { + if (pd->link_name.len > 0) { name = pd->link_name; } |