aboutsummaryrefslogtreecommitdiff
path: root/src/types.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2020-10-24 16:32:37 +0100
committergingerBill <bill@gingerbill.org>2020-10-24 16:32:37 +0100
commit4629754f7ced5df477eb017872ef65539db64a27 (patch)
treefc2fc4b7a493c58adeb10bf54254fbbad66f2f67 /src/types.cpp
parent0061e63db010cdb2043af63527b4c25f45652a51 (diff)
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 {...}`
Diffstat (limited to 'src/types.cpp')
-rw-r--r--src/types.cpp4
1 files changed, 4 insertions, 0 deletions
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;