Snap for 9386067 from 430ba0b7d547fce0a7cd83a4fd484c49f6d86ab9 to udc-release

Change-Id: Ib165f91c82a1a4f731efd6691821c8e25353a4d2
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 @@
     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
diff --git a/Android.bp b/Android.bp
index 513d405..03d3131 100644
--- a/Android.bp
+++ b/Android.bp
@@ -32,7 +32,7 @@
     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
diff --git a/Cargo.toml b/Cargo.toml
index 770af1d..a0d9cbb 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -11,7 +11,7 @@
 
 [package]
 name = "clang-sys"
-version = "1.3.3"
+version = "1.4.0"
 authors = ["Kyle Mayes <[email protected]>"]
 build = "build.rs"
 links = "clang"
@@ -20,8 +20,13 @@
 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 @@
 [dependencies.libloading]
 version = "0.7"
 optional = true
+
 [build-dependencies.glob]
 version = "0.3"
 
@@ -40,6 +46,9 @@
 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 <[email protected]>"]
 
-version = "1.3.3"
+version = "1.4.0"
 
 readme = "README.md"
 license = "Apache-2.0"
@@ -33,6 +33,9 @@
 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 @@
 
 [package.metadata.docs.rs]
 
-features = ["clang_13_0", "runtime"]
+features = ["clang_16_0", "runtime"]
diff --git a/METADATA b/METADATA
index b60134f..ac49596 100644
--- a/METADATA
+++ b/METADATA
@@ -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 @@
   }
   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
   }
 }
diff --git a/README.md b/README.md
index dd73945..ed5f52e 100644
--- a/README.md
+++ b/README.md
@@ -13,7 +13,7 @@
 
 ## [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 @@
 * `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/src/lib.rs b/src/lib.rs
index 863fa86..c101ce6 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -127,6 +127,8 @@
         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 @@
         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 @@
         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 @@
         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 @@
         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 @@
         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 @@
         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 @@
     /// 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;