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:
gingerBill
2020-10-24 16:32:37 +01:00
parent 0061e63db0
commit 4629754f7c
8 changed files with 271 additions and 14 deletions

View File

@@ -1210,6 +1210,10 @@ bool is_type_proc(Type *t) {
t = base_type(t);
return t->kind == Type_Proc;
}
bool is_type_asm_proc(Type *t) {
t = base_type(t);
return t->kind == Type_Proc && t->Proc.calling_convention == ProcCC_InlineAsm;
}
bool is_type_poly_proc(Type *t) {
t = base_type(t);
return t->kind == Type_Proc && t->Proc.is_polymorphic;