Commit e807aeaa by David Malcolm Committed by David Malcolm

jit: document union types

gcc/jit/ChangeLog:
	* docs/topics/types.rst (gcc_jit_context_new_union_type): Add
	documentation.
	* docs/_build/texinfo/libgccjit.texi: Regenerate.

gcc/testsuite/ChangeLog:
	* jit.dg/test-accessing-union.c: Add comments for use by
	gcc/jit/docs/topics/types.rst.

From-SVN: r225246
parent c575221a
2015-07-01 David Malcolm <dmalcolm@redhat.com>
* docs/topics/types.rst (gcc_jit_context_new_union_type): Add
documentation.
* docs/_build/texinfo/libgccjit.texi: Regenerate.
2015-07-01 David Malcolm <dmalcolm@redhat.com>
* docs/topics/contexts.rst (gcc_jit_context_set_bool_option):
Clarify lack of lifetime requirements on (const char *) parameter.
* docs/topics/expressions.rst
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -230,3 +230,22 @@ You can model C `struct` types by creating :c:type:`gcc_jit_struct *` and
Populate the fields of a formerly-opaque struct type.
This can only be called once on a given struct type.
.. function:: gcc_jit_type *\
gcc_jit_context_new_union_type (gcc_jit_context *ctxt,\
gcc_jit_location *loc,\
const char *name,\
int num_fields,\
gcc_jit_field **fields)
Construct a new union type, with the given name and fields.
The parameter ``name`` must be non-NULL. It is copied, so the input
buffer does not need to outlive the call.
Example of use:
.. literalinclude:: ../../../testsuite/jit.dg/test-accessing-union.c
:start-after: /* Quote from here in docs/topics/types.rst. */
:end-before: /* Quote up to here in docs/topics/types.rst. */
:language: c
2015-07-01 David Malcolm <dmalcolm@redhat.com>
* jit.dg/test-accessing-union.c: Add comments for use by
gcc/jit/docs/topics/types.rst.
2015-07-01 Matthew Wahab <matthew.wahab@arm.com>
* gcc.target/arm/armv8-sync-comp-swap.c: Replace
......
......@@ -5,6 +5,8 @@
#include "harness.h"
/* Quote from here in docs/topics/types.rst. */
union int_or_float
{
int as_int;
......@@ -77,6 +79,8 @@ create_code (gcc_jit_context *ctxt, void *user_data)
as_float));
}
/* Quote up to here in docs/topics/types.rst. */
void
verify_code (gcc_jit_context *ctxt, gcc_jit_result *result)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment