diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2023-02-01 10:59:38 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2023-02-01 10:59:38 +0000 |
commit | 1f140fd11c02c7650e1a6c0aa8a04ddb0bb16fd8 (patch) | |
tree | e9b336cb8f84852b978a3232001c87884cd32167 | |
parent | 4e31b00e6b1918779c05e6885bbfc63f9943772c (diff) | |
parent | ca805ca3c0130ca54013192b35c89d0565574322 (diff) | |
download | clang-sys-1f140fd11c02c7650e1a6c0aa8a04ddb0bb16fd8.tar.gz |
Snap for 9550355 from ca805ca3c0130ca54013192b35c89d0565574322 to sdk-releaseplatform-tools-34.0.1platform-tools-34.0.0platform-tools-33.0.4
Change-Id: Ifdaf077fd61fd2caa8a57a95a9d2b58c9c4f534d
-rw-r--r-- | .cargo_vcs_info.json | 2 | ||||
-rw-r--r-- | .github/workflows/ci.yml | 2 | ||||
-rw-r--r-- | Android.bp | 2 | ||||
-rw-r--r-- | CHANGELOG.md | 13 | ||||
-rw-r--r-- | Cargo.toml | 13 | ||||
-rw-r--r-- | Cargo.toml.orig | 7 | ||||
-rw-r--r-- | METADATA | 12 | ||||
-rw-r--r-- | README.md | 8 | ||||
-rw-r--r-- | TEST_MAPPING | 20 | ||||
-rw-r--r-- | src/lib.rs | 45 |
10 files changed, 92 insertions, 32 deletions
diff --git a/.cargo_vcs_info.json b/.cargo_vcs_info.json index b830e59..d04b5e7 100644 --- a/.cargo_vcs_info.json +++ b/.cargo_vcs_info.json @@ -1,6 +1,6 @@ { "git": { - "sha1": "61dfe583b987265bde526c5a1b3a1baa16fdfff5" + "sha1": "1b9b8a71748aebd26180f1f16728ef111afce5ad" }, "path_in_vcs": "" }
\ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5bd0a2a..646f4c2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,7 +15,7 @@ jobs: strategy: matrix: os: [macos-latest, ubuntu-latest, windows-latest] - clang: [["13.0", "clang_13_0"]] + clang: [["14.0", "clang_14_0"]] rust: ["1.40.0"] steps: - name: Checkout Repository @@ -32,7 +32,7 @@ rust_library_host { name: "libclang_sys", crate_name: "clang_sys", cargo_env_compat: true, - cargo_pkg_version: "1.3.3", + cargo_pkg_version: "1.4.0", srcs: [ "src/lib.rs", ":copy_clang-sys_build_out", diff --git a/CHANGELOG.md b/CHANGELOG.md index 1458d6a..d697220 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,16 @@ +## [1.4.0] - 2022-09-22 + +### Changed +- The value of an `EntityKind` enum variant +(`EntityKind::CXCursor_TranslationUnit`) has been updated for Clang 15.0 and +later to match the +[breaking change made in `libclang`](https://github.com/llvm/llvm-project/commit/bb83f8e70bd1d56152f02307adacd718cd67e312#diff-674613a0e47f4e66cc19061e28e3296d39be2d124dceefb68237b30b8e241e7c) + +### Added +- Added support for `clang` 16.0.x +- Added support for `clang` 15.0.x +- Added support for `clang` 14.0.x + ## [1.3.3] - 2022-05-28 ### Fixed @@ -11,7 +11,7 @@ [package] name = "clang-sys" -version = "1.3.3" +version = "1.4.0" authors = ["Kyle Mayes <kyle@mayeses.com>"] build = "build.rs" links = "clang" @@ -20,8 +20,13 @@ documentation = "https://docs.rs/clang-sys" readme = "README.md" license = "Apache-2.0" repository = "https://github.com/KyleMayes/clang-sys" + [package.metadata.docs.rs] -features = ["clang_13_0", "runtime"] +features = [ + "clang_16_0", + "runtime", +] + [dependencies.glob] version = "0.3" @@ -32,6 +37,7 @@ default-features = false [dependencies.libloading] version = "0.7" optional = true + [build-dependencies.glob] version = "0.3" @@ -40,6 +46,9 @@ clang_10_0 = ["clang_9_0"] clang_11_0 = ["clang_10_0"] clang_12_0 = ["clang_11_0"] clang_13_0 = ["clang_12_0"] +clang_14_0 = ["clang_13_0"] +clang_15_0 = ["clang_14_0"] +clang_16_0 = ["clang_15_0"] clang_3_5 = [] clang_3_6 = ["clang_3_5"] clang_3_7 = ["clang_3_6"] diff --git a/Cargo.toml.orig b/Cargo.toml.orig index b8875a5..1041981 100644 --- a/Cargo.toml.orig +++ b/Cargo.toml.orig @@ -3,7 +3,7 @@ name = "clang-sys" authors = ["Kyle Mayes <kyle@mayeses.com>"] -version = "1.3.3" +version = "1.4.0" readme = "README.md" license = "Apache-2.0" @@ -33,6 +33,9 @@ clang_10_0 = ["clang_9_0"] clang_11_0 = ["clang_10_0"] clang_12_0 = ["clang_11_0"] clang_13_0 = ["clang_12_0"] +clang_14_0 = ["clang_13_0"] +clang_15_0 = ["clang_14_0"] +clang_16_0 = ["clang_15_0"] runtime = ["libloading"] static = [] @@ -49,4 +52,4 @@ glob = "0.3" [package.metadata.docs.rs] -features = ["clang_13_0", "runtime"] +features = ["clang_16_0", "runtime"] @@ -1,3 +1,7 @@ +# This project was upgraded with external_updater. +# Usage: tools/external_updater/updater.sh update rust/crates/clang-sys +# For more info, check https://cs.android.com/android/platform/superproject/+/master:tools/external_updater/README.md + name: "clang-sys" description: "Rust bindings for libclang." third_party { @@ -7,13 +11,13 @@ third_party { } url { type: ARCHIVE - value: "https://static.crates.io/crates/clang-sys/clang-sys-1.3.3.crate" + value: "https://static.crates.io/crates/clang-sys/clang-sys-1.4.0.crate" } - version: "1.3.3" + version: "1.4.0" license_type: NOTICE last_upgrade_date { year: 2022 - month: 6 - day: 28 + month: 12 + day: 8 } } @@ -13,7 +13,7 @@ Released under the Apache License 2.0. ## [Documentation](https://docs.rs/clang-sys) -Note that the documentation on https://docs.rs for this crate assumes usage of the `runtime` Cargo feature as well as the Cargo feature for the latest supported version of `libclang` (e.g., `clang_13_0`), neither of which are enabled by default. +Note that the documentation on https://docs.rs for this crate assumes usage of the `runtime` Cargo feature as well as the Cargo feature for the latest supported version of `libclang` (e.g., `clang_16_0`), neither of which are enabled by default. Due to the usage of the `runtime` Cargo feature, this documentation will contain some additional types and functions to manage a dynamically loaded `libclang` instance at runtime. @@ -26,11 +26,13 @@ To target a version of `libclang`, enable a Cargo features such as one of the fo * `clang_3_5` - requires `libclang` 3.5 or later * `clang_3_6` - requires `libclang` 3.6 or later * etc... -* `clang_12_0` - requires `libclang` 12.0 or later -* `clang_13_0` - requires `libclang` 13.0 or later +* `clang_15_0` - requires `libclang` 15.0 or later +* `clang_16_0` - requires `libclang` 16.0 or later If you do not enable one of these features, the API provided by `libclang` 3.5 will be available by default. +**Note:** If you are using Clang 15.0 or later, you should enable the `clang_15_0` feature or a more recent version feature. Clang 15.0 introduced [a breaking change to the `EntityKind` enum](https://github.com/llvm/llvm-project/commit/bb83f8e70bd1d56152f02307adacd718cd67e312#diff-674613a0e47f4e66cc19061e28e3296d39be2d124dceefb68237b30b8e241e7c) which resulted in a mismatch between the values returned by `libclang` and the values for `EntityKind` defined by this crate in previous versions. + ## Dependencies By default, this crate will attempt to link to `libclang` dynamically. In this case, this crate depends on the `libclang` shared library (`libclang.so` on Linux, `libclang.dylib` on macOS, `libclang.dll` on Windows). If you want to link to `libclang` statically instead, enable the `static` Cargo feature. In this case, this crate depends on the LLVM and Clang static libraries. If you don't want to link to `libclang` at compiletime but instead want to load it at runtime, enable the `runtime` Cargo feature. diff --git a/TEST_MAPPING b/TEST_MAPPING index 96a0732..23bbdf9 100644 --- a/TEST_MAPPING +++ b/TEST_MAPPING @@ -3,28 +3,12 @@ "imports": [ { "path": "external/rust/crates/libsqlite3-sys" - } - ], - "presubmit": [ - { - "name": "keystore2_legacy_blobs_test" - }, - { - "name": "keystore2_test" - }, - { - "name": "legacykeystore_test" - } - ], - "presubmit-rust": [ - { - "name": "keystore2_legacy_blobs_test" }, { - "name": "keystore2_test" + "path": "system/security/keystore2" }, { - "name": "legacykeystore_test" + "path": "system/security/keystore2/legacykeystore" } ] } @@ -127,6 +127,8 @@ cenum! { const CXCallingConv_Unexposed = 200, /// Only produced by `libclang` 13.0 and later. const CXCallingConv_SwiftAsync = 17, + /// Only produced by `libclang` 15.0 and later. + const CXCallingConv_AArch64SVEPCS = 18, } } @@ -321,6 +323,10 @@ cenum! { const CXCursor_OMPIteratorExpr = 151, /// Only produced by `libclang` 12.0 and later. const CXCursor_CXXAddrspaceCastExpr = 152, + /// Only produced by `libclang` 15.0 and later. + const CXCursor_ConceptSpecializationExpr = 153, + /// Only produced by `libclang` 15.0 and later. + const CXCursor_RequiresExpr = 154, const CXCursor_UnexposedStmt = 200, const CXCursor_LabelStmt = 201, const CXCursor_CompoundStmt = 202, @@ -462,7 +468,32 @@ cenum! { const CXCursor_OMPMaskedDirective = 292, /// Only produced by `libclang` 13.0 and later. const CXCursor_OMPUnrollDirective = 293, + /// Only produced by `libclang` 14.0 and later. + const CXCursor_OMPMetaDirective = 294, + /// Only produced by `libclang` 14.0 and later. + const CXCursor_OMPGenericLoopDirective = 295, + /// Only produced by `libclang` 15.0 and later. + const CXCursor_OMPTeamsGenericLoopDirective = 296, + /// Only produced by `libclang` 15.0 and later. + const CXCursor_OMPTargetTeamsGenericLoopDirective = 297, + /// Only produced by `libclang` 15.0 and later. + const CXCursor_OMPParallelGenericLoopDirective = 298, + /// Only produced by `libclang` 15.0 and later. + const CXCursor_OMPTargetParallelGenericLoopDirective = 299, + /// Only produced by `libclang` 15.0 and later. + const CXCursor_OMPParallelMaskedDirective = 300, + /// Only produced by `libclang` 15.0 and later. + const CXCursor_OMPMaskedTaskLoopDirective = 301, + /// Only produced by `libclang` 15.0 and later. + const CXCursor_OMPMaskedTaskLoopSimdDirective = 302, + /// Only produced by `libclang` 15.0 and later. + const CXCursor_OMPParallelMaskedTaskLoopDirective = 303, + /// Only produced by `libclang` 15.0 and later. + const CXCursor_OMPParallelMaskedTaskLoopSimdDirective = 304, + #[cfg(not(feature="clang_15_0"))] const CXCursor_TranslationUnit = 300, + #[cfg(feature="clang_15_0")] + const CXCursor_TranslationUnit = 350, const CXCursor_UnexposedAttr = 400, const CXCursor_IBActionAttr = 401, const CXCursor_IBOutletAttr = 402, @@ -543,6 +574,8 @@ cenum! { const CXCursor_StaticAssert = 602, /// Only produced by `libclang` 4.0 and later. const CXCursor_FriendDecl = 603, + /// Only produced by `libclang` 15.0 and later. + const CXCursor_ConceptDecl = 604, /// Only produced by `libclang` 3.7 and later. const CXCursor_OverloadCandidate = 700, } @@ -646,6 +679,8 @@ cenum! { const CXIdxEntity_CXXConversionFunction = 24, const CXIdxEntity_CXXTypeAlias = 25, const CXIdxEntity_CXXInterface = 26, + /// Only produced by `libclang` 15.0 and later. + const CXIdxEntity_CXXConcept = 27, } } @@ -869,6 +904,8 @@ cenum! { const CXType_ULongAccum = 38, /// Only produced by `libclang` 11.0 and later. const CXType_BFloat16 = 39, + /// Only produced by `libclang` 14.0 and later. + const CXType_Ibm128 = 40, const CXType_Complex = 100, const CXType_Pointer = 101, const CXType_BlockPointer = 102, @@ -1007,6 +1044,8 @@ cenum! { const CXType_ExtVector = 176, /// Only produced by `libclang` 11.0 and later. const CXType_Atomic = 177, + /// Only produced by `libclang` 15.0 and later. + const CXType_BTFTagAttributed = 178, } } @@ -2129,6 +2168,12 @@ link! { /// Only available on `libclang` 5.0 and later. #[cfg(feature = "clang_5_0")] pub fn clang_getTranslationUnitTargetInfo(tu: CXTranslationUnit) -> CXTargetInfo; + /// Only available on `libclang` 16.0 and later. + #[cfg(feature = "clang_16_0")] + pub fn clang_getUnqualifiedType(type_: CXType) -> CXType; + /// Only available on `libclang` 16.0 and later. + #[cfg(feature = "clang_16_0")] + pub fn clang_getNonReferenceType(type_: CXType) -> CXType; pub fn clang_getTypeDeclaration(type_: CXType) -> CXCursor; pub fn clang_getTypeKindSpelling(type_: CXTypeKind) -> CXString; pub fn clang_getTypeSpelling(type_: CXType) -> CXString; |