#foreign "custom_name"; <N x i1> bugs (see test.ll and test2.ll)

This commit is contained in:
gingerBill
2016-08-14 22:19:39 +01:00
parent 0edae8c848
commit 0f48a7d299
11 changed files with 261 additions and 863 deletions
+4 -20
View File
@@ -418,28 +418,12 @@ void check_proc_decl(Checker *c, Entity *e, DeclInfo *d, b32 check_body_later) {
check_procedure_type(c, proc_type, pd->type);
b32 is_foreign = false;
b32 is_inline = false;
b32 is_no_inline = false;
for (AstNode *tag = pd->tag_list; tag != NULL; tag = tag->next) {
GB_ASSERT(tag->kind == AstNode_TagExpr);
ast_node(te, TagExpr, tag);
String tag_name = te->name.string;
if (are_strings_equal(tag_name, make_string("foreign"))) {
is_foreign = true;
} else if (are_strings_equal(tag_name, make_string("inline"))) {
is_inline = true;
} else if (are_strings_equal(tag_name, make_string("no_inline"))) {
is_no_inline = true;
} else {
error(&c->error_collector, ast_node_token(tag), "Unknown procedure tag");
}
// TODO(bill): Other tags
}
b32 is_foreign = (pd->tags & ProcTag_foreign) != 0;
b32 is_inline = (pd->tags & ProcTag_inline) != 0;
b32 is_no_inline = (pd->tags & ProcTag_no_inline) != 0;
if (is_inline && is_no_inline) {
error(&c->error_collector, ast_node_token(pd->tag_list),
error(&c->error_collector, ast_node_token(pd->type),
"You cannot apply both `inline` and `no_inline` to a procedure");
}