diff options
Diffstat (limited to 'gcc/jit/jit-playback.cc')
-rw-r--r-- | gcc/jit/jit-playback.cc | 48 |
1 files changed, 40 insertions, 8 deletions
diff --git a/gcc/jit/jit-playback.cc b/gcc/jit/jit-playback.cc index 291ddeb..00d5e72 100644 --- a/gcc/jit/jit-playback.cc +++ b/gcc/jit/jit-playback.cc @@ -295,6 +295,39 @@ get_tree_node_for_type (enum gcc_jit_types type_) return double_type_node; case GCC_JIT_TYPE_LONG_DOUBLE: return long_double_type_node; + case GCC_JIT_TYPE_FLOAT16: + if (float16_type_node == NULL || TYPE_PRECISION (float16_type_node) != 16) + { + add_error (NULL, "gcc_jit_types value unsupported on this target: %i", + type_); + return NULL; + } + return float16_type_node; + case GCC_JIT_TYPE_FLOAT32: + if (float32_type_node == NULL || TYPE_PRECISION (float32_type_node) != 32) + { + add_error (NULL, "gcc_jit_types value unsupported on this target: %i", + type_); + return NULL; + } + return float32_type_node; + case GCC_JIT_TYPE_FLOAT64: + if (float64_type_node == NULL || TYPE_PRECISION (float64_type_node) != 64) + { + add_error (NULL, "gcc_jit_types value unsupported on this target: %i", + type_); + return NULL; + } + return float64_type_node; + case GCC_JIT_TYPE_FLOAT128: + if (float128_type_node == NULL + || TYPE_PRECISION (float128_type_node) != 128) + { + add_error (NULL, "gcc_jit_types value unsupported on this target: %i", + type_); + return NULL; + } + return float128_type_node; case GCC_JIT_TYPE_SIZE_T: return size_type_node; @@ -344,7 +377,7 @@ playback::type * playback::context:: new_array_type (playback::location *loc, playback::type *element_type, - int num_elements) + uint64_t num_elements) { gcc_assert (element_type); @@ -3871,7 +3904,7 @@ add_error (location *loc, const char *fmt, ...) va_list ap; va_start (ap, fmt); m_recording_ctxt->add_error_va (loc ? loc->get_recording_loc () : NULL, - fmt, ap); + diagnostics::kind::error, fmt, ap); va_end (ap); } @@ -3883,13 +3916,12 @@ playback::context:: add_error_va (location *loc, const char *fmt, va_list ap) { m_recording_ctxt->add_error_va (loc ? loc->get_recording_loc () : NULL, - fmt, ap); + diagnostics::kind::error, fmt, ap); } -/* Report a diagnostic up to the jit context as an error, - so that the compilation is treated as a failure. - For now, any kind of diagnostic is treated as an error by the jit - API. */ +/* Report a diagnostic up to the jit context, so that the + compilation is treated as a failure if the diagnostic + is an error. */ void playback::context:: @@ -3914,7 +3946,7 @@ add_diagnostic (const char *text, false); } - m_recording_ctxt->add_error (rec_loc, "%s", text); + m_recording_ctxt->add_diagnostic (rec_loc, diagnostic.m_kind, "%s", text); } /* Dealing with the linemap API. */ |