Skip to content

Commit 9563fe5

Browse files
authored
Merge pull request #254 from maleadt/tb/asmcall_types
Allow literal types with at-asmcall.
2 parents 600f5cd + c0564db commit 9563fe5

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/interop/asmcall.jl

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ arguments as a tuple-type in `argtyp`.
3939
:(@asmcall)
4040

4141
macro asmcall(asm::String, constraints::String, side_effects::Bool,
42-
rettyp::Union{Expr,Symbol}=:(Nothing), argtyp::Expr=:(Tuple{}), args...)
42+
rettyp::Union{Expr,Symbol,Type}=:(Nothing),
43+
argtyp::Union{Expr,Type}=:(Tuple{}), args...)
4344
asm_val = Val{Symbol(asm)}()
4445
constraints_val = Val{Symbol(constraints)}()
4546
return esc(:(LLVM.Interop._asmcall($asm_val, $constraints_val,
@@ -49,12 +50,14 @@ end
4950

5051
# shorthand: no side_effects
5152
macro asmcall(asm::String, constraints::String,
52-
rettyp::Union{Expr,Symbol}=:(Nothing), argtyp::Expr=:(Tuple{}), args...)
53+
rettyp::Union{Expr,Symbol,Type}=:(Nothing),
54+
argtyp::Union{Expr,Type}=:(Tuple{}), args...)
5355
esc(:(LLVM.Interop.@asmcall $asm $constraints false $rettyp $argtyp $(args...)))
5456
end
5557

5658
# shorthand: no side_effects or constraints
5759
macro asmcall(asm::String,
58-
rettyp::Union{Expr,Symbol}=:(Nothing), argtyp::Expr=:(Tuple{}), args...)
60+
rettyp::Union{Expr,Symbol,Type}=:(Nothing),
61+
argtyp::Union{Expr,Type}=:(Tuple{}), args...)
5962
esc(:(LLVM.Interop.@asmcall $asm "" $rettyp $argtyp $(args...)))
6063
end

0 commit comments

Comments
 (0)