mirror of
https://github.com/odin-lang/Odin.git
synced 2026-08-14 17:49:16 +00:00
Begin work on semantically type checking asm templates
This commit is contained in:
@@ -1834,6 +1834,9 @@ retry:;
|
||||
expr = we->cond->tav.value.value_bool ? we->x : we->y;
|
||||
goto retry;
|
||||
case_end;
|
||||
case_ast_node(label, AsmLabelDecl, expr);
|
||||
return entity_of_node(label->name);
|
||||
case_end;
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
@@ -5060,6 +5063,17 @@ gb_internal void check_collect_value_decl(CheckerContext *c, Ast *decl) {
|
||||
if (fl != nullptr) {
|
||||
error(name, "Procedure groups are not allowed within a foreign block");
|
||||
}
|
||||
} else if (init->kind == Ast_AsmTemplate) {
|
||||
if (c->scope->flags&ScopeFlag_Type) {
|
||||
error(name, "Asm templates are not allowed within a struct");
|
||||
continue;
|
||||
}
|
||||
ast_node(at, AsmTemplate, init);
|
||||
e = alloc_entity_asm_template(d->scope, token, nullptr, init);
|
||||
if (fl != nullptr) {
|
||||
error(name, "Asm templates are not allowed within a foreign block");
|
||||
}
|
||||
d->init_expr = init;
|
||||
} else {
|
||||
e = alloc_entity_constant(d->scope, token, nullptr, empty_exact_value);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user