summaryrefslogtreecommitdiff
path: root/gcc/jit/libgccjit.h
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/jit/libgccjit.h')
-rw-r--r--gcc/jit/libgccjit.h96
1 files changed, 94 insertions, 2 deletions
diff --git a/gcc/jit/libgccjit.h b/gcc/jit/libgccjit.h
index 95d60f845db..062f06d691a 100644
--- a/gcc/jit/libgccjit.h
+++ b/gcc/jit/libgccjit.h
@@ -293,6 +293,24 @@ gcc_jit_context_set_bool_allow_unreachable_blocks (gcc_jit_context *ctxt,
tested for with #ifdef. */
#define LIBGCCJIT_HAVE_gcc_jit_context_set_bool_allow_unreachable_blocks
+/* By default, libgccjit will print errors to stderr.
+
+ This option can be used to disable the printing.
+
+ This entrypoint was added in LIBGCCJIT_ABI_23; you can test for
+ its presence using
+ #ifdef LIBGCCJIT_HAVE_gcc_jit_context_set_bool_print_errors_to_stderr
+*/
+
+extern void
+gcc_jit_context_set_bool_print_errors_to_stderr (gcc_jit_context *ctxt,
+ int enabled);
+
+/* Pre-canned feature macro to indicate the presence of
+ gcc_jit_context_set_bool_print_errors_to_stderr. This can be
+ tested for with #ifdef. */
+#define LIBGCCJIT_HAVE_gcc_jit_context_set_bool_print_errors_to_stderr
+
/* Implementation detail:
libgccjit internally generates assembler, and uses "driver" code
for converting it to other formats (e.g. shared libraries).
@@ -574,8 +592,19 @@ enum gcc_jit_types
/* Complex numbers. */
GCC_JIT_TYPE_COMPLEX_FLOAT,
GCC_JIT_TYPE_COMPLEX_DOUBLE,
- GCC_JIT_TYPE_COMPLEX_LONG_DOUBLE
-
+ GCC_JIT_TYPE_COMPLEX_LONG_DOUBLE,
+
+ /* Sized integer types. */
+ GCC_JIT_TYPE_UINT8_T,
+ GCC_JIT_TYPE_UINT16_T,
+ GCC_JIT_TYPE_UINT32_T,
+ GCC_JIT_TYPE_UINT64_T,
+ GCC_JIT_TYPE_UINT128_T,
+ GCC_JIT_TYPE_INT8_T,
+ GCC_JIT_TYPE_INT16_T,
+ GCC_JIT_TYPE_INT32_T,
+ GCC_JIT_TYPE_INT64_T,
+ GCC_JIT_TYPE_INT128_T
};
extern gcc_jit_type *
@@ -601,6 +630,23 @@ gcc_jit_type_get_const (gcc_jit_type *type);
extern gcc_jit_type *
gcc_jit_type_get_volatile (gcc_jit_type *type);
+#define LIBGCCJIT_HAVE_SIZED_INTEGERS
+
+/* Given types LTYPE and RTYPE, return non-zero if they are compatible.
+ This API entrypoint was added in LIBGCCJIT_ABI_20; you can test for its
+ presence using
+ #ifdef LIBGCCJIT_HAVE_SIZED_INTEGERS */
+extern int
+gcc_jit_compatible_types (gcc_jit_type *ltype,
+ gcc_jit_type *rtype);
+
+/* Given type "T", get its size.
+ This API entrypoint was added in LIBGCCJIT_ABI_20; you can test for its
+ presence using
+ #ifdef LIBGCCJIT_HAVE_SIZED_INTEGERS */
+extern ssize_t
+gcc_jit_type_get_size (gcc_jit_type *type);
+
/* Given type "T", get type "T[N]" (for a constant N). */
extern gcc_jit_type *
gcc_jit_context_new_array_type (gcc_jit_context *ctxt,
@@ -1206,6 +1252,40 @@ gcc_jit_context_new_cast (gcc_jit_context *ctxt,
gcc_jit_rvalue *rvalue,
gcc_jit_type *type);
+/* Reinterpret a value as another type.
+
+#define LIBGCCJIT_HAVE_gcc_jit_context_new_bitcast
+
+ The types must be of the same size.
+
+ This API entrypoint was added in LIBGCCJIT_ABI_21; you can test for its
+ presence using
+ #ifdef LIBGCCJIT_HAVE_gcc_jit_context_new_bitcast */
+extern gcc_jit_rvalue *
+gcc_jit_context_new_bitcast (gcc_jit_context *ctxt,
+ gcc_jit_location *loc,
+ gcc_jit_rvalue *rvalue,
+ gcc_jit_type *type);
+
+#define LIBGCCJIT_HAVE_ALIGNMENT
+
+/* Set the alignment of a variable.
+
+ This API entrypoint was added in LIBGCCJIT_ABI_24; you can test for its
+ presence using
+ #ifdef LIBGCCJIT_HAVE_ALIGNMENT */
+extern void
+gcc_jit_lvalue_set_alignment (gcc_jit_lvalue *lvalue,
+ unsigned bytes);
+
+/* Get the alignment of a variable.
+
+ This API entrypoint was added in LIBGCCJIT_ABI_24; you can test for its
+ presence using
+ #ifdef LIBGCCJIT_HAVE_ALIGNMENT */
+extern unsigned
+gcc_jit_lvalue_get_alignment (gcc_jit_lvalue *lvalue);
+
extern gcc_jit_lvalue *
gcc_jit_context_new_array_access (gcc_jit_context *ctxt,
gcc_jit_location *loc,
@@ -1277,6 +1357,18 @@ extern void
gcc_jit_lvalue_set_link_section (gcc_jit_lvalue *lvalue,
const char *section_name);
+#define LIBGCCJIT_HAVE_gcc_jit_lvalue_set_register_name
+
+/* Make this variable a register variable and set its register name.
+
+ This API entrypoint was added in LIBGCCJIT_ABI_22; you can test for its
+ presence using
+ #ifdef LIBGCCJIT_HAVE_gcc_jit_lvalue_set_register_name
+*/
+void
+gcc_jit_lvalue_set_register_name (gcc_jit_lvalue *lvalue,
+ const char *reg_name);
+
extern gcc_jit_lvalue *
gcc_jit_function_new_local (gcc_jit_function *func,
gcc_jit_location *loc,