Skip to content

Commit e60d546

Browse files
committed
Merge pull request #10760 from ihnorton/docllvmcall
doc: for llvmcall
2 parents 5fbf28b + a957dae commit e60d546

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

base/docs/basedocs.jl

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -501,6 +501,22 @@ keywords[:ccall] = doc"""
501501
in a call to `convert(ArgumentType, ArgumentValue)`.
502502
"""
503503

504+
keywords[:llvmcall] = doc"""
505+
llvmcall(IR::String, ReturnType, (ArgumentType1, ...), ArgumentValue1, ...)
506+
507+
Call LLVM IR string in the first argument. Similar to an LLVM function `define`
508+
block, arguments are available as consecutive unnamed SSA variables (%0, %1, etc.).
509+
510+
Note that the argument type tuple must be a literal tuple, and not a tuple-valued variable or expression.
511+
512+
Each `ArgumentValue` to `llvmcall` will be converted to the corresponding `ArgumentType`,
513+
by automatic insertion of calls to `unsafe_convert(ArgumentType, cconvert(ArgumentType, ArgumentValue))`.
514+
(see also the documentation for each of these functions for further details).
515+
In most cases, this simply results in a call to `convert(ArgumentType, ArgumentValue)`.
516+
517+
See `test/llvmcall.jl` for usage examples.
518+
"""
519+
504520
keywords[:begin] = doc"""
505521
`begin...end` denotes a block of code.
506522

doc/stdlib/c.rst

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,3 +248,19 @@
248248
.. data:: Cdouble
249249

250250
Equivalent to the native ``double`` c-type (Float64)
251+
252+
****************
253+
LLVM Interface
254+
****************
255+
256+
257+
.. Docstring generated from Julia source
258+
259+
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.).
260+
261+
Note that the argument type tuple must be a literal tuple, and not a tuple-valued variable or expression.
262+
263+
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)``\ .
264+
265+
See ``test/llvmcall.jl`` for usage examples.
266+

0 commit comments

Comments
 (0)