diff --git a/base/docs/basedocs.jl b/base/docs/basedocs.jl index bdf5972339a11..9eb6eb228809c 100644 --- a/base/docs/basedocs.jl +++ b/base/docs/basedocs.jl @@ -501,6 +501,22 @@ keywords[:ccall] = doc""" in a call to `convert(ArgumentType, ArgumentValue)`. """ +keywords[:llvmcall] = doc""" + llvmcall(IR::String, ReturnType, (ArgumentType1, ...), ArgumentValue1, ...) + + Call LLVM IR string in the first argument. Similar to an LLVM function `define` + block, arguments are available as consecutive unnamed SSA variables (%0, %1, etc.). + + Note that the argument type tuple must be a literal tuple, and not a tuple-valued variable or expression. + + Each `ArgumentValue` to `llvmcall` will be converted to the corresponding `ArgumentType`, + by automatic insertion of calls to `unsafe_convert(ArgumentType, cconvert(ArgumentType, ArgumentValue))`. + (see also the documentation for each of these functions for further details). + In most cases, this simply results in a call to `convert(ArgumentType, ArgumentValue)`. + + See `test/llvmcall.jl` for usage examples. +""" + keywords[:begin] = doc""" `begin...end` denotes a block of code. diff --git a/doc/stdlib/c.rst b/doc/stdlib/c.rst index bbb70d6051307..2f23e88278c4f 100644 --- a/doc/stdlib/c.rst +++ b/doc/stdlib/c.rst @@ -248,3 +248,19 @@ .. data:: Cdouble Equivalent to the native ``double`` c-type (Float64) + +**************** + LLVM Interface +**************** + + + .. Docstring generated from Julia source + + Call LLVM IR string in the first argument. Similar to an LLVM function ``define`` block, arguments are available as consecutive unnamed SSA variables (%0, %1, etc.). + + Note that the argument type tuple must be a literal tuple, and not a tuple-valued variable or expression. + + Each ``ArgumentValue`` to ``llvmcall`` will be converted to the corresponding ``ArgumentType``\ , by automatic insertion of calls to ``unsafe_convert(ArgumentType, cconvert(ArgumentType, ArgumentValue))``\ . (see also the documentation for each of these functions for further details). In most cases, this simply results in a call to ``convert(ArgumentType, ArgumentValue)``\ . + + See ``test/llvmcall.jl`` for usage examples. +