RFR: 7903573: Jextract does not support atomic types
This PR fixes a crash when jextract processes atomic types. These types are exposed in libclang in a weird way: their kind is set to `Atomic` but they do not reveal what the underlying type is (except for the type spelling). The underlying type has to be discovered using the `clang_Type_getValueType` function on the `Atomic` type. This PR does just that, and also adds a test for various atomic types. ------------- Commit messages: - Remove whitespaces - Add copyright - Initial push Changes: https://git.openjdk.org/jextract/pull/132/files Webrev: https://webrevs.openjdk.org/?repo=jextract&pr=132&range=00 Issue: https://bugs.openjdk.org/browse/CODETOOLS-7903573 Stats: 158 lines in 6 files changed: 158 ins; 0 del; 0 mod Patch: https://git.openjdk.org/jextract/pull/132.diff Fetch: git fetch https://git.openjdk.org/jextract.git pull/132/head:pull/132 PR: https://git.openjdk.org/jextract/pull/132
On Fri, 20 Oct 2023 13:17:23 GMT, Maurizio Cimadamore <mcimadamore@openjdk.org> wrote:
This PR fixes a crash when jextract processes atomic types. These types are exposed in libclang in a weird way: their kind is set to `Atomic` but they do not reveal what the underlying type is (except for the type spelling). The underlying type has to be discovered using the `clang_Type_getValueType` function on the `Atomic` type.
This PR does just that, and also adds a test for various atomic types.
Marked as reviewed by jvernee (Committer). test/testng/org/openjdk/jextract/test/api/TestAtomic.java line 2:
1: /* 2: * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
Wrong year Suggestion: * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. test/testng/org/openjdk/jextract/test/api/atomic.h line 1:
1: #include <stdatomic.h>
Missing header ------------- PR Review: https://git.openjdk.org/jextract/pull/132#pullrequestreview-1690590993 PR Review Comment: https://git.openjdk.org/jextract/pull/132#discussion_r1366971456 PR Review Comment: https://git.openjdk.org/jextract/pull/132#discussion_r1366971269
On Fri, 20 Oct 2023 13:17:23 GMT, Maurizio Cimadamore <mcimadamore@openjdk.org> wrote:
This PR fixes a crash when jextract processes atomic types. These types are exposed in libclang in a weird way: their kind is set to `Atomic` but they do not reveal what the underlying type is (except for the type spelling). The underlying type has to be discovered using the `clang_Type_getValueType` function on the `Atomic` type.
This PR does just that, and also adds a test for various atomic types.
This pull request has now been integrated. Changeset: 466fd8ff Author: Maurizio Cimadamore <mcimadamore@openjdk.org> URL: https://git.openjdk.org/jextract/commit/466fd8ff5647a834e48cd19fbfcd3740555a... Stats: 158 lines in 6 files changed: 158 ins; 0 del; 0 mod 7903573: Jextract does not support atomic types Reviewed-by: jvernee ------------- PR: https://git.openjdk.org/jextract/pull/132
participants (2)
-
Jorn Vernee
-
Maurizio Cimadamore