David Malcolm <dmalc...@redhat.com> writes:

> On Thu, 2020-01-16 at 11:11 +0000, Andrea Corallo wrote:
>> Hi, second version of the patch here cleaning up an unnecessary
>> change.
>>
>> Does not introduce regressions with make check-jit.
>>
>> Andrea
>>
>> gcc/jit/ChangeLog
>> 2020-??-??  Andrea Corallo  <andrea.cora...@arm.com>
>>
>>      * docs/topics/compatibility.rst (LIBGCCJIT_ABI_13): New ABI tag
>>      plus add version paragraph.
>>      * libgccjit++.h (namespace gccjit::version): Add new namespace.
>>      * libgccjit.c (gcc_jit_version_major, gcc_jit_version_minor)
>>      (gcc_jit_version_patchlevel): New functions.
>>      * libgccjit.h (LIBGCCJIT_HAVE_gcc_jit_version): New macro.
>>      (gcc_jit_version_major, gcc_jit_version_minor)
>>      (gcc_jit_version_patchlevel): New functions.
>>      * libgccjit.map (LIBGCCJIT_ABI_13) New ABI tag.
>>
>> gcc/testsuite/ChangeLog
>> 2020-??-??  Andrea Corallo  <andrea.cora...@arm.com>
>>
>>      * jit.dg/test-version.c: New testcase.
>
> [...]
>
> Thanks for the patch; sorry for the delay in reviewing this.
>
> Out of interest, do you have a specific use for this, or is it more
> speculative?

Hi Dave,

The use case is where client code wants to check specifically at
run-time for the version.  This to warn for a known to be buggy version
or to take any other decision that depends on the libgccjit version.
One could decide to layout the generated code differently depending on
the compiler version.

For these cases the granularity we have with with macros defining for
the ABI may be not sufficient.

As you say this is speculative now given that will become helpful only
in the future.

Thanks for reviewing both patches.  I'll re-spin them this weekend.

  Andrea

Reply via email to