mirror of
https://github.com/odin-lang/Odin.git
synced 2025-12-30 18:02:02 +00:00
Inline asm expression (-llvm-api)
See https://llvm.org/docs/LangRef.html#inline-assembler-expressions Example: ``` x := asm(i32) -> i32 { "bswap $0", "=r,r", }(123); ``` Allowed directives `#side_effect`, `#align_stack`, `#att`, `#intel` e.g. `asm() #side_effect #intel {...}`
This commit is contained in:
@@ -79,7 +79,11 @@ Type *check_init_variable(CheckerContext *ctx, Entity *e, Operand *operand, Stri
|
||||
}
|
||||
t = default_type(t);
|
||||
}
|
||||
if (is_type_polymorphic(t)) {
|
||||
if (is_type_asm_proc(t)) {
|
||||
error(e->token, "Invalid use of inline asm in %.*s", LIT(context_name));
|
||||
e->type = t_invalid;
|
||||
return nullptr;
|
||||
} else if (is_type_polymorphic(t)) {
|
||||
gbString str = type_to_string(t);
|
||||
defer (gb_string_free(str));
|
||||
error(e->token, "Invalid use of a polymorphic type '%s' in %.*s", str, LIT(context_name));
|
||||
|
||||
Reference in New Issue
Block a user