From 4629754f7ced5df477eb017872ef65539db64a27 Mon Sep 17 00:00:00 2001 From: gingerBill Date: Sat, 24 Oct 2020 16:32:37 +0100 Subject: 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 {...}` --- src/types.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/types.cpp') diff --git a/src/types.cpp b/src/types.cpp index 03e071045..fc4544385 100644 --- a/src/types.cpp +++ b/src/types.cpp @@ -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; -- cgit v1.2.3