Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: for llvmcall #10760

Merged
merged 1 commit into from
Oct 20, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions base/docs/basedocs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
16 changes: 16 additions & 0 deletions doc/stdlib/c.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.