Skip to content
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
42 changes: 42 additions & 0 deletions gcc/jit/libgccjit.cc
Original file line number Diff line number Diff line change
Expand Up @@ -699,6 +699,20 @@ gcc_jit_vector_type_get_num_units (gcc_jit_vector_type *vector_type)
return vector_type->get_num_units ();
}

/* Public entrypoint. See description in libgccjit.h.

After error-checking, this calls the trivial
gcc::jit::recording::memento::as_object method (a type is a
memento), in jit-recording.h. */

gcc_jit_object *
gcc_jit_vector_type_as_object (gcc_jit_vector_type *vector_type)
{
RETURN_NULL_IF_FAIL (vector_type, NULL, NULL, "NULL vector_type");

return static_cast <gcc_jit_object *> (vector_type->as_object ());
}

/* Public entrypoint. See description in libgccjit.h.

After error-checking, the real work is done by the
Expand Down Expand Up @@ -824,6 +838,20 @@ gcc_jit_function_type_get_param_type (gcc_jit_function_type *function_type,
return (gcc_jit_type *)function_type->get_param_types ()[index];
}

/* Public entrypoint. See description in libgccjit.h.

After error-checking, this calls the trivial
gcc::jit::recording::memento::as_object method (a type is a
memento), in jit-recording.h. */

gcc_jit_object *
gcc_jit_function_type_as_object (gcc_jit_function_type *function_type)
{
RETURN_NULL_IF_FAIL (function_type, NULL, NULL, "NULL function_type");

return static_cast <gcc_jit_object *> (function_type->as_object ());
}

/* Public entrypoint. See description in libgccjit.h.

After error-checking, the real work is done by the
Expand Down Expand Up @@ -3229,6 +3257,20 @@ gcc_jit_region_add_block (gcc_jit_region *region, gcc_jit_block *block)
region->add_block (block);
}

/* Public entrypoint. See description in libgccjit.h.

After error-checking, this calls the trivial
gcc::jit::recording::memento::as_object method (a region is a
memento), in jit-recording.h. */

gcc_jit_object *
gcc_jit_region_as_object (gcc_jit_region *region)
{
RETURN_NULL_IF_FAIL (region, NULL, NULL, "NULL region");

return static_cast <gcc_jit_object *> (region->as_object ());
}

/* Public entrypoint. See description in libgccjit.h.

After error-checking, the real work is done by the
Expand Down
24 changes: 24 additions & 0 deletions gcc/jit/libgccjit.h
Original file line number Diff line number Diff line change
Expand Up @@ -1610,6 +1610,14 @@ extern void
gcc_jit_region_add_block (gcc_jit_region *region,
gcc_jit_block *block);

/* Upcasting from gcc_jit_region to object.

This API entrypoint was added in LIBGCCJIT_ABI_55.
*/

extern gcc_jit_object *
gcc_jit_region_as_object (gcc_jit_region *region);

#define LIBGCCJIT_HAVE_REGION

/* Clone blocks into out_clones.
Expand Down Expand Up @@ -2248,6 +2256,14 @@ extern gcc_jit_type *
gcc_jit_function_type_get_param_type (gcc_jit_function_type *function_type,
size_t index);

/* Upcasting from gcc_jit_function_type to object.

This API entrypoint was added in LIBGCCJIT_ABI_55.
*/

extern gcc_jit_object *
gcc_jit_function_type_as_object (gcc_jit_function_type *function_type);

/* Return non-zero if the type is an integral. */
extern int
gcc_jit_type_is_integral (gcc_jit_type *type);
Expand Down Expand Up @@ -2279,6 +2295,14 @@ gcc_jit_vector_type_get_num_units (gcc_jit_vector_type *vector_type);
extern gcc_jit_type *
gcc_jit_vector_type_get_element_type (gcc_jit_vector_type *vector_type);

/* Upcasting from gcc_jit_vector_type to object.

This API entrypoint was added in LIBGCCJIT_ABI_55.
*/

extern gcc_jit_object *
gcc_jit_vector_type_as_object (gcc_jit_vector_type *vector_type);

/* Given a type, return the unqualified type, removing "const", "volatile"
* and alignment qualifiers. */
extern gcc_jit_type *
Expand Down
3 changes: 3 additions & 0 deletions gcc/jit/libgccjit.map
Original file line number Diff line number Diff line change
Expand Up @@ -445,4 +445,7 @@ LIBGCCJIT_ABI_55 {
global:
gcc_jit_block_get_successor_count;
gcc_jit_block_get_successor;
gcc_jit_function_type_as_object;
Comment thread
antoyo marked this conversation as resolved.
gcc_jit_vector_type_as_object;
gcc_jit_region_as_object;
} LIBGCCJIT_ABI_54;
Loading