Skip to content

Commit 8167a57

Browse files
committed
document llvmcall
1 parent b82ab6a commit 8167a57

File tree

5 files changed

+41
-1
lines changed

5 files changed

+41
-1
lines changed

base/docs/basedocs.jl

+16
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/base.rst

-1
Original file line numberDiff line numberDiff line change
@@ -899,7 +899,6 @@ System
899899
900900
Get the IP address of the local machine.
901901

902-
903902
.. function:: getpid() -> Int32
904903

905904
.. Docstring generated from Julia source

doc/stdlib/c.rst

+17
Original file line numberDiff line numberDiff line change
@@ -248,3 +248,20 @@
248248
.. data:: Cdouble
249249

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

doc/stdlib/collections.rst

+6
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,12 @@ Iterable Collections
221221
222222
Returns an array containing only the unique elements of the iterable ``itr``\ , in the order that the first of each set of equivalent elements originally appears. If ``dim`` is specified, returns unique regions of the array ``itr`` along ``dim``\ .
223223

224+
.. code-block:: julia
225+
226+
unique(f, itr)
227+
228+
Returns an array containing one value from ``itr`` for each unique value produced by ``f`` applied to elements of ``itr``\ .
229+
224230
.. function:: reduce(op, v0, itr)
225231

226232
.. Docstring generated from Julia source

doc/stdlib/io-network.rst

+2
Original file line numberDiff line numberDiff line change
@@ -805,6 +805,8 @@ Network I/O
805805

806806
.. function:: getsockname(sock::Union{TCPServer, TCPSocket}) -> (IPAddr,UInt16)
807807

808+
.. Docstring generated from Julia source
809+
808810
Get the IP address and the port that the given TCP socket is connected to (or bound to, in the case of TCPServer).
809811

810812
.. function:: parseip(addr)

0 commit comments

Comments
 (0)