diff --git a/.editorconfig b/.editorconfig
index 1909f880..97af5d1d 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -244,7 +244,7 @@ dotnet_style_qualification_for_method = false:error
dotnet_style_qualification_for_property = false:error
dotnet_style_readonly_field = true:error
-dotnet_style_require_accessibility_modifiers = always:error
+dotnet_style_require_accessibility_modifiers = for_non_interface_members:error
###############################################################################
# Set dotnet style options to:
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 8ed9517c..8d0d4eda 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -25,36 +25,46 @@ jobs:
path: |
./artifacts/bin/**/*
./artifacts/log/**/*
- ./artifacts/pkg/**/*
./artifacts/tst/**/*
if-no-files-found: error
- linux-x64:
- runs-on: ${{ matrix.os }}-latest
+ - uses: actions/upload-artifact@v4
+ with:
+ name: ${{ matrix.os }}_${{ matrix.configuration }}_${{ matrix.architecture }}_pkg
+ path: |
+ ./artifacts/pkg/**/*
+ if-no-files-found: error
+ windows-arm64:
+ runs-on: ${{ matrix.os }}-11-arm
strategy:
matrix:
- architecture: [ x64 ]
+ architecture: [ arm64 ]
configuration: [ debug, release ]
- os: [ ubuntu ]
+ os: [ windows ]
steps:
- uses: actions/checkout@v4
- - run: ./scripts/cibuild.sh --configuration ${{ matrix.configuration }} --architecture ${{ matrix.architecture }}
- shell: bash
+ - run: ./scripts/cibuild.cmd -configuration ${{ matrix.configuration }} -architecture ${{ matrix.architecture }}
+ shell: cmd
- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.os }}_${{ matrix.configuration }}_${{ matrix.architecture }}
path: |
./artifacts/bin/**/*
./artifacts/log/**/*
- ./artifacts/pkg/**/*
./artifacts/tst/**/*
if-no-files-found: error
- macos-x64:
+ - uses: actions/upload-artifact@v4
+ with:
+ name: ${{ matrix.os }}_${{ matrix.configuration }}_${{ matrix.architecture }}_pkg
+ path: |
+ ./artifacts/pkg/**/*.win-arm64.*
+ if-no-files-found: error
+ linux-x64:
runs-on: ${{ matrix.os }}-latest
strategy:
matrix:
architecture: [ x64 ]
configuration: [ debug, release ]
- os: [ macos ]
+ os: [ ubuntu ]
steps:
- uses: actions/checkout@v4
- run: ./scripts/cibuild.sh --configuration ${{ matrix.configuration }} --architecture ${{ matrix.architecture }}
@@ -65,100 +75,103 @@ jobs:
path: |
./artifacts/bin/**/*
./artifacts/log/**/*
- ./artifacts/pkg/**/*
./artifacts/tst/**/*
if-no-files-found: error
- build-nuget-preview:
- runs-on: windows-latest
+ - uses: actions/upload-artifact@v4
+ with:
+ name: ${{ matrix.os }}_${{ matrix.configuration }}_${{ matrix.architecture }}_pkg
+ path: |
+ ./artifacts/pkg/**/*.linux-x64.*
+ if-no-files-found: error
+ linux-arm64:
+ runs-on: ${{ matrix.os }}-24.04-arm
+ strategy:
+ matrix:
+ architecture: [ arm64 ]
+ configuration: [ debug, release ]
+ os: [ ubuntu ]
steps:
- uses: actions/checkout@v4
- - run: ./scripts/cibuild.cmd -configuration release -architecture x64
- shell: cmd
- env:
- EXCLUDE_RUN_ID_FROM_PACKAGE: true
- EXCLUDE_SUFFIX_FROM_VERSION: false
+ - run: ./scripts/cibuild.sh --configuration ${{ matrix.configuration }} --architecture ${{ matrix.architecture }}
+ shell: bash
- uses: actions/upload-artifact@v4
with:
- name: nuget_preview
+ name: ${{ matrix.os }}_${{ matrix.configuration }}_${{ matrix.architecture }}
path: |
./artifacts/bin/**/*
./artifacts/log/**/*
- ./artifacts/pkg/**/*
./artifacts/tst/**/*
if-no-files-found: error
- sign-nuget-preview:
- runs-on: windows-latest
- if: ${{ github.event_name == 'push' }}
- needs: [ build-nuget-preview ]
- permissions:
- id-token: write
- steps:
- - uses: actions/checkout@v4
- - uses: actions/download-artifact@v4
- with:
- name: nuget_preview
- path: ./artifacts
- - uses: actions/setup-dotnet@v4
- with:
- global-json-file: ./global.json
- - run: dotnet tool install --tool-path ./artifacts/tools sign --version 0.9.1-beta.24170.3
- - run: ./artifacts/tools/sign code azure-key-vault "**/*.nupkg" --timestamp-url "http://timestamp.digicert.com" --base-directory "${{ github.workspace }}/artifacts/pkg" --file-list "${{ github.workspace }}/scripts/SignClientFileList.txt" --publisher-name ".NET Foundation" --description "ClangSharp" --description-url "https://github.com/dotnet/clangsharp" --azure-key-vault-certificate "${{ secrets.SC_KEY_VAULT_CERTIFICATE_ID }}" --azure-key-vault-client-id "${{ secrets.SC_AZURE_CLIENT_ID }}" --azure-key-vault-client-secret "${{ secrets.SC_AZURE_CLIENT_SECRET }}" --azure-key-vault-tenant-id "${{ secrets.SC_AZURE_TENANT_ID }}" --azure-key-vault-url "${{ secrets.SC_KEY_VAULT_URL }}"
- uses: actions/upload-artifact@v4
with:
- name: sign_nuget_preview
+ name: ${{ matrix.os }}_${{ matrix.configuration }}_${{ matrix.architecture }}_pkg
path: |
- ./artifacts/pkg/**/*
+ ./artifacts/pkg/**/*.linux-arm64.*
if-no-files-found: error
- build-nuget-release:
- runs-on: windows-latest
+ macos-arm64:
+ runs-on: ${{ matrix.os }}-latest
+ strategy:
+ matrix:
+ architecture: [ arm64 ]
+ configuration: [ debug, release ]
+ os: [ macos ]
steps:
- uses: actions/checkout@v4
- - run: ./scripts/cibuild.cmd -configuration release -architecture x64
- shell: cmd
- env:
- EXCLUDE_RUN_ID_FROM_PACKAGE: true
- EXCLUDE_SUFFIX_FROM_VERSION: true
+ - run: ./scripts/cibuild.sh --configuration ${{ matrix.configuration }} --architecture ${{ matrix.architecture }}
+ shell: bash
- uses: actions/upload-artifact@v4
with:
- name: nuget_release
+ name: ${{ matrix.os }}_${{ matrix.configuration }}_${{ matrix.architecture }}
path: |
./artifacts/bin/**/*
./artifacts/log/**/*
- ./artifacts/pkg/**/*
./artifacts/tst/**/*
if-no-files-found: error
- sign-nuget-release:
+ - uses: actions/upload-artifact@v4
+ with:
+ name: ${{ matrix.os }}_${{ matrix.configuration }}_${{ matrix.architecture }}_pkg
+ path: |
+ ./artifacts/pkg/**/*.osx-arm64.*
+ if-no-files-found: error
+ sign-nuget:
runs-on: windows-latest
if: ${{ github.event_name == 'push' }}
- needs: [ build-nuget-release ]
+ needs: [ windows-x64, windows-arm64, linux-x64, linux-arm64, macos-arm64 ]
permissions:
id-token: write
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
- name: nuget_release
- path: ./artifacts
+ merge-multiple: true
+ path: ./artifacts/pkg
+ pattern: "*_release_*_pkg"
- uses: actions/setup-dotnet@v4
with:
global-json-file: ./global.json
- - run: dotnet tool install --tool-path ./artifacts/tools sign --version 0.9.1-beta.24170.3
- - run: ./artifacts/tools/sign code azure-key-vault "**/*.nupkg" --timestamp-url "http://timestamp.digicert.com" --base-directory "${{ github.workspace }}/artifacts/pkg" --file-list "${{ github.workspace }}/scripts/SignClientFileList.txt" --publisher-name ".NET Foundation" --description "ClangSharp" --description-url "https://github.com/dotnet/clangsharp" --azure-key-vault-certificate "${{ secrets.SC_KEY_VAULT_CERTIFICATE_ID }}" --azure-key-vault-client-id "${{ secrets.SC_AZURE_CLIENT_ID }}" --azure-key-vault-client-secret "${{ secrets.SC_AZURE_CLIENT_SECRET }}" --azure-key-vault-tenant-id "${{ secrets.SC_AZURE_TENANT_ID }}" --azure-key-vault-url "${{ secrets.SC_KEY_VAULT_URL }}"
+ - run: dotnet tool install --tool-path ./artifacts/tools --prerelease sign
+ - uses: azure/login@v2
+ with:
+ allow-no-subscriptions: true
+ client-id: "${{ secrets.AZURE_CLIENT_ID }}"
+ tenant-id: "${{ secrets.AZURE_TENANT_ID }}"
+ - run: ./artifacts/tools/sign code azure-key-vault "**/*.nupkg" --base-directory "${{ github.workspace }}/artifacts/pkg" --file-list "${{ github.workspace }}/scripts/SignClientFileList.txt" --publisher-name ".NET Foundation" --description "ClangSharp" --description-url "https://github.com/dotnet/clangsharp" --azure-credential-type "azure-cli" --azure-key-vault-url "${{ secrets.KEY_VAULT_URL }}" --azure-key-vault-certificate "${{ secrets.KEY_VAULT_CERTIFICATE_ID }}"
+ shell: pwsh
- uses: actions/upload-artifact@v4
with:
- name: sign_nuget_release
+ name: sign_nuget
path: |
./artifacts/pkg/**/*
if-no-files-found: error
publish-nightlies-azure:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'push' }}
- needs: [ windows-x64, linux-x64, macos-x64, sign-nuget-preview, sign-nuget-release ]
+ needs: [ sign-nuget ]
steps:
- uses: actions/download-artifact@v4
with:
- name: windows_release_x64
- path: ./artifacts
+ name: sign_nuget
+ path: ./artifacts/pkg
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
@@ -169,12 +182,12 @@ jobs:
publish-nightlies-github:
runs-on: ubuntu-latest
if: false
- needs: [ windows-x64, linux-x64, macos-x64, sign-nuget-preview, sign-nuget-release ]
+ needs: [ sign-nuget ]
steps:
- uses: actions/download-artifact@v4
with:
- name: windows_release_x64
- path: ./artifacts
+ name: sign_nuget
+ path: ./artifacts/pkg
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 047dec3d..8175a78b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.13)
-project(ClangSharp VERSION 18.1.3)
+project(ClangSharp VERSION 20.1.2)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
diff --git a/Directory.Build.props b/Directory.Build.props
index 4797b4f0..af219597 100644
--- a/Directory.Build.props
+++ b/Directory.Build.props
@@ -43,12 +43,12 @@
.NET Foundation
true
true
- $(BaseArtifactsPath)pkg/$(Configuration)/
+ $(BaseArtifactsPath)pkg/$(Configuration)/$(PACKAGE_PUBLISH_MODE)
17.0.0
ClangSharp
ClangSharp
- 18.1.0.3
- rc1
+ 20.1.2.3
+ rc1
pr
diff --git a/Directory.Build.targets b/Directory.Build.targets
index db24925f..bd6fed59 100644
--- a/Directory.Build.targets
+++ b/Directory.Build.targets
@@ -17,7 +17,7 @@
- $(Version).$(GITHUB_RUN_ID)
+ $(Version).$(GITHUB_RUN_ID)
@@ -31,10 +31,9 @@
true
-
-
+
+
$(NETCoreSdkRuntimeIdentifier)
- $(OVERRIDE_RUNTIME_IDENTIFIER)
diff --git a/Directory.Packages.props b/Directory.Packages.props
index 6704befd..b9a02164 100644
--- a/Directory.Packages.props
+++ b/Directory.Packages.props
@@ -12,11 +12,11 @@
-
-
-
-
-
+
+
+
+
+
diff --git a/README.md b/README.md
index 795e325a..df4ca5f2 100644
--- a/README.md
+++ b/README.md
@@ -13,7 +13,7 @@ A convenience package which provides the native libClang library for several pla
A helper package which exposes many Clang APIs missing from libClang is provided here: https://www.nuget.org/packages/libClangSharp
-**NOTE:** libclang and libClangSharp are meta-packages which point to the platform-specific runtime packages ([e.g.](https://www.nuget.org/packages/libClangSharp.runtime.win-x64/18.1.3); see others owned by [tannergooding](https://www.nuget.org/profiles/tannergooding)). Several manual steps may be required to use them, see discussion in [#46](https://github.com/dotnet/ClangSharp/issues/46) and [#118](https://github.com/dotnet/ClangSharp/issues/118).
+**NOTE:** libclang and libClangSharp are meta-packages which point to the platform-specific runtime packages ([e.g.](https://www.nuget.org/packages/libClangSharp.runtime.win-x64/20.1.2); see others owned by [tannergooding](https://www.nuget.org/profiles/tannergooding)). Several manual steps may be required to use them, see discussion in [#46](https://github.com/dotnet/ClangSharp/issues/46) and [#118](https://github.com/dotnet/ClangSharp/issues/118).
Nightly packages are available via the NuGet Feed URL: https://pkgs.clangsharp.dev/index.json
@@ -55,7 +55,7 @@ See [LICENSE.md](LICENSE.md) in the repository root for more information.
### Building Managed
-ClangSharp requires the [.NET 8 SDK](https://dotnet.microsoft.com/download/dotnet/8.0) and can be built simply with `dotnet build -c Release`.
+ClangSharp requires the [.NET 10 SDK](https://dotnet.microsoft.com/download/dotnet/10.0) and can be built simply with `dotnet build -c Release`.
You can reproduce what the CI environment does by running `./scripts/cibuild.cmd` on Windows or `./scripts.cibuild.sh` on Unix.
This will download the required .NET SDK locally and use that to build the repo; it will also run through all available actions in the appropriate order.
@@ -77,14 +77,14 @@ To successfully build `libClangSharp` you must first build Clang (https://clang.
The process done on Windows is roughly:
```cmd
-git clone --single-branch --branch llvmorg-18.1.3 https://github.com/llvm/llvm-project
+git clone --single-branch --branch llvmorg-20.1.2 https://github.com/llvm/llvm-project
cd llvm-project
mkdir artifacts/bin
cd artifacts/bin
cmake -DCMAKE_INSTALL_PREFIX=../install -DLLVM_ENABLE_PROJECTS=clang -G "Visual Studio 17 2022" -A x64 -Thost=x64 ../../llvm
```
-You can then open `LLVM.sln` in Visual Studio, change the configuration to `Release` and build the `install` project.
+You can then open `LLVM.sln` in Visual Studio, change the configuration to `Release` and build the `INSTALL` project. You may need to build the `ALL_BUILD` first.
Afterwards, you can then build `libClangSharp` where the process followed is roughly:
```cmd
@@ -92,16 +92,16 @@ git clone https://github.com/dotnet/clangsharp
cd clangsharp
mkdir artifacts/bin/native
cd artifacts/bin/native
-cmake -DCMAKE_INSTALL_PREFIX=../install -DPATH_TO_LLVM=../../../../llvm-project/artifacts/install -G "Visual Studio 17 2022" -A x64 -Thost=x64 ../../..
+cmake -DCMAKE_INSTALL_PREFIX=../install -DPATH_TO_LLVM=absolute/path/to/repos/llvm-project/artifacts/install -G "Visual Studio 17 2022" -A x64 -Thost=x64 ../../..
```
-You can then open `libClangSharp.sln` in Visual Studio, change the configuration to `Release` and build the `install` project.
+You can then open `libClangSharp.sln` in Visual Studio, change the configuration to `Release` and build the `INSTALL` project.
#### Linux
The process done on Linux is roughly:
```bash
-git clone --single-branch --branch llvmorg-18.1.3 https://github.com/llvm/llvm-project
+git clone --single-branch --branch llvmorg-20.1.2 https://github.com/llvm/llvm-project
cd llvm-project
mkdir -p artifacts/bin
cd artifacts/bin
@@ -133,7 +133,7 @@ This program will take a given set of C or C++ header files and generate C# bind
The simplest and recommended setup is to install the generator as a .NET tool and then use response files:
```
-dotnet tool install --global ClangSharpPInvokeGenerator --version 18.1.0
+dotnet tool install --global ClangSharpPInvokeGenerator
ClangSharpPInvokeGenerator @generate.rsp
```
@@ -202,9 +202,9 @@ Options:
# Codegen Options
compatible-codegen Bindings should be generated with .NET Standard 2.0 compatibility. Setting this disables preview code generation.
- default-codegen Bindings should be generated for the previous LTS version of .NET/C#. This is currently .NET 6/C# 10.
- latest-codegen Bindings should be generated for the current LTS/STS version of .NET/C#. This is currently .NET 8/C# 12.
- preview-codegen Bindings should be generated for the preview version of .NET/C#. This is currently .NET 9/C# 13.
+ default-codegen Bindings should be generated for the previous LTS version of .NET/C#. This is currently .NET 8/C# 12.
+ latest-codegen Bindings should be generated for the current LTS/STS version of .NET/C#. This is currently .NET 10/C# 14.
+ preview-codegen Bindings should be generated for the preview version of .NET/C#. This is currently .NET 10/C# 14.
# File Options
diff --git a/global.json b/global.json
index 61d88a71..ff239fd9 100644
--- a/global.json
+++ b/global.json
@@ -1,6 +1,6 @@
{
"sdk": {
- "version": "8.0.100",
+ "version": "10.0.100-preview",
"allowPrerelease": true,
"rollForward": "latestFeature"
}
diff --git a/packages/libClangSharp/libClangSharp.runtime.linux-arm64/libClangSharp.runtime.linux-arm64.nuspec b/packages/libClangSharp/libClangSharp.runtime.linux-arm64/libClangSharp.runtime.linux-arm64.nuspec
index 3396ab28..460b0606 100644
--- a/packages/libClangSharp/libClangSharp.runtime.linux-arm64/libClangSharp.runtime.linux-arm64.nuspec
+++ b/packages/libClangSharp/libClangSharp.runtime.linux-arm64/libClangSharp.runtime.linux-arm64.nuspec
@@ -2,7 +2,7 @@
libClangSharp.runtime.linux-arm64
- 18.1.3.1
+ 20.1.2
.NET Foundation and Contributors
.NET Foundation and Contributors
true
diff --git a/packages/libClangSharp/libClangSharp.runtime.linux-x64/libClangSharp.runtime.linux-x64.nuspec b/packages/libClangSharp/libClangSharp.runtime.linux-x64/libClangSharp.runtime.linux-x64.nuspec
index 4a4dff09..1ea7b854 100644
--- a/packages/libClangSharp/libClangSharp.runtime.linux-x64/libClangSharp.runtime.linux-x64.nuspec
+++ b/packages/libClangSharp/libClangSharp.runtime.linux-x64/libClangSharp.runtime.linux-x64.nuspec
@@ -2,7 +2,7 @@
libClangSharp.runtime.linux-x64
- 18.1.3.1
+ 20.1.2
.NET Foundation and Contributors
.NET Foundation and Contributors
true
diff --git a/packages/libClangSharp/libClangSharp.runtime.osx-arm64/libClangSharp.runtime.osx-arm64.nuspec b/packages/libClangSharp/libClangSharp.runtime.osx-arm64/libClangSharp.runtime.osx-arm64.nuspec
index 640f6a12..1b64e045 100644
--- a/packages/libClangSharp/libClangSharp.runtime.osx-arm64/libClangSharp.runtime.osx-arm64.nuspec
+++ b/packages/libClangSharp/libClangSharp.runtime.osx-arm64/libClangSharp.runtime.osx-arm64.nuspec
@@ -2,7 +2,7 @@
libClangSharp.runtime.osx-arm64
- 18.1.3.1
+ 20.1.2
.NET Foundation and Contributors
.NET Foundation and Contributors
true
diff --git a/packages/libClangSharp/libClangSharp.runtime.osx-x64/libClangSharp.runtime.osx-x64.nuspec b/packages/libClangSharp/libClangSharp.runtime.osx-x64/libClangSharp.runtime.osx-x64.nuspec
deleted file mode 100644
index 42f41600..00000000
--- a/packages/libClangSharp/libClangSharp.runtime.osx-x64/libClangSharp.runtime.osx-x64.nuspec
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-
- libClangSharp.runtime.osx-x64
- 18.1.3.1
- .NET Foundation and Contributors
- .NET Foundation and Contributors
- true
- MIT
- https://github.com/dotnet/clangsharp
- osx x64 native library for libClangSharp.
- Copyright © .NET Foundation and Contributors
-
-
-
-
-
-
-
-
diff --git a/packages/libClangSharp/libClangSharp.runtime.win-arm64/libClangSharp.runtime.win-arm64.nuspec b/packages/libClangSharp/libClangSharp.runtime.win-arm64/libClangSharp.runtime.win-arm64.nuspec
index f3c2fda8..e133ee34 100644
--- a/packages/libClangSharp/libClangSharp.runtime.win-arm64/libClangSharp.runtime.win-arm64.nuspec
+++ b/packages/libClangSharp/libClangSharp.runtime.win-arm64/libClangSharp.runtime.win-arm64.nuspec
@@ -2,7 +2,7 @@
libClangSharp.runtime.win-arm64
- 18.1.3.1
+ 20.1.2
.NET Foundation and Contributors
.NET Foundation and Contributors
true
diff --git a/packages/libClangSharp/libClangSharp.runtime.win-x64/libClangSharp.runtime.win-x64.nuspec b/packages/libClangSharp/libClangSharp.runtime.win-x64/libClangSharp.runtime.win-x64.nuspec
index 728a54bd..19c92c46 100644
--- a/packages/libClangSharp/libClangSharp.runtime.win-x64/libClangSharp.runtime.win-x64.nuspec
+++ b/packages/libClangSharp/libClangSharp.runtime.win-x64/libClangSharp.runtime.win-x64.nuspec
@@ -2,7 +2,7 @@
libClangSharp.runtime.win-x64
- 18.1.3.1
+ 20.1.2
.NET Foundation and Contributors
.NET Foundation and Contributors
true
diff --git a/packages/libClangSharp/libClangSharp/libClangSharp.nuspec b/packages/libClangSharp/libClangSharp/libClangSharp.nuspec
index abc1c087..a74da320 100644
--- a/packages/libClangSharp/libClangSharp/libClangSharp.nuspec
+++ b/packages/libClangSharp/libClangSharp/libClangSharp.nuspec
@@ -2,7 +2,7 @@
libClangSharp
- 18.1.3.1
+ 20.1.2
.NET Foundation and Contributors
.NET Foundation and Contributors
true
diff --git a/packages/libClangSharp/libClangSharp/runtime.json b/packages/libClangSharp/libClangSharp/runtime.json
index 0d562838..1e1c054a 100644
--- a/packages/libClangSharp/libClangSharp/runtime.json
+++ b/packages/libClangSharp/libClangSharp/runtime.json
@@ -2,32 +2,27 @@
"runtimes": {
"linux-arm64": {
"libClangSharp": {
- "libClangSharp.runtime.linux-arm64": "18.1.3.1"
+ "libClangSharp.runtime.linux-arm64": "20.1.2"
}
},
"linux-x64": {
"libClangSharp": {
- "libClangSharp.runtime.linux-x64": "18.1.3.1"
+ "libClangSharp.runtime.linux-x64": "20.1.2"
}
},
"osx-arm64": {
"libClangSharp": {
- "libClangSharp.runtime.osx-arm64": "18.1.3.1"
- }
- },
- "osx-x64": {
- "libClangSharp": {
- "libClangSharp.runtime.osx-x64": "18.1.3.1"
+ "libClangSharp.runtime.osx-arm64": "20.1.2"
}
},
"win-arm64": {
"libClangSharp": {
- "libClangSharp.runtime.win-arm64": "18.1.3.1"
+ "libClangSharp.runtime.win-arm64": "20.1.2"
}
},
"win-x64": {
"libClangSharp": {
- "libClangSharp.runtime.win-x64": "18.1.3.1"
+ "libClangSharp.runtime.win-x64": "20.1.2"
}
}
}
diff --git a/packages/libclang/libclang.runtime.linux-arm64/libclang.runtime.linux-arm64.nuspec b/packages/libclang/libclang.runtime.linux-arm64/libclang.runtime.linux-arm64.nuspec
index 503bd138..8184b9c1 100644
--- a/packages/libclang/libclang.runtime.linux-arm64/libclang.runtime.linux-arm64.nuspec
+++ b/packages/libclang/libclang.runtime.linux-arm64/libclang.runtime.linux-arm64.nuspec
@@ -2,7 +2,7 @@
libclang.runtime.linux-arm64
- 18.1.3.2
+ 20.1.2
.NET Foundation and Contributors
.NET Foundation and Contributors
true
@@ -10,7 +10,7 @@
https://github.com/dotnet/clangsharp
linux arm64 native library for libclang.
Copyright © LLVM Project
-
+
diff --git a/packages/libclang/libclang.runtime.linux-x64/libclang.runtime.linux-x64.nuspec b/packages/libclang/libclang.runtime.linux-x64/libclang.runtime.linux-x64.nuspec
index 3c428c7a..dc6fce53 100644
--- a/packages/libclang/libclang.runtime.linux-x64/libclang.runtime.linux-x64.nuspec
+++ b/packages/libclang/libclang.runtime.linux-x64/libclang.runtime.linux-x64.nuspec
@@ -2,7 +2,7 @@
libclang.runtime.linux-x64
- 18.1.3.2
+ 20.1.2
.NET Foundation and Contributors
.NET Foundation and Contributors
true
@@ -10,7 +10,7 @@
https://github.com/dotnet/clangsharp
linux x64 native library for libclang.
Copyright © LLVM Project
-
+
diff --git a/packages/libclang/libclang.runtime.osx-arm64/libclang.runtime.osx-arm64.nuspec b/packages/libclang/libclang.runtime.osx-arm64/libclang.runtime.osx-arm64.nuspec
index 8baa43b3..e6221d5d 100644
--- a/packages/libclang/libclang.runtime.osx-arm64/libclang.runtime.osx-arm64.nuspec
+++ b/packages/libclang/libclang.runtime.osx-arm64/libclang.runtime.osx-arm64.nuspec
@@ -2,7 +2,7 @@
libclang.runtime.osx-arm64
- 18.1.3
+ 20.1.2
.NET Foundation and Contributors
.NET Foundation and Contributors
true
@@ -10,7 +10,7 @@
https://github.com/dotnet/clangsharp
osx arm64 native library for libclang.
Copyright © LLVM Project
-
+
diff --git a/packages/libclang/libclang.runtime.osx-x64/libclang.runtime.osx-x64.nuspec b/packages/libclang/libclang.runtime.osx-x64/libclang.runtime.osx-x64.nuspec
deleted file mode 100644
index 79dd4e31..00000000
--- a/packages/libclang/libclang.runtime.osx-x64/libclang.runtime.osx-x64.nuspec
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
-
- libclang.runtime.osx-x64
- 18.1.3
- .NET Foundation and Contributors
- .NET Foundation and Contributors
- true
- Apache-2.0 WITH LLVM-exception
- https://github.com/dotnet/clangsharp
- osx x64 native library for libclang.
- Copyright © LLVM Project
-
-
-
-
-
-
-
diff --git a/packages/libclang/libclang.runtime.win-arm64/libclang.runtime.win-arm64.nuspec b/packages/libclang/libclang.runtime.win-arm64/libclang.runtime.win-arm64.nuspec
index 2facf612..88e92023 100644
--- a/packages/libclang/libclang.runtime.win-arm64/libclang.runtime.win-arm64.nuspec
+++ b/packages/libclang/libclang.runtime.win-arm64/libclang.runtime.win-arm64.nuspec
@@ -2,7 +2,7 @@
libclang.runtime.win-arm64
- 18.1.3.1
+ 20.1.2
.NET Foundation and Contributors
.NET Foundation and Contributors
true
@@ -10,7 +10,7 @@
https://github.com/dotnet/clangsharp
win arm64 native library for libclang.
Copyright © LLVM Project
-
+
diff --git a/packages/libclang/libclang.runtime.win-x64/libclang.runtime.win-x64.nuspec b/packages/libclang/libclang.runtime.win-x64/libclang.runtime.win-x64.nuspec
index df20a858..a032f9d0 100644
--- a/packages/libclang/libclang.runtime.win-x64/libclang.runtime.win-x64.nuspec
+++ b/packages/libclang/libclang.runtime.win-x64/libclang.runtime.win-x64.nuspec
@@ -2,7 +2,7 @@
libclang.runtime.win-x64
- 18.1.3.2
+ 20.1.2
.NET Foundation and Contributors
.NET Foundation and Contributors
true
@@ -10,7 +10,7 @@
https://github.com/dotnet/clangsharp
win x64 native library for libclang.
Copyright © LLVM Project
-
+
diff --git a/packages/libclang/libclang/libclang.nuspec b/packages/libclang/libclang/libclang.nuspec
index 17113d9e..087f647d 100644
--- a/packages/libclang/libclang/libclang.nuspec
+++ b/packages/libclang/libclang/libclang.nuspec
@@ -2,7 +2,7 @@
libclang
- 18.1.3.2
+ 20.1.2
.NET Foundation and Contributors
.NET Foundation and Contributors
true
@@ -10,7 +10,7 @@
https://github.com/dotnet/clangsharp
Multi-platform native library for libclang.
Copyright © LLVM Project
-
+
diff --git a/packages/libclang/libclang/runtime.json b/packages/libclang/libclang/runtime.json
index 6ef3f32b..b4d12cee 100644
--- a/packages/libclang/libclang/runtime.json
+++ b/packages/libclang/libclang/runtime.json
@@ -2,32 +2,27 @@
"runtimes": {
"linux-arm64": {
"libclang": {
- "libclang.runtime.linux-arm64": "18.1.3.2"
+ "libclang.runtime.linux-arm64": "20.1.2"
}
},
"linux-x64": {
"libclang": {
- "libclang.runtime.linux-x64": "18.1.3.2"
+ "libclang.runtime.linux-x64": "20.1.2"
}
},
"osx-arm64": {
"libclang": {
- "libclang.runtime.osx-arm64": "18.1.3"
- }
- },
- "osx-x64": {
- "libclang": {
- "libclang.runtime.osx-x64": "18.1.3"
+ "libclang.runtime.osx-arm64": "20.1.2"
}
},
"win-arm64": {
"libclang": {
- "libclang.runtime.win-arm64": "18.1.3.1"
+ "libclang.runtime.win-arm64": "20.1.2"
}
},
"win-x64": {
"libclang": {
- "libclang.runtime.win-x64": "18.1.3.2"
+ "libclang.runtime.win-x64": "20.1.2"
}
}
}
diff --git a/scripts/build.ps1 b/scripts/build.ps1
index 5558ed50..89ae10f3 100644
--- a/scripts/build.ps1
+++ b/scripts/build.ps1
@@ -20,7 +20,7 @@ $ErrorActionPreference = "Stop"
function Build() {
$logFile = Join-Path -Path $LogDir -ChildPath "$configuration\build.binlog"
- & dotnet build -c "$configuration" --no-restore -v "$verbosity" /bl:"$logFile" /err "$properties" "$solution"
+ & dotnet build -c "$configuration" --no-restore -v "$verbosity" /bl:"$logFile" /err $properties "$solution"
if ($LastExitCode -ne 0) {
throw "'Build' failed for '$solution'"
@@ -56,8 +56,18 @@ function Help() {
}
function Pack() {
- $logFile = Join-Path -Path $LogDir -ChildPath "$configuration\pack.binlog"
- & dotnet pack -c "$configuration" --no-build --no-restore -v "$verbosity" /bl:"$logFile" /err "$properties" "$solution"
+ $logFile = Join-Path -Path $LogDir -ChildPath "$configuration\pack"
+
+ & dotnet pack -c "$configuration" --no-build --no-restore -v "$verbosity" /bl:"$logFile.binlog" /err $properties "$solution"
+ & dotnet pack -c "$configuration" --no-build --no-restore -v "$verbosity" /bl:"$logFile.agnostic.binlog" /err /p:SKIP_USE_CURRENT_RUNTIME=true $properties "$solution"
+
+ if ($ci) {
+ & dotnet pack -c "$configuration" --no-build --no-restore -v "$verbosity" /bl:"$logFile.preview.binlog" /err /p:PACKAGE_PUBLISH_MODE=preview $properties "$solution"
+ & dotnet pack -c "$configuration" --no-build --no-restore -v "$verbosity" /bl:"$logFile.stable.binlog" /err /p:PACKAGE_PUBLISH_MODE=stable $properties "$solution"
+
+ & dotnet pack -c "$configuration" --no-build --no-restore -v "$verbosity" /bl:"$logFile.agnostic.preview.binlog" /err /p:SKIP_USE_CURRENT_RUNTIME=true /p:PACKAGE_PUBLISH_MODE=preview $properties "$solution"
+ & dotnet pack -c "$configuration" --no-build --no-restore -v "$verbosity" /bl:"$logFile.agnostic.stable.binlog" /err /p:SKIP_USE_CURRENT_RUNTIME=true /p:PACKAGE_PUBLISH_MODE=stable $properties "$solution"
+ }
if ($LastExitCode -ne 0) {
throw "'Pack' failed for '$solution'"
@@ -66,7 +76,7 @@ function Pack() {
function Restore() {
$logFile = Join-Path -Path $LogDir -ChildPath "$configuration\restore.binlog"
- & dotnet restore -v "$verbosity" /bl:"$logFile" /err "$properties" "$solution"
+ & dotnet restore -v "$verbosity" /bl:"$logFile" /err $properties "$solution"
if ($LastExitCode -ne 0) {
throw "'Restore' failed for '$solution'"
@@ -75,7 +85,7 @@ function Restore() {
function Test() {
$logFile = Join-Path -Path $LogDir -ChildPath "$configuration\test.binlog"
- & dotnet test -c "$configuration" --no-build --no-restore -v "$verbosity" /bl:"$logFile" /err "$properties" "$solution"
+ & dotnet test -c "$configuration" --no-build --no-restore -v "$verbosity" /bl:"$logFile" /err $properties "$solution"
if ($LastExitCode -ne 0) {
throw "'Test' failed for '$solution'"
@@ -172,7 +182,7 @@ try {
$DotNetInstallDirectory = Join-Path -Path $ArtifactsDir -ChildPath "dotnet"
Create-Directory -Path $DotNetInstallDirectory
- & $DotNetInstallScript -Channel 8.0 -Version latest -InstallDir $DotNetInstallDirectory -Architecture $architecture
+ & $DotNetInstallScript -Channel 10.0 -Version latest -InstallDir $DotNetInstallDirectory -Architecture $architecture
$env:PATH="$DotNetInstallDirectory;$env:PATH"
}
diff --git a/scripts/build.sh b/scripts/build.sh
index c435695f..81d483ba 100755
--- a/scripts/build.sh
+++ b/scripts/build.sh
@@ -115,14 +115,32 @@ function Help {
}
function Pack {
- logFile="$LogDir/$configuration/pack.binlog"
+ logFile="$LogDir/$configuration/pack"
if [[ -z "$properties" ]]; then
- dotnet pack -c "$configuration" --no-build --no-restore -v "$verbosity" /bl:"$logFile" /err "$solution"
+ dotnet pack -c "$configuration" --no-build --no-restore -v "$verbosity" /bl:"$logFile.binlog" /err "$solution"
+ dotnet pack -c "$configuration" --no-build --no-restore -v "$verbosity" /bl:"$logFile.agnostic.binlog" /err /p:SKIP_USE_CURRENT_RUNTIME=true "$solution"
else
- dotnet pack -c "$configuration" --no-build --no-restore -v "$verbosity" /bl:"$logFile" /err "${properties[@]}" "$solution"
+ dotnet pack -c "$configuration" --no-build --no-restore -v "$verbosity" /bl:"$logFile.binlog" /err "${properties[@]}" "$solution"
+ dotnet pack -c "$configuration" --no-build --no-restore -v "$verbosity" /bl:"$logFile.agnostic.binlog" /err /p:SKIP_USE_CURRENT_RUNTIME=true "${properties[@]}" "$solution"
fi
+if $ci; then
+ if [[ -z "$properties" ]]; then
+ dotnet pack -c "$configuration" --no-build --no-restore -v "$verbosity" /bl:"$logFile.preview.binlog" /err /p:PACKAGE_PUBLISH_MODE=preview "$solution"
+ dotnet pack -c "$configuration" --no-build --no-restore -v "$verbosity" /bl:"$logFile.stable.binlog" /err /p:PACKAGE_PUBLISH_MODE=stable "$solution"
+
+ dotnet pack -c "$configuration" --no-build --no-restore -v "$verbosity" /bl:"$logFile.agnostic.preview.binlog" /err /p:SKIP_USE_CURRENT_RUNTIME=true /p:PACKAGE_PUBLISH_MODE=preview "$solution"
+ dotnet pack -c "$configuration" --no-build --no-restore -v "$verbosity" /bl:"$logFile.agnostic.stable.binlog" /err /p:SKIP_USE_CURRENT_RUNTIME=true /p:PACKAGE_PUBLISH_MODE=stable "$solution"
+ else
+ dotnet pack -c "$configuration" --no-build --no-restore -v "$verbosity" /bl:"$logFile.preview.binlog" /err /p:PACKAGE_PUBLISH_MODE=preview "${properties[@]}" "$solution"
+ dotnet pack -c "$configuration" --no-build --no-restore -v "$verbosity" /bl:"$logFile.stable.binlog" /err /p:PACKAGE_PUBLISH_MODE=stable "${properties[@]}" "$solution"
+
+ dotnet pack -c "$configuration" --no-build --no-restore -v "$verbosity" /bl:"$logFile.agnostic.preview.binlog" /err /p:SKIP_USE_CURRENT_RUNTIME=true /p:PACKAGE_PUBLISH_MODE=preview "${properties[@]}" "$solution"
+ dotnet pack -c "$configuration" --no-build --no-restore -v "$verbosity" /bl:"$logFile.agnostic.stable.binlog" /err /p:SKIP_USE_CURRENT_RUNTIME=true /p:PACKAGE_PUBLISH_MODE=stable "${properties[@]}" "$solution"
+ fi
+fi
+
LASTEXITCODE=$?
if [ "$LASTEXITCODE" != 0 ]; then
@@ -204,7 +222,7 @@ if [[ ! -z "$architecture" ]]; then
DotNetInstallDirectory="$ArtifactsDir/dotnet"
CreateDirectory "$DotNetInstallDirectory"
- . "$DotNetInstallScript" --channel 8.0 --version latest --install-dir "$DotNetInstallDirectory" --architecture "$architecture"
+ . "$DotNetInstallScript" --channel 10.0 --version latest --install-dir "$DotNetInstallDirectory" --architecture "$architecture"
PATH="$DotNetInstallDirectory:$PATH:"
fi
diff --git a/sources/ClangSharp.Interop/ClangSharp.Interop.csproj b/sources/ClangSharp.Interop/ClangSharp.Interop.csproj
index 0e1fe8a1..dd01281b 100644
--- a/sources/ClangSharp.Interop/ClangSharp.Interop.csproj
+++ b/sources/ClangSharp.Interop/ClangSharp.Interop.csproj
@@ -2,7 +2,7 @@
- net8.0
+ net10.0
diff --git a/sources/ClangSharp.Interop/Extensions/CXCursor.cs b/sources/ClangSharp.Interop/Extensions/CXCursor.cs
index 11963608..0cccb0b3 100644
--- a/sources/ClangSharp.Interop/Extensions/CXCursor.cs
+++ b/sources/ClangSharp.Interop/Extensions/CXCursor.cs
@@ -37,7 +37,7 @@ public readonly string AttrKindSpelling
Debug.Assert(CX_AttrKind_FirstTypeAttr == CX_AttrKind_AddressSpace);
Debug.Assert(CX_AttrKind_LastTypeAttr == CX_AttrKind_WebAssemblyFuncref);
- Debug.Assert(CX_AttrKind_FirstStmtAttr == CX_AttrKind_CodeAlign);
+ Debug.Assert(CX_AttrKind_FirstStmtAttr == CX_AttrKind_CXXAssume);
Debug.Assert(CX_AttrKind_LastStmtAttr == CX_AttrKind_Unlikely);
Debug.Assert(CX_AttrKind_FirstDeclOrStmtAttr == CX_AttrKind_AlwaysInline);
@@ -49,19 +49,21 @@ public readonly string AttrKindSpelling
Debug.Assert(CX_AttrKind_FirstDeclOrTypeAttr == CX_AttrKind_AArch64SVEPcs);
Debug.Assert(CX_AttrKind_LastDeclOrTypeAttr == CX_AttrKind_VectorCall);
- Debug.Assert(CX_AttrKind_FirstInheritableParamAttr == CX_AttrKind_SwiftAsyncContext);
+ Debug.Assert(CX_AttrKind_FirstInheritableParamAttr == CX_AttrKind_Annotate);
Debug.Assert(CX_AttrKind_LastInheritableParamAttr == CX_AttrKind_UseHandle);
- Debug.Assert(CX_AttrKind_FirstParameterABIAttr == CX_AttrKind_SwiftAsyncContext);
+ Debug.Assert(CX_AttrKind_FirstParameterABIAttr == CX_AttrKind_HLSLParamModifier);
Debug.Assert(CX_AttrKind_LastParameterABIAttr == CX_AttrKind_SwiftIndirectResult);
- Debug.Assert(CX_AttrKind_FirstHLSLAnnotationAttr == CX_AttrKind_HLSLSV_DispatchThreadID);
- Debug.Assert(CX_AttrKind_LastHLSLAnnotationAttr == CX_AttrKind_HLSLSV_GroupIndex);
+ Debug.Assert(CX_AttrKind_FirstHLSLAnnotationAttr == CX_AttrKind_HLSLPackOffset);
+ Debug.Assert(CX_AttrKind_LastHLSLAnnotationAttr == CX_AttrKind_HLSLSV_GroupThreadID);
return AttrKind switch {
CX_AttrKind_Invalid => "Invalid",
CX_AttrKind_AddressSpace => "AddressSpace",
+ CX_AttrKind_Allocating => "Allocating",
CX_AttrKind_AnnotateType => "AnnotateType",
+ CX_AttrKind_ArmAgnostic => "ArmAgnostic",
CX_AttrKind_ArmIn => "ArmIn",
CX_AttrKind_ArmInOut => "ArmInOut",
CX_AttrKind_ArmMveStrictPolymorphism => "ArmMveStrictPolymorphism",
@@ -70,10 +72,16 @@ public readonly string AttrKindSpelling
CX_AttrKind_ArmStreaming => "ArmStreaming",
CX_AttrKind_ArmStreamingCompatible => "ArmStreamingCompatible",
CX_AttrKind_BTFTypeTag => "BTFTypeTag",
+ CX_AttrKind_Blocking => "Blocking",
CX_AttrKind_CmseNSCall => "CmseNSCall",
+ CX_AttrKind_HLSLContainedType => "HLSLContainedType",
CX_AttrKind_HLSLGroupSharedAddressSpace => "HLSLGroupSharedAddressSpace",
- CX_AttrKind_HLSLParamModifier => "HLSLParamModifier",
+ CX_AttrKind_HLSLROV => "HLSLROV",
+ CX_AttrKind_HLSLRawBuffer => "HLSLRawBuffer",
+ CX_AttrKind_HLSLResourceClass => "HLSLResourceClass",
CX_AttrKind_NoDeref => "NoDeref",
+ CX_AttrKind_NonAllocating => "NonAllocating",
+ CX_AttrKind_NonBlocking => "NonBlocking",
CX_AttrKind_ObjCGC => "ObjCGC",
CX_AttrKind_ObjCInertUnsafeUnretained => "ObjCInertUnsafeUnretained",
CX_AttrKind_ObjCKindOf => "ObjCKindOf",
@@ -89,12 +97,14 @@ public readonly string AttrKindSpelling
CX_AttrKind_SPtr => "SPtr",
CX_AttrKind_TypeNonNull => "TypeNonNull",
CX_AttrKind_TypeNullUnspecified => "TypeNullUnspecified",
- CX_AttrKind_TypeNullable => "TypeNullable",
CX_AttrKind_TypeNullableResult => "TypeNullableResult",
CX_AttrKind_UPtr => "UPtr",
CX_AttrKind_WebAssemblyFuncref => "WebAssemblyFuncref",
+ CX_AttrKind_CXXAssume => "CXXAssume",
CX_AttrKind_CodeAlign => "CodeAlign",
CX_AttrKind_FallThrough => "FallThrough",
+ CX_AttrKind_HLSLControlFlowHint => "HLSLControlFlowHint",
+ CX_AttrKind_HLSLLoopHint => "HLSLLoopHint",
CX_AttrKind_Likely => "Likely",
CX_AttrKind_MustTail => "MustTail",
CX_AttrKind_OpenCLUnrollHint => "OpenCLUnrollHint",
@@ -109,9 +119,12 @@ public readonly string AttrKindSpelling
CX_AttrKind_AcquireHandle => "AcquireHandle",
CX_AttrKind_AnyX86NoCfCheck => "AnyX86NoCfCheck",
CX_AttrKind_CDecl => "CDecl",
+ CX_AttrKind_CountedBy => "CountedBy",
+ CX_AttrKind_CountedByOrNull => "CountedByOrNull",
CX_AttrKind_FastCall => "FastCall",
CX_AttrKind_IntelOclBicc => "IntelOclBicc",
CX_AttrKind_LifetimeBound => "LifetimeBound",
+ CX_AttrKind_LifetimeCaptureBy => "LifetimeCaptureBy",
CX_AttrKind_M68kRTD => "M68kRTD",
CX_AttrKind_MSABI => "MSABI",
CX_AttrKind_NSReturnsRetained => "NSReturnsRetained",
@@ -120,18 +133,25 @@ public readonly string AttrKindSpelling
CX_AttrKind_Pcs => "Pcs",
CX_AttrKind_PreserveAll => "PreserveAll",
CX_AttrKind_PreserveMost => "PreserveMost",
+ CX_AttrKind_PreserveNone => "PreserveNone",
+ CX_AttrKind_RISCVVectorCC => "RISCVVectorCC",
CX_AttrKind_RegCall => "RegCall",
+ CX_AttrKind_SizedBy => "SizedBy",
+ CX_AttrKind_SizedByOrNull => "SizedByOrNull",
CX_AttrKind_StdCall => "StdCall",
CX_AttrKind_SwiftAsyncCall => "SwiftAsyncCall",
+ CX_AttrKind_SwiftAttr => "SwiftAttr",
CX_AttrKind_SwiftCall => "SwiftCall",
CX_AttrKind_SysVABI => "SysVABI",
CX_AttrKind_ThisCall => "ThisCall",
+ CX_AttrKind_TypeNullable => "TypeNullable",
CX_AttrKind_VectorCall => "VectorCall",
+ CX_AttrKind_Annotate => "Annotate",
+ CX_AttrKind_HLSLParamModifier => "HLSLParamModifier",
CX_AttrKind_SwiftAsyncContext => "SwiftAsyncContext",
CX_AttrKind_SwiftContext => "SwiftContext",
CX_AttrKind_SwiftErrorResult => "SwiftErrorResult",
CX_AttrKind_SwiftIndirectResult => "SwiftIndirectResult",
- CX_AttrKind_Annotate => "Annotate",
CX_AttrKind_CFConsumed => "CFConsumed",
CX_AttrKind_CarriesDependency => "CarriesDependency",
CX_AttrKind_NSConsumed => "NSConsumed",
@@ -140,9 +160,13 @@ public readonly string AttrKindSpelling
CX_AttrKind_PassObjectSize => "PassObjectSize",
CX_AttrKind_ReleaseHandle => "ReleaseHandle",
CX_AttrKind_UseHandle => "UseHandle",
+ CX_AttrKind_HLSLPackOffset => "HLSLPackOffset",
CX_AttrKind_HLSLSV_DispatchThreadID => "HLSLSV_DispatchThreadID",
+ CX_AttrKind_HLSLSV_GroupID => "HLSLSV_GroupID",
CX_AttrKind_HLSLSV_GroupIndex => "HLSLSV_GroupIndex",
+ CX_AttrKind_HLSLSV_GroupThreadID => "HLSLSV_GroupThreadID",
CX_AttrKind_AMDGPUFlatWorkGroupSize => "AMDGPUFlatWorkGroupSize",
+ CX_AttrKind_AMDGPUMaxNumWorkGroups => "AMDGPUMaxNumWorkGroups",
CX_AttrKind_AMDGPUNumSGPR => "AMDGPUNumSGPR",
CX_AttrKind_AMDGPUNumVGPR => "AMDGPUNumVGPR",
CX_AttrKind_AMDGPUWavesPerEU => "AMDGPUWavesPerEU",
@@ -172,9 +196,9 @@ public readonly string AttrKindSpelling
CX_AttrKind_AssertExclusiveLock => "AssertExclusiveLock",
CX_AttrKind_AssertSharedLock => "AssertSharedLock",
CX_AttrKind_AssumeAligned => "AssumeAligned",
- CX_AttrKind_Assumption => "Assumption",
CX_AttrKind_Availability => "Availability",
CX_AttrKind_AvailableOnlyInDefaultEvalMethod => "AvailableOnlyInDefaultEvalMethod",
+ CX_AttrKind_BPFFastCall => "BPFFastCall",
CX_AttrKind_BPFPreserveAccessIndex => "BPFPreserveAccessIndex",
CX_AttrKind_BPFPreserveStaticOffset => "BPFPreserveStaticOffset",
CX_AttrKind_BTFDeclTag => "BTFDeclTag",
@@ -194,6 +218,7 @@ public readonly string AttrKindSpelling
CX_AttrKind_CUDADeviceBuiltinSurfaceType => "CUDADeviceBuiltinSurfaceType",
CX_AttrKind_CUDADeviceBuiltinTextureType => "CUDADeviceBuiltinTextureType",
CX_AttrKind_CUDAGlobal => "CUDAGlobal",
+ CX_AttrKind_CUDAGridConstant => "CUDAGridConstant",
CX_AttrKind_CUDAHost => "CUDAHost",
CX_AttrKind_CUDAInvalidTarget => "CUDAInvalidTarget",
CX_AttrKind_CUDALaunchBounds => "CUDALaunchBounds",
@@ -204,6 +229,7 @@ public readonly string AttrKindSpelling
CX_AttrKind_Capability => "Capability",
CX_AttrKind_CapturedRecord => "CapturedRecord",
CX_AttrKind_Cleanup => "Cleanup",
+ CX_AttrKind_ClspvLibclcBuiltin => "ClspvLibclcBuiltin",
CX_AttrKind_CmseNSEntry => "CmseNSEntry",
CX_AttrKind_CodeModel => "CodeModel",
CX_AttrKind_CodeSeg => "CodeSeg",
@@ -216,12 +242,13 @@ public readonly string AttrKindSpelling
CX_AttrKind_ConsumableAutoCast => "ConsumableAutoCast",
CX_AttrKind_ConsumableSetOnRead => "ConsumableSetOnRead",
CX_AttrKind_Convergent => "Convergent",
+ CX_AttrKind_CoroAwaitElidable => "CoroAwaitElidable",
+ CX_AttrKind_CoroAwaitElidableArgument => "CoroAwaitElidableArgument",
CX_AttrKind_CoroDisableLifetimeBound => "CoroDisableLifetimeBound",
CX_AttrKind_CoroLifetimeBound => "CoroLifetimeBound",
CX_AttrKind_CoroOnlyDestroyWhenComplete => "CoroOnlyDestroyWhenComplete",
CX_AttrKind_CoroReturnType => "CoroReturnType",
CX_AttrKind_CoroWrapper => "CoroWrapper",
- CX_AttrKind_CountedBy => "CountedBy",
CX_AttrKind_DLLExport => "DLLExport",
CX_AttrKind_DLLExportStaticLocal => "DLLExportStaticLocal",
CX_AttrKind_DLLImport => "DLLImport",
@@ -240,6 +267,7 @@ public readonly string AttrKindSpelling
CX_AttrKind_Error => "Error",
CX_AttrKind_ExcludeFromExplicitInstantiation => "ExcludeFromExplicitInstantiation",
CX_AttrKind_ExclusiveTrylockFunction => "ExclusiveTrylockFunction",
+ CX_AttrKind_ExplicitInit => "ExplicitInit",
CX_AttrKind_ExternalSourceSymbol => "ExternalSourceSymbol",
CX_AttrKind_Final => "Final",
CX_AttrKind_FlagEnum => "FlagEnum",
@@ -255,7 +283,9 @@ public readonly string AttrKindSpelling
CX_AttrKind_HLSLResource => "HLSLResource",
CX_AttrKind_HLSLResourceBinding => "HLSLResourceBinding",
CX_AttrKind_HLSLShader => "HLSLShader",
+ CX_AttrKind_HLSLWaveSize => "HLSLWaveSize",
CX_AttrKind_Hot => "Hot",
+ CX_AttrKind_HybridPatchable => "HybridPatchable",
CX_AttrKind_IBAction => "IBAction",
CX_AttrKind_IBOutlet => "IBOutlet",
CX_AttrKind_IBOutletCollection => "IBOutletCollection",
@@ -293,6 +323,7 @@ public readonly string AttrKindSpelling
CX_AttrKind_Naked => "Naked",
CX_AttrKind_NoAlias => "NoAlias",
CX_AttrKind_NoCommon => "NoCommon",
+ CX_AttrKind_NoConvergent => "NoConvergent",
CX_AttrKind_NoDebug => "NoDebug",
CX_AttrKind_NoDestroy => "NoDestroy",
CX_AttrKind_NoDuplicate => "NoDuplicate",
@@ -303,15 +334,18 @@ public readonly string AttrKindSpelling
CX_AttrKind_NoRandomizeLayout => "NoRandomizeLayout",
CX_AttrKind_NoReturn => "NoReturn",
CX_AttrKind_NoSanitize => "NoSanitize",
+ CX_AttrKind_NoSpecializations => "NoSpecializations",
CX_AttrKind_NoSpeculativeLoadHardening => "NoSpeculativeLoadHardening",
CX_AttrKind_NoSplitStack => "NoSplitStack",
CX_AttrKind_NoStackProtector => "NoStackProtector",
CX_AttrKind_NoThreadSafetyAnalysis => "NoThreadSafetyAnalysis",
CX_AttrKind_NoThrow => "NoThrow",
+ CX_AttrKind_NoTrivialAutoVarInit => "NoTrivialAutoVarInit",
CX_AttrKind_NoUniqueAddress => "NoUniqueAddress",
CX_AttrKind_NoUwtable => "NoUwtable",
CX_AttrKind_NotTailCalled => "NotTailCalled",
CX_AttrKind_OMPAllocateDecl => "OMPAllocateDecl",
+ CX_AttrKind_OMPAssume => "OMPAssume",
CX_AttrKind_OMPCaptureNoInit => "OMPCaptureNoInit",
CX_AttrKind_OMPDeclareTargetDecl => "OMPDeclareTargetDecl",
CX_AttrKind_OMPDeclareVariant => "OMPDeclareVariant",
@@ -369,6 +403,7 @@ public readonly string AttrKindSpelling
CX_AttrKind_ReturnsNonNull => "ReturnsNonNull",
CX_AttrKind_ReturnsTwice => "ReturnsTwice",
CX_AttrKind_SYCLKernel => "SYCLKernel",
+ CX_AttrKind_SYCLKernelEntryPoint => "SYCLKernelEntryPoint",
CX_AttrKind_SYCLSpecialClass => "SYCLSpecialClass",
CX_AttrKind_ScopedLockable => "ScopedLockable",
CX_AttrKind_Section => "Section",
@@ -383,7 +418,6 @@ public readonly string AttrKindSpelling
CX_AttrKind_SwiftAsync => "SwiftAsync",
CX_AttrKind_SwiftAsyncError => "SwiftAsyncError",
CX_AttrKind_SwiftAsyncName => "SwiftAsyncName",
- CX_AttrKind_SwiftAttr => "SwiftAttr",
CX_AttrKind_SwiftBridge => "SwiftBridge",
CX_AttrKind_SwiftBridgedTypedef => "SwiftBridgedTypedef",
CX_AttrKind_SwiftError => "SwiftError",
@@ -409,6 +443,7 @@ public readonly string AttrKindSpelling
CX_AttrKind_Used => "Used",
CX_AttrKind_UsingIfExists => "UsingIfExists",
CX_AttrKind_Uuid => "Uuid",
+ CX_AttrKind_VTablePointerAuthentication => "VTablePointerAuthentication",
CX_AttrKind_VecReturn => "VecReturn",
CX_AttrKind_VecTypeHint => "VecTypeHint",
CX_AttrKind_Visibility => "Visibility",
@@ -451,7 +486,6 @@ public readonly string AttrKindSpelling
CX_AttrKind_ObjCRuntimeVisible => "ObjCRuntimeVisible",
CX_AttrKind_OpenCLAccess => "OpenCLAccess",
CX_AttrKind_Overloadable => "Overloadable",
- CX_AttrKind_RenderScriptKernel => "RenderScriptKernel",
CX_AttrKind_SwiftObjCMembers => "SwiftObjCMembers",
CX_AttrKind_SwiftVersionedAddition => "SwiftVersionedAddition",
CX_AttrKind_SwiftVersionedRemoval => "SwiftVersionedRemoval",
@@ -1319,7 +1353,7 @@ public readonly string StmtClassSpelling
Debug.Assert(CX_StmtClass_LastSwitchCase == CX_StmtClass_CaseStmt);
Debug.Assert(CX_StmtClass_FirstOMPLoopTransformationDirective == CX_StmtClass_OMPUnrollDirective);
- Debug.Assert(CX_StmtClass_LastOMPLoopTransformationDirective == CX_StmtClass_OMPTileDirective);
+ Debug.Assert(CX_StmtClass_LastOMPLoopTransformationDirective == CX_StmtClass_OMPInterchangeDirective);
Debug.Assert(CX_StmtClass_FirstOMPLoopDirective == CX_StmtClass_OMPTeamsGenericLoopDirective);
Debug.Assert(CX_StmtClass_LastOMPLoopDirective == CX_StmtClass_OMPDistributeDirective);
@@ -1328,7 +1362,7 @@ public readonly string StmtClassSpelling
Debug.Assert(CX_StmtClass_LastOMPLoopBasedDirective == CX_StmtClass_OMPDistributeDirective);
Debug.Assert(CX_StmtClass_FirstOMPExecutableDirective == CX_StmtClass_OMPTeamsDirective);
- Debug.Assert(CX_StmtClass_LastOMPExecutableDirective == CX_StmtClass_OMPAtomicDirective);
+ Debug.Assert(CX_StmtClass_LastOMPExecutableDirective == CX_StmtClass_OMPAssumeDirective);
Debug.Assert(CX_StmtClass_FirstAsmStmt == CX_StmtClass_MSAsmStmt);
Debug.Assert(CX_StmtClass_LastAsmStmt == CX_StmtClass_GCCAsmStmt);
@@ -1381,7 +1415,7 @@ public readonly string StmtClassSpelling
CX_StmtClass_ObjCArrayLiteral => "ObjCArrayLiteral",
CX_StmtClass_OMPIteratorExpr => "OMPIteratorExpr",
CX_StmtClass_OMPArrayShapingExpr => "OMPArrayShapingExpr",
- CX_StmtClass_OMPArraySectionExpr => "OMPArraySectionExpr",
+ CX_StmtClass_ArraySectionExpr => "ArraySectionExpr",
CX_StmtClass_NoInitExpr => "NoInitExpr",
CX_StmtClass_MemberExpr => "MemberExpr",
CX_StmtClass_MatrixSubscriptExpr => "MatrixSubscriptExpr",
@@ -1439,6 +1473,7 @@ public readonly string StmtClassSpelling
CX_StmtClass_CXXRewrittenBinaryOperator => "CXXRewrittenBinaryOperator",
CX_StmtClass_CXXPseudoDestructorExpr => "CXXPseudoDestructorExpr",
CX_StmtClass_CXXParenListInitExpr => "CXXParenListInitExpr",
+ CX_StmtClass_PackIndexingExpr => "PackIndexingExpr",
CX_StmtClass_CXXNullPtrLiteralExpr => "CXXNullPtrLiteralExpr",
CX_StmtClass_CXXNoexceptExpr => "CXXNoexceptExpr",
CX_StmtClass_CXXNewExpr => "CXXNewExpr",
diff --git a/sources/ClangSharp.Interop/Extensions/CXUnsavedFile.cs b/sources/ClangSharp.Interop/Extensions/CXUnsavedFile.cs
index 3f61354a..cf2bce27 100644
--- a/sources/ClangSharp.Interop/Extensions/CXUnsavedFile.cs
+++ b/sources/ClangSharp.Interop/Extensions/CXUnsavedFile.cs
@@ -46,6 +46,41 @@ public static CXUnsavedFile Create(string filename, string contents)
};
}
+ public static CXUnsavedFile Create(string filename, CXTranslationUnit translationUnit, CXFile baseFile, string additionalContents)
+ {
+ sbyte* pFilename, pContents;
+ nuint contentsLength;
+
+ if (string.IsNullOrEmpty(filename))
+ {
+ pFilename = null;
+ }
+ else
+ {
+ var maxFilenameLength = Encoding.UTF8.GetMaxByteCount(filename.Length);
+ pFilename = (sbyte*)NativeMemory.Alloc((uint)maxFilenameLength + 1);
+ var filenameLength = (uint)Encoding.UTF8.GetBytes(filename, new Span(pFilename, maxFilenameLength));
+ pFilename[filenameLength] = 0;
+ }
+
+ var baseFileContents = translationUnit.GetFileContents(baseFile, out _);
+ var maxContentsLength = baseFileContents.Length + Encoding.UTF8.GetMaxByteCount((additionalContents?.Length).GetValueOrDefault());
+
+ pContents = (sbyte*)NativeMemory.Alloc((uint)maxContentsLength + 1);
+
+ var contents = new Span(pContents, maxContentsLength);
+ baseFileContents.CopyTo(contents);
+
+ contentsLength = (uint)(baseFileContents.Length + Encoding.UTF8.GetBytes(additionalContents, contents[baseFileContents.Length..]));
+ pContents[contentsLength] = 0;
+
+ return new CXUnsavedFile() {
+ Filename = pFilename,
+ Contents = pContents,
+ Length = contentsLength
+ };
+ }
+
public void Dispose()
{
if (Filename != null)
diff --git a/sources/ClangSharp.Interop/Manual/CXAPISetImpl.cs b/sources/ClangSharp.Interop/Manual/CXAPISetImpl.cs
index 3a31c17d..612f51cd 100644
--- a/sources/ClangSharp.Interop/Manual/CXAPISetImpl.cs
+++ b/sources/ClangSharp.Interop/Manual/CXAPISetImpl.cs
@@ -1,6 +1,6 @@
// Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
-// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-18.1.3/clang/include/clang-c
+// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-20.1.2/clang/include/clang-c
// Original source is Copyright (c) the LLVM Project and Contributors. Licensed under the Apache License v2.0 with LLVM Exceptions. See NOTICE.txt in the project root for license information.
namespace ClangSharp.Interop;
diff --git a/sources/ClangSharp.Interop/Manual/CXCursorSetImpl.cs b/sources/ClangSharp.Interop/Manual/CXCursorSetImpl.cs
index 13ee87e4..11d42ea3 100644
--- a/sources/ClangSharp.Interop/Manual/CXCursorSetImpl.cs
+++ b/sources/ClangSharp.Interop/Manual/CXCursorSetImpl.cs
@@ -1,6 +1,6 @@
// Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
-// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-18.1.3/clang/include/clang-c
+// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-20.1.2/clang/include/clang-c
// Original source is Copyright (c) the LLVM Project and Contributors. Licensed under the Apache License v2.0 with LLVM Exceptions. See NOTICE.txt in the project root for license information.
namespace ClangSharp.Interop;
diff --git a/sources/ClangSharp.Interop/Manual/CXCursorVisitor.cs b/sources/ClangSharp.Interop/Manual/CXCursorVisitor.cs
index e4a1aeda..84a4ebed 100644
--- a/sources/ClangSharp.Interop/Manual/CXCursorVisitor.cs
+++ b/sources/ClangSharp.Interop/Manual/CXCursorVisitor.cs
@@ -1,6 +1,6 @@
// Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
-// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-18.1.3/clang/include/clang-c
+// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-20.1.2/clang/include/clang-c
// Original source is Copyright (c) the LLVM Project and Contributors. Licensed under the Apache License v2.0 with LLVM Exceptions. See NOTICE.txt in the project root for license information.
using System.Runtime.InteropServices;
diff --git a/sources/ClangSharp.Interop/Manual/CXFieldVisitor.cs b/sources/ClangSharp.Interop/Manual/CXFieldVisitor.cs
index bf4f22de..8806d8a2 100644
--- a/sources/ClangSharp.Interop/Manual/CXFieldVisitor.cs
+++ b/sources/ClangSharp.Interop/Manual/CXFieldVisitor.cs
@@ -1,6 +1,6 @@
// Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
-// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-18.1.3/clang/include/clang-c
+// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-20.1.2/clang/include/clang-c
// Original source is Copyright (c) the LLVM Project and Contributors. Licensed under the Apache License v2.0 with LLVM Exceptions. See NOTICE.txt in the project root for license information.
using System.Runtime.InteropServices;
diff --git a/sources/ClangSharp.Interop/Manual/CXInclusionVisitor.cs b/sources/ClangSharp.Interop/Manual/CXInclusionVisitor.cs
index 318e7588..6c2a355b 100644
--- a/sources/ClangSharp.Interop/Manual/CXInclusionVisitor.cs
+++ b/sources/ClangSharp.Interop/Manual/CXInclusionVisitor.cs
@@ -1,6 +1,6 @@
// Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
-// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-18.1.3/clang/include/clang-c
+// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-20.1.2/clang/include/clang-c
// Original source is Copyright (c) the LLVM Project and Contributors. Licensed under the Apache License v2.0 with LLVM Exceptions. See NOTICE.txt in the project root for license information.
using System.Runtime.InteropServices;
diff --git a/sources/ClangSharp.Interop/Manual/CXModuleMapDescriptorImpl.cs b/sources/ClangSharp.Interop/Manual/CXModuleMapDescriptorImpl.cs
index 398c18c0..bb24b593 100644
--- a/sources/ClangSharp.Interop/Manual/CXModuleMapDescriptorImpl.cs
+++ b/sources/ClangSharp.Interop/Manual/CXModuleMapDescriptorImpl.cs
@@ -1,6 +1,6 @@
// Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
-// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-18.1.3/clang/include/clang-c
+// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-20.1.2/clang/include/clang-c
// Original source is Copyright (c) the LLVM Project and Contributors. Licensed under the Apache License v2.0 with LLVM Exceptions. See NOTICE.txt in the project root for license information.
namespace ClangSharp.Interop;
diff --git a/sources/ClangSharp.Interop/Manual/CXTargetInfoImpl.cs b/sources/ClangSharp.Interop/Manual/CXTargetInfoImpl.cs
index 68102601..27af3182 100644
--- a/sources/ClangSharp.Interop/Manual/CXTargetInfoImpl.cs
+++ b/sources/ClangSharp.Interop/Manual/CXTargetInfoImpl.cs
@@ -1,6 +1,6 @@
// Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
-// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-18.1.3/clang/include/clang-c
+// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-20.1.2/clang/include/clang-c
// Original source is Copyright (c) the LLVM Project and Contributors. Licensed under the Apache License v2.0 with LLVM Exceptions. See NOTICE.txt in the project root for license information.
namespace ClangSharp.Interop;
diff --git a/sources/ClangSharp.Interop/Manual/CXTranslationUnitImpl.cs b/sources/ClangSharp.Interop/Manual/CXTranslationUnitImpl.cs
index fe344762..b1f182a8 100644
--- a/sources/ClangSharp.Interop/Manual/CXTranslationUnitImpl.cs
+++ b/sources/ClangSharp.Interop/Manual/CXTranslationUnitImpl.cs
@@ -1,6 +1,6 @@
// Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
-// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-18.1.3/clang/include/clang-c
+// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-20.1.2/clang/include/clang-c
// Original source is Copyright (c) the LLVM Project and Contributors. Licensed under the Apache License v2.0 with LLVM Exceptions. See NOTICE.txt in the project root for license information.
namespace ClangSharp.Interop;
diff --git a/sources/ClangSharp.Interop/Manual/CXVirtualFileOverlayImpl.cs b/sources/ClangSharp.Interop/Manual/CXVirtualFileOverlayImpl.cs
index 49e9b937..063f079c 100644
--- a/sources/ClangSharp.Interop/Manual/CXVirtualFileOverlayImpl.cs
+++ b/sources/ClangSharp.Interop/Manual/CXVirtualFileOverlayImpl.cs
@@ -1,6 +1,6 @@
// Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
-// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-18.1.3/clang/include/clang-c
+// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-20.1.2/clang/include/clang-c
// Original source is Copyright (c) the LLVM Project and Contributors. Licensed under the Apache License v2.0 with LLVM Exceptions. See NOTICE.txt in the project root for license information.
namespace ClangSharp.Interop;
diff --git a/sources/ClangSharp.Interop/clang.cs b/sources/ClangSharp.Interop/clang.cs
index b6546231..037ab5b1 100644
--- a/sources/ClangSharp.Interop/clang.cs
+++ b/sources/ClangSharp.Interop/clang.cs
@@ -41,8 +41,8 @@ private static bool TryResolveClang(Assembly assembly, DllImportSearchPath? sear
{
if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
{
- return NativeLibrary.TryLoad("libclang.so.18", assembly, searchPath, out nativeLibrary)
- || NativeLibrary.TryLoad("libclang-18", assembly, searchPath, out nativeLibrary)
+ return NativeLibrary.TryLoad("libclang.so.20", assembly, searchPath, out nativeLibrary)
+ || NativeLibrary.TryLoad("libclang-20", assembly, searchPath, out nativeLibrary)
|| NativeLibrary.TryLoad("libclang.so.1", assembly, searchPath, out nativeLibrary);
}
diff --git a/sources/ClangSharp.Interop/clang/CXAvailabilityKind.cs b/sources/ClangSharp.Interop/clang/CXAvailabilityKind.cs
index 8957cf6e..d12d154d 100644
--- a/sources/ClangSharp.Interop/clang/CXAvailabilityKind.cs
+++ b/sources/ClangSharp.Interop/clang/CXAvailabilityKind.cs
@@ -1,6 +1,6 @@
// Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
-// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-18.1.3/clang/include/clang-c
+// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-20.1.2/clang/include/clang-c
// Original source is Copyright (c) the LLVM Project and Contributors. Licensed under the Apache License v2.0 with LLVM Exceptions. See NOTICE.txt in the project root for license information.
namespace ClangSharp.Interop;
diff --git a/sources/ClangSharp.Interop/clang/CXBinaryOperatorKind.cs b/sources/ClangSharp.Interop/clang/CXBinaryOperatorKind.cs
index 6b49fc03..9a82a8a7 100644
--- a/sources/ClangSharp.Interop/clang/CXBinaryOperatorKind.cs
+++ b/sources/ClangSharp.Interop/clang/CXBinaryOperatorKind.cs
@@ -1,6 +1,6 @@
// Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
-// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-18.1.3/clang/include/clang-c
+// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-20.1.2/clang/include/clang-c
// Original source is Copyright (c) the LLVM Project and Contributors. Licensed under the Apache License v2.0 with LLVM Exceptions. See NOTICE.txt in the project root for license information.
namespace ClangSharp.Interop;
diff --git a/sources/ClangSharp.Interop/clang/CXCallingConv.cs b/sources/ClangSharp.Interop/clang/CXCallingConv.cs
index c54eb79f..363b8de9 100644
--- a/sources/ClangSharp.Interop/clang/CXCallingConv.cs
+++ b/sources/ClangSharp.Interop/clang/CXCallingConv.cs
@@ -1,6 +1,6 @@
// Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
-// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-18.1.3/clang/include/clang-c
+// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-20.1.2/clang/include/clang-c
// Original source is Copyright (c) the LLVM Project and Contributors. Licensed under the Apache License v2.0 with LLVM Exceptions. See NOTICE.txt in the project root for license information.
namespace ClangSharp.Interop;
@@ -28,6 +28,8 @@ public enum CXCallingConv
CXCallingConv_SwiftAsync = 17,
CXCallingConv_AArch64SVEPCS = 18,
CXCallingConv_M68kRTD = 19,
+ CXCallingConv_PreserveNone = 20,
+ CXCallingConv_RISCVVectorCall = 21,
CXCallingConv_Invalid = 100,
CXCallingConv_Unexposed = 200,
}
diff --git a/sources/ClangSharp.Interop/clang/CXChildVisitResult.cs b/sources/ClangSharp.Interop/clang/CXChildVisitResult.cs
index 703f2628..fec57984 100644
--- a/sources/ClangSharp.Interop/clang/CXChildVisitResult.cs
+++ b/sources/ClangSharp.Interop/clang/CXChildVisitResult.cs
@@ -1,6 +1,6 @@
// Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
-// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-18.1.3/clang/include/clang-c
+// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-20.1.2/clang/include/clang-c
// Original source is Copyright (c) the LLVM Project and Contributors. Licensed under the Apache License v2.0 with LLVM Exceptions. See NOTICE.txt in the project root for license information.
namespace ClangSharp.Interop;
diff --git a/sources/ClangSharp.Interop/clang/CXChoice.cs b/sources/ClangSharp.Interop/clang/CXChoice.cs
index 4b1f9269..92214e7b 100644
--- a/sources/ClangSharp.Interop/clang/CXChoice.cs
+++ b/sources/ClangSharp.Interop/clang/CXChoice.cs
@@ -1,6 +1,6 @@
// Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
-// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-18.1.3/clang/include/clang-c
+// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-20.1.2/clang/include/clang-c
// Original source is Copyright (c) the LLVM Project and Contributors. Licensed under the Apache License v2.0 with LLVM Exceptions. See NOTICE.txt in the project root for license information.
namespace ClangSharp.Interop;
diff --git a/sources/ClangSharp.Interop/clang/CXCodeCompleteResults.cs b/sources/ClangSharp.Interop/clang/CXCodeCompleteResults.cs
index db791bf3..2182d5dd 100644
--- a/sources/ClangSharp.Interop/clang/CXCodeCompleteResults.cs
+++ b/sources/ClangSharp.Interop/clang/CXCodeCompleteResults.cs
@@ -1,6 +1,6 @@
// Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
-// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-18.1.3/clang/include/clang-c
+// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-20.1.2/clang/include/clang-c
// Original source is Copyright (c) the LLVM Project and Contributors. Licensed under the Apache License v2.0 with LLVM Exceptions. See NOTICE.txt in the project root for license information.
namespace ClangSharp.Interop;
diff --git a/sources/ClangSharp.Interop/clang/CXCodeComplete_Flags.cs b/sources/ClangSharp.Interop/clang/CXCodeComplete_Flags.cs
index 531a940f..8cadfc19 100644
--- a/sources/ClangSharp.Interop/clang/CXCodeComplete_Flags.cs
+++ b/sources/ClangSharp.Interop/clang/CXCodeComplete_Flags.cs
@@ -1,6 +1,6 @@
// Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
-// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-18.1.3/clang/include/clang-c
+// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-20.1.2/clang/include/clang-c
// Original source is Copyright (c) the LLVM Project and Contributors. Licensed under the Apache License v2.0 with LLVM Exceptions. See NOTICE.txt in the project root for license information.
namespace ClangSharp.Interop;
diff --git a/sources/ClangSharp.Interop/clang/CXComment.cs b/sources/ClangSharp.Interop/clang/CXComment.cs
index cb17ef6c..70f16530 100644
--- a/sources/ClangSharp.Interop/clang/CXComment.cs
+++ b/sources/ClangSharp.Interop/clang/CXComment.cs
@@ -1,6 +1,6 @@
// Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
-// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-18.1.3/clang/include/clang-c
+// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-20.1.2/clang/include/clang-c
// Original source is Copyright (c) the LLVM Project and Contributors. Licensed under the Apache License v2.0 with LLVM Exceptions. See NOTICE.txt in the project root for license information.
namespace ClangSharp.Interop;
diff --git a/sources/ClangSharp.Interop/clang/CXCommentInlineCommandRenderKind.cs b/sources/ClangSharp.Interop/clang/CXCommentInlineCommandRenderKind.cs
index a0a66953..e5cd9292 100644
--- a/sources/ClangSharp.Interop/clang/CXCommentInlineCommandRenderKind.cs
+++ b/sources/ClangSharp.Interop/clang/CXCommentInlineCommandRenderKind.cs
@@ -1,6 +1,6 @@
// Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
-// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-18.1.3/clang/include/clang-c
+// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-20.1.2/clang/include/clang-c
// Original source is Copyright (c) the LLVM Project and Contributors. Licensed under the Apache License v2.0 with LLVM Exceptions. See NOTICE.txt in the project root for license information.
namespace ClangSharp.Interop;
diff --git a/sources/ClangSharp.Interop/clang/CXCommentKind.cs b/sources/ClangSharp.Interop/clang/CXCommentKind.cs
index 3ec91725..db9b1594 100644
--- a/sources/ClangSharp.Interop/clang/CXCommentKind.cs
+++ b/sources/ClangSharp.Interop/clang/CXCommentKind.cs
@@ -1,6 +1,6 @@
// Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
-// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-18.1.3/clang/include/clang-c
+// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-20.1.2/clang/include/clang-c
// Original source is Copyright (c) the LLVM Project and Contributors. Licensed under the Apache License v2.0 with LLVM Exceptions. See NOTICE.txt in the project root for license information.
namespace ClangSharp.Interop;
diff --git a/sources/ClangSharp.Interop/clang/CXCommentParamPassDirection.cs b/sources/ClangSharp.Interop/clang/CXCommentParamPassDirection.cs
index 4ba704d3..20f89f03 100644
--- a/sources/ClangSharp.Interop/clang/CXCommentParamPassDirection.cs
+++ b/sources/ClangSharp.Interop/clang/CXCommentParamPassDirection.cs
@@ -1,6 +1,6 @@
// Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
-// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-18.1.3/clang/include/clang-c
+// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-20.1.2/clang/include/clang-c
// Original source is Copyright (c) the LLVM Project and Contributors. Licensed under the Apache License v2.0 with LLVM Exceptions. See NOTICE.txt in the project root for license information.
namespace ClangSharp.Interop;
diff --git a/sources/ClangSharp.Interop/clang/CXCompilationDatabase_Error.cs b/sources/ClangSharp.Interop/clang/CXCompilationDatabase_Error.cs
index 9be2b02d..738908f5 100644
--- a/sources/ClangSharp.Interop/clang/CXCompilationDatabase_Error.cs
+++ b/sources/ClangSharp.Interop/clang/CXCompilationDatabase_Error.cs
@@ -1,6 +1,6 @@
// Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
-// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-18.1.3/clang/include/clang-c
+// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-20.1.2/clang/include/clang-c
// Original source is Copyright (c) the LLVM Project and Contributors. Licensed under the Apache License v2.0 with LLVM Exceptions. See NOTICE.txt in the project root for license information.
namespace ClangSharp.Interop;
diff --git a/sources/ClangSharp.Interop/clang/CXCompletionChunkKind.cs b/sources/ClangSharp.Interop/clang/CXCompletionChunkKind.cs
index ea3a04eb..0282ea5f 100644
--- a/sources/ClangSharp.Interop/clang/CXCompletionChunkKind.cs
+++ b/sources/ClangSharp.Interop/clang/CXCompletionChunkKind.cs
@@ -1,6 +1,6 @@
// Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
-// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-18.1.3/clang/include/clang-c
+// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-20.1.2/clang/include/clang-c
// Original source is Copyright (c) the LLVM Project and Contributors. Licensed under the Apache License v2.0 with LLVM Exceptions. See NOTICE.txt in the project root for license information.
namespace ClangSharp.Interop;
diff --git a/sources/ClangSharp.Interop/clang/CXCompletionContext.cs b/sources/ClangSharp.Interop/clang/CXCompletionContext.cs
index a5558c5b..017094fc 100644
--- a/sources/ClangSharp.Interop/clang/CXCompletionContext.cs
+++ b/sources/ClangSharp.Interop/clang/CXCompletionContext.cs
@@ -1,6 +1,6 @@
// Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
-// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-18.1.3/clang/include/clang-c
+// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-20.1.2/clang/include/clang-c
// Original source is Copyright (c) the LLVM Project and Contributors. Licensed under the Apache License v2.0 with LLVM Exceptions. See NOTICE.txt in the project root for license information.
namespace ClangSharp.Interop;
diff --git a/sources/ClangSharp.Interop/clang/CXCompletionResult.cs b/sources/ClangSharp.Interop/clang/CXCompletionResult.cs
index a21df104..69772ba2 100644
--- a/sources/ClangSharp.Interop/clang/CXCompletionResult.cs
+++ b/sources/ClangSharp.Interop/clang/CXCompletionResult.cs
@@ -1,6 +1,6 @@
// Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
-// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-18.1.3/clang/include/clang-c
+// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-20.1.2/clang/include/clang-c
// Original source is Copyright (c) the LLVM Project and Contributors. Licensed under the Apache License v2.0 with LLVM Exceptions. See NOTICE.txt in the project root for license information.
namespace ClangSharp.Interop;
diff --git a/sources/ClangSharp.Interop/clang/CXCursor.cs b/sources/ClangSharp.Interop/clang/CXCursor.cs
index 074538d8..5fcdeecf 100644
--- a/sources/ClangSharp.Interop/clang/CXCursor.cs
+++ b/sources/ClangSharp.Interop/clang/CXCursor.cs
@@ -1,6 +1,6 @@
// Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
-// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-18.1.3/clang/include/clang-c
+// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-20.1.2/clang/include/clang-c
// Original source is Copyright (c) the LLVM Project and Contributors. Licensed under the Apache License v2.0 with LLVM Exceptions. See NOTICE.txt in the project root for license information.
using System.Runtime.CompilerServices;
diff --git a/sources/ClangSharp.Interop/clang/CXCursorAndRangeVisitor.cs b/sources/ClangSharp.Interop/clang/CXCursorAndRangeVisitor.cs
index 2ac3caff..1efa3078 100644
--- a/sources/ClangSharp.Interop/clang/CXCursorAndRangeVisitor.cs
+++ b/sources/ClangSharp.Interop/clang/CXCursorAndRangeVisitor.cs
@@ -1,6 +1,6 @@
// Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
-// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-18.1.3/clang/include/clang-c
+// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-20.1.2/clang/include/clang-c
// Original source is Copyright (c) the LLVM Project and Contributors. Licensed under the Apache License v2.0 with LLVM Exceptions. See NOTICE.txt in the project root for license information.
namespace ClangSharp.Interop;
diff --git a/sources/ClangSharp.Interop/clang/CXCursorKind.cs b/sources/ClangSharp.Interop/clang/CXCursorKind.cs
index 42a586b2..532cf187 100644
--- a/sources/ClangSharp.Interop/clang/CXCursorKind.cs
+++ b/sources/ClangSharp.Interop/clang/CXCursorKind.cs
@@ -1,6 +1,6 @@
// Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
-// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-18.1.3/clang/include/clang-c
+// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-20.1.2/clang/include/clang-c
// Original source is Copyright (c) the LLVM Project and Contributors. Licensed under the Apache License v2.0 with LLVM Exceptions. See NOTICE.txt in the project root for license information.
namespace ClangSharp.Interop;
@@ -115,7 +115,7 @@ public enum CXCursorKind
CXCursor_LambdaExpr = 144,
CXCursor_ObjCBoolLiteralExpr = 145,
CXCursor_ObjCSelfExpr = 146,
- CXCursor_OMPArraySectionExpr = 147,
+ CXCursor_ArraySectionExpr = 147,
CXCursor_ObjCAvailabilityCheckExpr = 148,
CXCursor_FixedPointLiteral = 149,
CXCursor_OMPArrayShapingExpr = 150,
@@ -124,7 +124,8 @@ public enum CXCursorKind
CXCursor_ConceptSpecializationExpr = 153,
CXCursor_RequiresExpr = 154,
CXCursor_CXXParenListInitExpr = 155,
- CXCursor_LastExpr = CXCursor_CXXParenListInitExpr,
+ CXCursor_PackIndexingExpr = 156,
+ CXCursor_LastExpr = CXCursor_PackIndexingExpr,
CXCursor_FirstStmt = 200,
CXCursor_UnexposedStmt = 200,
CXCursor_LabelStmt = 201,
@@ -234,7 +235,22 @@ public enum CXCursorKind
CXCursor_OMPParallelMaskedTaskLoopSimdDirective = 304,
CXCursor_OMPErrorDirective = 305,
CXCursor_OMPScopeDirective = 306,
- CXCursor_LastStmt = CXCursor_OMPScopeDirective,
+ CXCursor_OMPReverseDirective = 307,
+ CXCursor_OMPInterchangeDirective = 308,
+ CXCursor_OMPAssumeDirective = 309,
+ CXCursor_OpenACCComputeConstruct = 320,
+ CXCursor_OpenACCLoopConstruct = 321,
+ CXCursor_OpenACCCombinedConstruct = 322,
+ CXCursor_OpenACCDataConstruct = 323,
+ CXCursor_OpenACCEnterDataConstruct = 324,
+ CXCursor_OpenACCExitDataConstruct = 325,
+ CXCursor_OpenACCHostDataConstruct = 326,
+ CXCursor_OpenACCWaitConstruct = 327,
+ CXCursor_OpenACCInitConstruct = 328,
+ CXCursor_OpenACCShutdownConstruct = 329,
+ CXCursor_OpenACCSetConstruct = 330,
+ CXCursor_OpenACCUpdateConstruct = 331,
+ CXCursor_LastStmt = CXCursor_OpenACCUpdateConstruct,
CXCursor_TranslationUnit = 350,
CXCursor_FirstAttr = 400,
CXCursor_UnexposedAttr = 400,
diff --git a/sources/ClangSharp.Interop/clang/CXCursor_ExceptionSpecificationKind.cs b/sources/ClangSharp.Interop/clang/CXCursor_ExceptionSpecificationKind.cs
index 5c1d53fb..aa55f164 100644
--- a/sources/ClangSharp.Interop/clang/CXCursor_ExceptionSpecificationKind.cs
+++ b/sources/ClangSharp.Interop/clang/CXCursor_ExceptionSpecificationKind.cs
@@ -1,6 +1,6 @@
// Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
-// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-18.1.3/clang/include/clang-c
+// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-20.1.2/clang/include/clang-c
// Original source is Copyright (c) the LLVM Project and Contributors. Licensed under the Apache License v2.0 with LLVM Exceptions. See NOTICE.txt in the project root for license information.
namespace ClangSharp.Interop;
diff --git a/sources/ClangSharp.Interop/clang/CXDiagnosticDisplayOptions.cs b/sources/ClangSharp.Interop/clang/CXDiagnosticDisplayOptions.cs
index a1f3752d..c648dcd6 100644
--- a/sources/ClangSharp.Interop/clang/CXDiagnosticDisplayOptions.cs
+++ b/sources/ClangSharp.Interop/clang/CXDiagnosticDisplayOptions.cs
@@ -1,6 +1,6 @@
// Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
-// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-18.1.3/clang/include/clang-c
+// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-20.1.2/clang/include/clang-c
// Original source is Copyright (c) the LLVM Project and Contributors. Licensed under the Apache License v2.0 with LLVM Exceptions. See NOTICE.txt in the project root for license information.
namespace ClangSharp.Interop;
diff --git a/sources/ClangSharp.Interop/clang/CXDiagnosticSeverity.cs b/sources/ClangSharp.Interop/clang/CXDiagnosticSeverity.cs
index f580c249..e9249172 100644
--- a/sources/ClangSharp.Interop/clang/CXDiagnosticSeverity.cs
+++ b/sources/ClangSharp.Interop/clang/CXDiagnosticSeverity.cs
@@ -1,6 +1,6 @@
// Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
-// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-18.1.3/clang/include/clang-c
+// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-20.1.2/clang/include/clang-c
// Original source is Copyright (c) the LLVM Project and Contributors. Licensed under the Apache License v2.0 with LLVM Exceptions. See NOTICE.txt in the project root for license information.
namespace ClangSharp.Interop;
diff --git a/sources/ClangSharp.Interop/clang/CXErrorCode.cs b/sources/ClangSharp.Interop/clang/CXErrorCode.cs
index 1e4023ae..b0c2c1d9 100644
--- a/sources/ClangSharp.Interop/clang/CXErrorCode.cs
+++ b/sources/ClangSharp.Interop/clang/CXErrorCode.cs
@@ -1,6 +1,6 @@
// Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
-// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-18.1.3/clang/include/clang-c
+// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-20.1.2/clang/include/clang-c
// Original source is Copyright (c) the LLVM Project and Contributors. Licensed under the Apache License v2.0 with LLVM Exceptions. See NOTICE.txt in the project root for license information.
namespace ClangSharp.Interop;
diff --git a/sources/ClangSharp.Interop/clang/CXEvalResultKind.cs b/sources/ClangSharp.Interop/clang/CXEvalResultKind.cs
index dc000cfc..0bd792bc 100644
--- a/sources/ClangSharp.Interop/clang/CXEvalResultKind.cs
+++ b/sources/ClangSharp.Interop/clang/CXEvalResultKind.cs
@@ -1,6 +1,6 @@
// Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
-// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-18.1.3/clang/include/clang-c
+// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-20.1.2/clang/include/clang-c
// Original source is Copyright (c) the LLVM Project and Contributors. Licensed under the Apache License v2.0 with LLVM Exceptions. See NOTICE.txt in the project root for license information.
namespace ClangSharp.Interop;
diff --git a/sources/ClangSharp.Interop/clang/CXFileUniqueID.cs b/sources/ClangSharp.Interop/clang/CXFileUniqueID.cs
index 08541baa..5f7d908d 100644
--- a/sources/ClangSharp.Interop/clang/CXFileUniqueID.cs
+++ b/sources/ClangSharp.Interop/clang/CXFileUniqueID.cs
@@ -1,6 +1,6 @@
// Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
-// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-18.1.3/clang/include/clang-c
+// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-20.1.2/clang/include/clang-c
// Original source is Copyright (c) the LLVM Project and Contributors. Licensed under the Apache License v2.0 with LLVM Exceptions. See NOTICE.txt in the project root for license information.
using System.Runtime.CompilerServices;
diff --git a/sources/ClangSharp.Interop/clang/CXGlobalOptFlags.cs b/sources/ClangSharp.Interop/clang/CXGlobalOptFlags.cs
index ddea536b..46da52be 100644
--- a/sources/ClangSharp.Interop/clang/CXGlobalOptFlags.cs
+++ b/sources/ClangSharp.Interop/clang/CXGlobalOptFlags.cs
@@ -1,6 +1,6 @@
// Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
-// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-18.1.3/clang/include/clang-c
+// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-20.1.2/clang/include/clang-c
// Original source is Copyright (c) the LLVM Project and Contributors. Licensed under the Apache License v2.0 with LLVM Exceptions. See NOTICE.txt in the project root for license information.
namespace ClangSharp.Interop;
diff --git a/sources/ClangSharp.Interop/clang/CXIdxAttrInfo.cs b/sources/ClangSharp.Interop/clang/CXIdxAttrInfo.cs
index 3def5799..8682ae90 100644
--- a/sources/ClangSharp.Interop/clang/CXIdxAttrInfo.cs
+++ b/sources/ClangSharp.Interop/clang/CXIdxAttrInfo.cs
@@ -1,6 +1,6 @@
// Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
-// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-18.1.3/clang/include/clang-c
+// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-20.1.2/clang/include/clang-c
// Original source is Copyright (c) the LLVM Project and Contributors. Licensed under the Apache License v2.0 with LLVM Exceptions. See NOTICE.txt in the project root for license information.
namespace ClangSharp.Interop;
diff --git a/sources/ClangSharp.Interop/clang/CXIdxAttrKind.cs b/sources/ClangSharp.Interop/clang/CXIdxAttrKind.cs
index f461126b..ee79d830 100644
--- a/sources/ClangSharp.Interop/clang/CXIdxAttrKind.cs
+++ b/sources/ClangSharp.Interop/clang/CXIdxAttrKind.cs
@@ -1,6 +1,6 @@
// Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
-// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-18.1.3/clang/include/clang-c
+// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-20.1.2/clang/include/clang-c
// Original source is Copyright (c) the LLVM Project and Contributors. Licensed under the Apache License v2.0 with LLVM Exceptions. See NOTICE.txt in the project root for license information.
namespace ClangSharp.Interop;
diff --git a/sources/ClangSharp.Interop/clang/CXIdxBaseClassInfo.cs b/sources/ClangSharp.Interop/clang/CXIdxBaseClassInfo.cs
index 0dcee248..991c3521 100644
--- a/sources/ClangSharp.Interop/clang/CXIdxBaseClassInfo.cs
+++ b/sources/ClangSharp.Interop/clang/CXIdxBaseClassInfo.cs
@@ -1,6 +1,6 @@
// Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
-// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-18.1.3/clang/include/clang-c
+// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-20.1.2/clang/include/clang-c
// Original source is Copyright (c) the LLVM Project and Contributors. Licensed under the Apache License v2.0 with LLVM Exceptions. See NOTICE.txt in the project root for license information.
namespace ClangSharp.Interop;
diff --git a/sources/ClangSharp.Interop/clang/CXIdxCXXClassDeclInfo.cs b/sources/ClangSharp.Interop/clang/CXIdxCXXClassDeclInfo.cs
index b9d7472c..2ef567b2 100644
--- a/sources/ClangSharp.Interop/clang/CXIdxCXXClassDeclInfo.cs
+++ b/sources/ClangSharp.Interop/clang/CXIdxCXXClassDeclInfo.cs
@@ -1,6 +1,6 @@
// Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
-// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-18.1.3/clang/include/clang-c
+// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-20.1.2/clang/include/clang-c
// Original source is Copyright (c) the LLVM Project and Contributors. Licensed under the Apache License v2.0 with LLVM Exceptions. See NOTICE.txt in the project root for license information.
namespace ClangSharp.Interop;
diff --git a/sources/ClangSharp.Interop/clang/CXIdxContainerInfo.cs b/sources/ClangSharp.Interop/clang/CXIdxContainerInfo.cs
index 4f7c4f3f..159f66c1 100644
--- a/sources/ClangSharp.Interop/clang/CXIdxContainerInfo.cs
+++ b/sources/ClangSharp.Interop/clang/CXIdxContainerInfo.cs
@@ -1,6 +1,6 @@
// Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
-// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-18.1.3/clang/include/clang-c
+// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-20.1.2/clang/include/clang-c
// Original source is Copyright (c) the LLVM Project and Contributors. Licensed under the Apache License v2.0 with LLVM Exceptions. See NOTICE.txt in the project root for license information.
namespace ClangSharp.Interop;
diff --git a/sources/ClangSharp.Interop/clang/CXIdxDeclInfo.cs b/sources/ClangSharp.Interop/clang/CXIdxDeclInfo.cs
index ad8a7b1a..849e7947 100644
--- a/sources/ClangSharp.Interop/clang/CXIdxDeclInfo.cs
+++ b/sources/ClangSharp.Interop/clang/CXIdxDeclInfo.cs
@@ -1,6 +1,6 @@
// Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
-// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-18.1.3/clang/include/clang-c
+// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-20.1.2/clang/include/clang-c
// Original source is Copyright (c) the LLVM Project and Contributors. Licensed under the Apache License v2.0 with LLVM Exceptions. See NOTICE.txt in the project root for license information.
namespace ClangSharp.Interop;
diff --git a/sources/ClangSharp.Interop/clang/CXIdxDeclInfoFlags.cs b/sources/ClangSharp.Interop/clang/CXIdxDeclInfoFlags.cs
index 15bcfabc..229a7c9d 100644
--- a/sources/ClangSharp.Interop/clang/CXIdxDeclInfoFlags.cs
+++ b/sources/ClangSharp.Interop/clang/CXIdxDeclInfoFlags.cs
@@ -1,6 +1,6 @@
// Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
-// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-18.1.3/clang/include/clang-c
+// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-20.1.2/clang/include/clang-c
// Original source is Copyright (c) the LLVM Project and Contributors. Licensed under the Apache License v2.0 with LLVM Exceptions. See NOTICE.txt in the project root for license information.
namespace ClangSharp.Interop;
diff --git a/sources/ClangSharp.Interop/clang/CXIdxEntityCXXTemplateKind.cs b/sources/ClangSharp.Interop/clang/CXIdxEntityCXXTemplateKind.cs
index 9da7c26f..7e622172 100644
--- a/sources/ClangSharp.Interop/clang/CXIdxEntityCXXTemplateKind.cs
+++ b/sources/ClangSharp.Interop/clang/CXIdxEntityCXXTemplateKind.cs
@@ -1,6 +1,6 @@
// Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
-// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-18.1.3/clang/include/clang-c
+// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-20.1.2/clang/include/clang-c
// Original source is Copyright (c) the LLVM Project and Contributors. Licensed under the Apache License v2.0 with LLVM Exceptions. See NOTICE.txt in the project root for license information.
namespace ClangSharp.Interop;
diff --git a/sources/ClangSharp.Interop/clang/CXIdxEntityInfo.cs b/sources/ClangSharp.Interop/clang/CXIdxEntityInfo.cs
index 82304b8b..5f712b9e 100644
--- a/sources/ClangSharp.Interop/clang/CXIdxEntityInfo.cs
+++ b/sources/ClangSharp.Interop/clang/CXIdxEntityInfo.cs
@@ -1,6 +1,6 @@
// Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
-// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-18.1.3/clang/include/clang-c
+// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-20.1.2/clang/include/clang-c
// Original source is Copyright (c) the LLVM Project and Contributors. Licensed under the Apache License v2.0 with LLVM Exceptions. See NOTICE.txt in the project root for license information.
namespace ClangSharp.Interop;
diff --git a/sources/ClangSharp.Interop/clang/CXIdxEntityKind.cs b/sources/ClangSharp.Interop/clang/CXIdxEntityKind.cs
index ca3cc6e9..adf4f7cc 100644
--- a/sources/ClangSharp.Interop/clang/CXIdxEntityKind.cs
+++ b/sources/ClangSharp.Interop/clang/CXIdxEntityKind.cs
@@ -1,6 +1,6 @@
// Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
-// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-18.1.3/clang/include/clang-c
+// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-20.1.2/clang/include/clang-c
// Original source is Copyright (c) the LLVM Project and Contributors. Licensed under the Apache License v2.0 with LLVM Exceptions. See NOTICE.txt in the project root for license information.
namespace ClangSharp.Interop;
diff --git a/sources/ClangSharp.Interop/clang/CXIdxEntityLanguage.cs b/sources/ClangSharp.Interop/clang/CXIdxEntityLanguage.cs
index 0fde7af2..123de8ab 100644
--- a/sources/ClangSharp.Interop/clang/CXIdxEntityLanguage.cs
+++ b/sources/ClangSharp.Interop/clang/CXIdxEntityLanguage.cs
@@ -1,6 +1,6 @@
// Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
-// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-18.1.3/clang/include/clang-c
+// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-20.1.2/clang/include/clang-c
// Original source is Copyright (c) the LLVM Project and Contributors. Licensed under the Apache License v2.0 with LLVM Exceptions. See NOTICE.txt in the project root for license information.
namespace ClangSharp.Interop;
diff --git a/sources/ClangSharp.Interop/clang/CXIdxEntityRefInfo.cs b/sources/ClangSharp.Interop/clang/CXIdxEntityRefInfo.cs
index d60d98bf..45d0ed79 100644
--- a/sources/ClangSharp.Interop/clang/CXIdxEntityRefInfo.cs
+++ b/sources/ClangSharp.Interop/clang/CXIdxEntityRefInfo.cs
@@ -1,6 +1,6 @@
// Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
-// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-18.1.3/clang/include/clang-c
+// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-20.1.2/clang/include/clang-c
// Original source is Copyright (c) the LLVM Project and Contributors. Licensed under the Apache License v2.0 with LLVM Exceptions. See NOTICE.txt in the project root for license information.
namespace ClangSharp.Interop;
diff --git a/sources/ClangSharp.Interop/clang/CXIdxEntityRefKind.cs b/sources/ClangSharp.Interop/clang/CXIdxEntityRefKind.cs
index 3f1daa21..a271f72a 100644
--- a/sources/ClangSharp.Interop/clang/CXIdxEntityRefKind.cs
+++ b/sources/ClangSharp.Interop/clang/CXIdxEntityRefKind.cs
@@ -1,6 +1,6 @@
// Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
-// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-18.1.3/clang/include/clang-c
+// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-20.1.2/clang/include/clang-c
// Original source is Copyright (c) the LLVM Project and Contributors. Licensed under the Apache License v2.0 with LLVM Exceptions. See NOTICE.txt in the project root for license information.
namespace ClangSharp.Interop;
diff --git a/sources/ClangSharp.Interop/clang/CXIdxIBOutletCollectionAttrInfo.cs b/sources/ClangSharp.Interop/clang/CXIdxIBOutletCollectionAttrInfo.cs
index 786daf83..398b6300 100644
--- a/sources/ClangSharp.Interop/clang/CXIdxIBOutletCollectionAttrInfo.cs
+++ b/sources/ClangSharp.Interop/clang/CXIdxIBOutletCollectionAttrInfo.cs
@@ -1,6 +1,6 @@
// Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
-// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-18.1.3/clang/include/clang-c
+// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-20.1.2/clang/include/clang-c
// Original source is Copyright (c) the LLVM Project and Contributors. Licensed under the Apache License v2.0 with LLVM Exceptions. See NOTICE.txt in the project root for license information.
namespace ClangSharp.Interop;
diff --git a/sources/ClangSharp.Interop/clang/CXIdxImportedASTFileInfo.cs b/sources/ClangSharp.Interop/clang/CXIdxImportedASTFileInfo.cs
index d0b1ba35..4fc5480d 100644
--- a/sources/ClangSharp.Interop/clang/CXIdxImportedASTFileInfo.cs
+++ b/sources/ClangSharp.Interop/clang/CXIdxImportedASTFileInfo.cs
@@ -1,6 +1,6 @@
// Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
-// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-18.1.3/clang/include/clang-c
+// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-20.1.2/clang/include/clang-c
// Original source is Copyright (c) the LLVM Project and Contributors. Licensed under the Apache License v2.0 with LLVM Exceptions. See NOTICE.txt in the project root for license information.
namespace ClangSharp.Interop;
diff --git a/sources/ClangSharp.Interop/clang/CXIdxIncludedFileInfo.cs b/sources/ClangSharp.Interop/clang/CXIdxIncludedFileInfo.cs
index 9de436d2..42f9654e 100644
--- a/sources/ClangSharp.Interop/clang/CXIdxIncludedFileInfo.cs
+++ b/sources/ClangSharp.Interop/clang/CXIdxIncludedFileInfo.cs
@@ -1,6 +1,6 @@
// Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
-// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-18.1.3/clang/include/clang-c
+// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-20.1.2/clang/include/clang-c
// Original source is Copyright (c) the LLVM Project and Contributors. Licensed under the Apache License v2.0 with LLVM Exceptions. See NOTICE.txt in the project root for license information.
namespace ClangSharp.Interop;
diff --git a/sources/ClangSharp.Interop/clang/CXIdxLoc.cs b/sources/ClangSharp.Interop/clang/CXIdxLoc.cs
index 2309fc5b..d9194845 100644
--- a/sources/ClangSharp.Interop/clang/CXIdxLoc.cs
+++ b/sources/ClangSharp.Interop/clang/CXIdxLoc.cs
@@ -1,6 +1,6 @@
// Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
-// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-18.1.3/clang/include/clang-c
+// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-20.1.2/clang/include/clang-c
// Original source is Copyright (c) the LLVM Project and Contributors. Licensed under the Apache License v2.0 with LLVM Exceptions. See NOTICE.txt in the project root for license information.
using System.Runtime.CompilerServices;
diff --git a/sources/ClangSharp.Interop/clang/CXIdxObjCCategoryDeclInfo.cs b/sources/ClangSharp.Interop/clang/CXIdxObjCCategoryDeclInfo.cs
index ed95f7b1..60bae0f4 100644
--- a/sources/ClangSharp.Interop/clang/CXIdxObjCCategoryDeclInfo.cs
+++ b/sources/ClangSharp.Interop/clang/CXIdxObjCCategoryDeclInfo.cs
@@ -1,6 +1,6 @@
// Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
-// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-18.1.3/clang/include/clang-c
+// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-20.1.2/clang/include/clang-c
// Original source is Copyright (c) the LLVM Project and Contributors. Licensed under the Apache License v2.0 with LLVM Exceptions. See NOTICE.txt in the project root for license information.
namespace ClangSharp.Interop;
diff --git a/sources/ClangSharp.Interop/clang/CXIdxObjCContainerDeclInfo.cs b/sources/ClangSharp.Interop/clang/CXIdxObjCContainerDeclInfo.cs
index 580e5caa..6f2fea81 100644
--- a/sources/ClangSharp.Interop/clang/CXIdxObjCContainerDeclInfo.cs
+++ b/sources/ClangSharp.Interop/clang/CXIdxObjCContainerDeclInfo.cs
@@ -1,6 +1,6 @@
// Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
-// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-18.1.3/clang/include/clang-c
+// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-20.1.2/clang/include/clang-c
// Original source is Copyright (c) the LLVM Project and Contributors. Licensed under the Apache License v2.0 with LLVM Exceptions. See NOTICE.txt in the project root for license information.
namespace ClangSharp.Interop;
diff --git a/sources/ClangSharp.Interop/clang/CXIdxObjCContainerKind.cs b/sources/ClangSharp.Interop/clang/CXIdxObjCContainerKind.cs
index d92df8f7..2260185d 100644
--- a/sources/ClangSharp.Interop/clang/CXIdxObjCContainerKind.cs
+++ b/sources/ClangSharp.Interop/clang/CXIdxObjCContainerKind.cs
@@ -1,6 +1,6 @@
// Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
-// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-18.1.3/clang/include/clang-c
+// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-20.1.2/clang/include/clang-c
// Original source is Copyright (c) the LLVM Project and Contributors. Licensed under the Apache License v2.0 with LLVM Exceptions. See NOTICE.txt in the project root for license information.
namespace ClangSharp.Interop;
diff --git a/sources/ClangSharp.Interop/clang/CXIdxObjCInterfaceDeclInfo.cs b/sources/ClangSharp.Interop/clang/CXIdxObjCInterfaceDeclInfo.cs
index 61b95173..9eecef17 100644
--- a/sources/ClangSharp.Interop/clang/CXIdxObjCInterfaceDeclInfo.cs
+++ b/sources/ClangSharp.Interop/clang/CXIdxObjCInterfaceDeclInfo.cs
@@ -1,6 +1,6 @@
// Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
-// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-18.1.3/clang/include/clang-c
+// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-20.1.2/clang/include/clang-c
// Original source is Copyright (c) the LLVM Project and Contributors. Licensed under the Apache License v2.0 with LLVM Exceptions. See NOTICE.txt in the project root for license information.
namespace ClangSharp.Interop;
diff --git a/sources/ClangSharp.Interop/clang/CXIdxObjCPropertyDeclInfo.cs b/sources/ClangSharp.Interop/clang/CXIdxObjCPropertyDeclInfo.cs
index 65edc889..0591027a 100644
--- a/sources/ClangSharp.Interop/clang/CXIdxObjCPropertyDeclInfo.cs
+++ b/sources/ClangSharp.Interop/clang/CXIdxObjCPropertyDeclInfo.cs
@@ -1,6 +1,6 @@
// Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
-// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-18.1.3/clang/include/clang-c
+// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-20.1.2/clang/include/clang-c
// Original source is Copyright (c) the LLVM Project and Contributors. Licensed under the Apache License v2.0 with LLVM Exceptions. See NOTICE.txt in the project root for license information.
namespace ClangSharp.Interop;
diff --git a/sources/ClangSharp.Interop/clang/CXIdxObjCProtocolRefInfo.cs b/sources/ClangSharp.Interop/clang/CXIdxObjCProtocolRefInfo.cs
index e8ca74cd..c3a90497 100644
--- a/sources/ClangSharp.Interop/clang/CXIdxObjCProtocolRefInfo.cs
+++ b/sources/ClangSharp.Interop/clang/CXIdxObjCProtocolRefInfo.cs
@@ -1,6 +1,6 @@
// Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
-// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-18.1.3/clang/include/clang-c
+// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-20.1.2/clang/include/clang-c
// Original source is Copyright (c) the LLVM Project and Contributors. Licensed under the Apache License v2.0 with LLVM Exceptions. See NOTICE.txt in the project root for license information.
namespace ClangSharp.Interop;
diff --git a/sources/ClangSharp.Interop/clang/CXIdxObjCProtocolRefListInfo.cs b/sources/ClangSharp.Interop/clang/CXIdxObjCProtocolRefListInfo.cs
index cb02880d..9270b920 100644
--- a/sources/ClangSharp.Interop/clang/CXIdxObjCProtocolRefListInfo.cs
+++ b/sources/ClangSharp.Interop/clang/CXIdxObjCProtocolRefListInfo.cs
@@ -1,6 +1,6 @@
// Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
-// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-18.1.3/clang/include/clang-c
+// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-20.1.2/clang/include/clang-c
// Original source is Copyright (c) the LLVM Project and Contributors. Licensed under the Apache License v2.0 with LLVM Exceptions. See NOTICE.txt in the project root for license information.
namespace ClangSharp.Interop;
diff --git a/sources/ClangSharp.Interop/clang/CXIndexOptFlags.cs b/sources/ClangSharp.Interop/clang/CXIndexOptFlags.cs
index 3c2dd327..b4e41413 100644
--- a/sources/ClangSharp.Interop/clang/CXIndexOptFlags.cs
+++ b/sources/ClangSharp.Interop/clang/CXIndexOptFlags.cs
@@ -1,6 +1,6 @@
// Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
-// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-18.1.3/clang/include/clang-c
+// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-20.1.2/clang/include/clang-c
// Original source is Copyright (c) the LLVM Project and Contributors. Licensed under the Apache License v2.0 with LLVM Exceptions. See NOTICE.txt in the project root for license information.
namespace ClangSharp.Interop;
diff --git a/sources/ClangSharp.Interop/clang/CXIndexOptions.cs b/sources/ClangSharp.Interop/clang/CXIndexOptions.cs
index 859e06c8..48f1d577 100644
--- a/sources/ClangSharp.Interop/clang/CXIndexOptions.cs
+++ b/sources/ClangSharp.Interop/clang/CXIndexOptions.cs
@@ -1,6 +1,6 @@
// Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
-// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-18.1.3/clang/include/clang-c
+// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-20.1.2/clang/include/clang-c
// Original source is Copyright (c) the LLVM Project and Contributors. Licensed under the Apache License v2.0 with LLVM Exceptions. See NOTICE.txt in the project root for license information.
using System.Runtime.CompilerServices;
diff --git a/sources/ClangSharp.Interop/clang/CXLanguageKind.cs b/sources/ClangSharp.Interop/clang/CXLanguageKind.cs
index 790fd346..b27a35c0 100644
--- a/sources/ClangSharp.Interop/clang/CXLanguageKind.cs
+++ b/sources/ClangSharp.Interop/clang/CXLanguageKind.cs
@@ -1,6 +1,6 @@
// Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
-// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-18.1.3/clang/include/clang-c
+// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-20.1.2/clang/include/clang-c
// Original source is Copyright (c) the LLVM Project and Contributors. Licensed under the Apache License v2.0 with LLVM Exceptions. See NOTICE.txt in the project root for license information.
namespace ClangSharp.Interop;
diff --git a/sources/ClangSharp.Interop/clang/CXLinkageKind.cs b/sources/ClangSharp.Interop/clang/CXLinkageKind.cs
index cbb05f8f..21dad4ee 100644
--- a/sources/ClangSharp.Interop/clang/CXLinkageKind.cs
+++ b/sources/ClangSharp.Interop/clang/CXLinkageKind.cs
@@ -1,6 +1,6 @@
// Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
-// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-18.1.3/clang/include/clang-c
+// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-20.1.2/clang/include/clang-c
// Original source is Copyright (c) the LLVM Project and Contributors. Licensed under the Apache License v2.0 with LLVM Exceptions. See NOTICE.txt in the project root for license information.
namespace ClangSharp.Interop;
diff --git a/sources/ClangSharp.Interop/clang/CXLoadDiag_Error.cs b/sources/ClangSharp.Interop/clang/CXLoadDiag_Error.cs
index f142982b..e9500782 100644
--- a/sources/ClangSharp.Interop/clang/CXLoadDiag_Error.cs
+++ b/sources/ClangSharp.Interop/clang/CXLoadDiag_Error.cs
@@ -1,6 +1,6 @@
// Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
-// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-18.1.3/clang/include/clang-c
+// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-20.1.2/clang/include/clang-c
// Original source is Copyright (c) the LLVM Project and Contributors. Licensed under the Apache License v2.0 with LLVM Exceptions. See NOTICE.txt in the project root for license information.
namespace ClangSharp.Interop;
diff --git a/sources/ClangSharp.Interop/clang/CXNameRefFlags.cs b/sources/ClangSharp.Interop/clang/CXNameRefFlags.cs
index b6293159..c7b3479b 100644
--- a/sources/ClangSharp.Interop/clang/CXNameRefFlags.cs
+++ b/sources/ClangSharp.Interop/clang/CXNameRefFlags.cs
@@ -1,6 +1,6 @@
// Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
-// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-18.1.3/clang/include/clang-c
+// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-20.1.2/clang/include/clang-c
// Original source is Copyright (c) the LLVM Project and Contributors. Licensed under the Apache License v2.0 with LLVM Exceptions. See NOTICE.txt in the project root for license information.
namespace ClangSharp.Interop;
diff --git a/sources/ClangSharp.Interop/clang/CXObjCDeclQualifierKind.cs b/sources/ClangSharp.Interop/clang/CXObjCDeclQualifierKind.cs
index ff264cc8..468a4755 100644
--- a/sources/ClangSharp.Interop/clang/CXObjCDeclQualifierKind.cs
+++ b/sources/ClangSharp.Interop/clang/CXObjCDeclQualifierKind.cs
@@ -1,6 +1,6 @@
// Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
-// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-18.1.3/clang/include/clang-c
+// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-20.1.2/clang/include/clang-c
// Original source is Copyright (c) the LLVM Project and Contributors. Licensed under the Apache License v2.0 with LLVM Exceptions. See NOTICE.txt in the project root for license information.
namespace ClangSharp.Interop;
diff --git a/sources/ClangSharp.Interop/clang/CXObjCPropertyAttrKind.cs b/sources/ClangSharp.Interop/clang/CXObjCPropertyAttrKind.cs
index 0ec758d4..b75706da 100644
--- a/sources/ClangSharp.Interop/clang/CXObjCPropertyAttrKind.cs
+++ b/sources/ClangSharp.Interop/clang/CXObjCPropertyAttrKind.cs
@@ -1,6 +1,6 @@
// Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
-// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-18.1.3/clang/include/clang-c
+// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-20.1.2/clang/include/clang-c
// Original source is Copyright (c) the LLVM Project and Contributors. Licensed under the Apache License v2.0 with LLVM Exceptions. See NOTICE.txt in the project root for license information.
namespace ClangSharp.Interop;
diff --git a/sources/ClangSharp.Interop/clang/CXPlatformAvailability.cs b/sources/ClangSharp.Interop/clang/CXPlatformAvailability.cs
index 2f39fd87..3061a5d4 100644
--- a/sources/ClangSharp.Interop/clang/CXPlatformAvailability.cs
+++ b/sources/ClangSharp.Interop/clang/CXPlatformAvailability.cs
@@ -1,6 +1,6 @@
// Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
-// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-18.1.3/clang/include/clang-c
+// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-20.1.2/clang/include/clang-c
// Original source is Copyright (c) the LLVM Project and Contributors. Licensed under the Apache License v2.0 with LLVM Exceptions. See NOTICE.txt in the project root for license information.
namespace ClangSharp.Interop;
diff --git a/sources/ClangSharp.Interop/clang/CXPrintingPolicyProperty.cs b/sources/ClangSharp.Interop/clang/CXPrintingPolicyProperty.cs
index d983f321..af01b92a 100644
--- a/sources/ClangSharp.Interop/clang/CXPrintingPolicyProperty.cs
+++ b/sources/ClangSharp.Interop/clang/CXPrintingPolicyProperty.cs
@@ -1,6 +1,6 @@
// Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
-// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-18.1.3/clang/include/clang-c
+// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-20.1.2/clang/include/clang-c
// Original source is Copyright (c) the LLVM Project and Contributors. Licensed under the Apache License v2.0 with LLVM Exceptions. See NOTICE.txt in the project root for license information.
namespace ClangSharp.Interop;
diff --git a/sources/ClangSharp.Interop/clang/CXRefQualifierKind.cs b/sources/ClangSharp.Interop/clang/CXRefQualifierKind.cs
index ffa81942..e9a684bd 100644
--- a/sources/ClangSharp.Interop/clang/CXRefQualifierKind.cs
+++ b/sources/ClangSharp.Interop/clang/CXRefQualifierKind.cs
@@ -1,6 +1,6 @@
// Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
-// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-18.1.3/clang/include/clang-c
+// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-20.1.2/clang/include/clang-c
// Original source is Copyright (c) the LLVM Project and Contributors. Licensed under the Apache License v2.0 with LLVM Exceptions. See NOTICE.txt in the project root for license information.
namespace ClangSharp.Interop;
diff --git a/sources/ClangSharp.Interop/clang/CXReparse_Flags.cs b/sources/ClangSharp.Interop/clang/CXReparse_Flags.cs
index bfcad337..4f063c26 100644
--- a/sources/ClangSharp.Interop/clang/CXReparse_Flags.cs
+++ b/sources/ClangSharp.Interop/clang/CXReparse_Flags.cs
@@ -1,6 +1,6 @@
// Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
-// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-18.1.3/clang/include/clang-c
+// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-20.1.2/clang/include/clang-c
// Original source is Copyright (c) the LLVM Project and Contributors. Licensed under the Apache License v2.0 with LLVM Exceptions. See NOTICE.txt in the project root for license information.
namespace ClangSharp.Interop;
diff --git a/sources/ClangSharp.Interop/clang/CXResult.cs b/sources/ClangSharp.Interop/clang/CXResult.cs
index 0806c12f..b5fc88ef 100644
--- a/sources/ClangSharp.Interop/clang/CXResult.cs
+++ b/sources/ClangSharp.Interop/clang/CXResult.cs
@@ -1,6 +1,6 @@
// Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
-// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-18.1.3/clang/include/clang-c
+// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-20.1.2/clang/include/clang-c
// Original source is Copyright (c) the LLVM Project and Contributors. Licensed under the Apache License v2.0 with LLVM Exceptions. See NOTICE.txt in the project root for license information.
namespace ClangSharp.Interop;
diff --git a/sources/ClangSharp.Interop/clang/CXSaveError.cs b/sources/ClangSharp.Interop/clang/CXSaveError.cs
index 553d709a..12a8b2f6 100644
--- a/sources/ClangSharp.Interop/clang/CXSaveError.cs
+++ b/sources/ClangSharp.Interop/clang/CXSaveError.cs
@@ -1,6 +1,6 @@
// Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
-// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-18.1.3/clang/include/clang-c
+// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-20.1.2/clang/include/clang-c
// Original source is Copyright (c) the LLVM Project and Contributors. Licensed under the Apache License v2.0 with LLVM Exceptions. See NOTICE.txt in the project root for license information.
namespace ClangSharp.Interop;
diff --git a/sources/ClangSharp.Interop/clang/CXSaveTranslationUnit_Flags.cs b/sources/ClangSharp.Interop/clang/CXSaveTranslationUnit_Flags.cs
index 07bdc501..d4b398f6 100644
--- a/sources/ClangSharp.Interop/clang/CXSaveTranslationUnit_Flags.cs
+++ b/sources/ClangSharp.Interop/clang/CXSaveTranslationUnit_Flags.cs
@@ -1,6 +1,6 @@
// Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
-// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-18.1.3/clang/include/clang-c
+// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-20.1.2/clang/include/clang-c
// Original source is Copyright (c) the LLVM Project and Contributors. Licensed under the Apache License v2.0 with LLVM Exceptions. See NOTICE.txt in the project root for license information.
namespace ClangSharp.Interop;
diff --git a/sources/ClangSharp.Interop/clang/CXSourceLocation.cs b/sources/ClangSharp.Interop/clang/CXSourceLocation.cs
index 2f613f31..3134152c 100644
--- a/sources/ClangSharp.Interop/clang/CXSourceLocation.cs
+++ b/sources/ClangSharp.Interop/clang/CXSourceLocation.cs
@@ -1,6 +1,6 @@
// Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
-// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-18.1.3/clang/include/clang-c
+// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-20.1.2/clang/include/clang-c
// Original source is Copyright (c) the LLVM Project and Contributors. Licensed under the Apache License v2.0 with LLVM Exceptions. See NOTICE.txt in the project root for license information.
using System.Runtime.CompilerServices;
diff --git a/sources/ClangSharp.Interop/clang/CXSourceRange.cs b/sources/ClangSharp.Interop/clang/CXSourceRange.cs
index fcdb87c3..09124d32 100644
--- a/sources/ClangSharp.Interop/clang/CXSourceRange.cs
+++ b/sources/ClangSharp.Interop/clang/CXSourceRange.cs
@@ -1,6 +1,6 @@
// Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
-// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-18.1.3/clang/include/clang-c
+// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-20.1.2/clang/include/clang-c
// Original source is Copyright (c) the LLVM Project and Contributors. Licensed under the Apache License v2.0 with LLVM Exceptions. See NOTICE.txt in the project root for license information.
using System.Runtime.CompilerServices;
diff --git a/sources/ClangSharp.Interop/clang/CXSourceRangeList.cs b/sources/ClangSharp.Interop/clang/CXSourceRangeList.cs
index 991b2a33..015691cf 100644
--- a/sources/ClangSharp.Interop/clang/CXSourceRangeList.cs
+++ b/sources/ClangSharp.Interop/clang/CXSourceRangeList.cs
@@ -1,6 +1,6 @@
// Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
-// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-18.1.3/clang/include/clang-c
+// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-20.1.2/clang/include/clang-c
// Original source is Copyright (c) the LLVM Project and Contributors. Licensed under the Apache License v2.0 with LLVM Exceptions. See NOTICE.txt in the project root for license information.
namespace ClangSharp.Interop;
diff --git a/sources/ClangSharp.Interop/clang/CXString.cs b/sources/ClangSharp.Interop/clang/CXString.cs
index 3b871724..63ba5c14 100644
--- a/sources/ClangSharp.Interop/clang/CXString.cs
+++ b/sources/ClangSharp.Interop/clang/CXString.cs
@@ -1,6 +1,6 @@
// Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
-// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-18.1.3/clang/include/clang-c
+// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-20.1.2/clang/include/clang-c
// Original source is Copyright (c) the LLVM Project and Contributors. Licensed under the Apache License v2.0 with LLVM Exceptions. See NOTICE.txt in the project root for license information.
namespace ClangSharp.Interop;
diff --git a/sources/ClangSharp.Interop/clang/CXStringSet.cs b/sources/ClangSharp.Interop/clang/CXStringSet.cs
index edaa94d0..64d8e53d 100644
--- a/sources/ClangSharp.Interop/clang/CXStringSet.cs
+++ b/sources/ClangSharp.Interop/clang/CXStringSet.cs
@@ -1,6 +1,6 @@
// Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
-// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-18.1.3/clang/include/clang-c
+// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-20.1.2/clang/include/clang-c
// Original source is Copyright (c) the LLVM Project and Contributors. Licensed under the Apache License v2.0 with LLVM Exceptions. See NOTICE.txt in the project root for license information.
namespace ClangSharp.Interop;
diff --git a/sources/ClangSharp.Interop/clang/CXSymbolRole.cs b/sources/ClangSharp.Interop/clang/CXSymbolRole.cs
index c9acc0e8..b96c7040 100644
--- a/sources/ClangSharp.Interop/clang/CXSymbolRole.cs
+++ b/sources/ClangSharp.Interop/clang/CXSymbolRole.cs
@@ -1,6 +1,6 @@
// Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
-// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-18.1.3/clang/include/clang-c
+// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-20.1.2/clang/include/clang-c
// Original source is Copyright (c) the LLVM Project and Contributors. Licensed under the Apache License v2.0 with LLVM Exceptions. See NOTICE.txt in the project root for license information.
namespace ClangSharp.Interop;
diff --git a/sources/ClangSharp.Interop/clang/CXTLSKind.cs b/sources/ClangSharp.Interop/clang/CXTLSKind.cs
index 81aa2fda..e0e678a2 100644
--- a/sources/ClangSharp.Interop/clang/CXTLSKind.cs
+++ b/sources/ClangSharp.Interop/clang/CXTLSKind.cs
@@ -1,6 +1,6 @@
// Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
-// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-18.1.3/clang/include/clang-c
+// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-20.1.2/clang/include/clang-c
// Original source is Copyright (c) the LLVM Project and Contributors. Licensed under the Apache License v2.0 with LLVM Exceptions. See NOTICE.txt in the project root for license information.
namespace ClangSharp.Interop;
diff --git a/sources/ClangSharp.Interop/clang/CXTUResourceUsage.cs b/sources/ClangSharp.Interop/clang/CXTUResourceUsage.cs
index f0a74664..e929e89f 100644
--- a/sources/ClangSharp.Interop/clang/CXTUResourceUsage.cs
+++ b/sources/ClangSharp.Interop/clang/CXTUResourceUsage.cs
@@ -1,6 +1,6 @@
// Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
-// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-18.1.3/clang/include/clang-c
+// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-20.1.2/clang/include/clang-c
// Original source is Copyright (c) the LLVM Project and Contributors. Licensed under the Apache License v2.0 with LLVM Exceptions. See NOTICE.txt in the project root for license information.
namespace ClangSharp.Interop;
diff --git a/sources/ClangSharp.Interop/clang/CXTUResourceUsageEntry.cs b/sources/ClangSharp.Interop/clang/CXTUResourceUsageEntry.cs
index fb2fc8ec..958967e7 100644
--- a/sources/ClangSharp.Interop/clang/CXTUResourceUsageEntry.cs
+++ b/sources/ClangSharp.Interop/clang/CXTUResourceUsageEntry.cs
@@ -1,6 +1,6 @@
// Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
-// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-18.1.3/clang/include/clang-c
+// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-20.1.2/clang/include/clang-c
// Original source is Copyright (c) the LLVM Project and Contributors. Licensed under the Apache License v2.0 with LLVM Exceptions. See NOTICE.txt in the project root for license information.
namespace ClangSharp.Interop;
diff --git a/sources/ClangSharp.Interop/clang/CXTUResourceUsageKind.cs b/sources/ClangSharp.Interop/clang/CXTUResourceUsageKind.cs
index 423bfe71..f19fadf7 100644
--- a/sources/ClangSharp.Interop/clang/CXTUResourceUsageKind.cs
+++ b/sources/ClangSharp.Interop/clang/CXTUResourceUsageKind.cs
@@ -1,6 +1,6 @@
// Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
-// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-18.1.3/clang/include/clang-c
+// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-20.1.2/clang/include/clang-c
// Original source is Copyright (c) the LLVM Project and Contributors. Licensed under the Apache License v2.0 with LLVM Exceptions. See NOTICE.txt in the project root for license information.
namespace ClangSharp.Interop;
diff --git a/sources/ClangSharp.Interop/clang/CXTemplateArgumentKind.cs b/sources/ClangSharp.Interop/clang/CXTemplateArgumentKind.cs
index 1375e56b..0fc7cb36 100644
--- a/sources/ClangSharp.Interop/clang/CXTemplateArgumentKind.cs
+++ b/sources/ClangSharp.Interop/clang/CXTemplateArgumentKind.cs
@@ -1,6 +1,6 @@
// Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
-// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-18.1.3/clang/include/clang-c
+// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-20.1.2/clang/include/clang-c
// Original source is Copyright (c) the LLVM Project and Contributors. Licensed under the Apache License v2.0 with LLVM Exceptions. See NOTICE.txt in the project root for license information.
namespace ClangSharp.Interop;
diff --git a/sources/ClangSharp.Interop/clang/CXToken.cs b/sources/ClangSharp.Interop/clang/CXToken.cs
index c7729f34..3a1da283 100644
--- a/sources/ClangSharp.Interop/clang/CXToken.cs
+++ b/sources/ClangSharp.Interop/clang/CXToken.cs
@@ -1,6 +1,6 @@
// Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
-// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-18.1.3/clang/include/clang-c
+// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-20.1.2/clang/include/clang-c
// Original source is Copyright (c) the LLVM Project and Contributors. Licensed under the Apache License v2.0 with LLVM Exceptions. See NOTICE.txt in the project root for license information.
using System.Runtime.CompilerServices;
diff --git a/sources/ClangSharp.Interop/clang/CXTokenKind.cs b/sources/ClangSharp.Interop/clang/CXTokenKind.cs
index 48170e30..1d9ae19c 100644
--- a/sources/ClangSharp.Interop/clang/CXTokenKind.cs
+++ b/sources/ClangSharp.Interop/clang/CXTokenKind.cs
@@ -1,6 +1,6 @@
// Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
-// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-18.1.3/clang/include/clang-c
+// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-20.1.2/clang/include/clang-c
// Original source is Copyright (c) the LLVM Project and Contributors. Licensed under the Apache License v2.0 with LLVM Exceptions. See NOTICE.txt in the project root for license information.
namespace ClangSharp.Interop;
diff --git a/sources/ClangSharp.Interop/clang/CXTranslationUnit_Flags.cs b/sources/ClangSharp.Interop/clang/CXTranslationUnit_Flags.cs
index 57ec6324..33ddd3c6 100644
--- a/sources/ClangSharp.Interop/clang/CXTranslationUnit_Flags.cs
+++ b/sources/ClangSharp.Interop/clang/CXTranslationUnit_Flags.cs
@@ -1,6 +1,6 @@
// Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
-// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-18.1.3/clang/include/clang-c
+// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-20.1.2/clang/include/clang-c
// Original source is Copyright (c) the LLVM Project and Contributors. Licensed under the Apache License v2.0 with LLVM Exceptions. See NOTICE.txt in the project root for license information.
namespace ClangSharp.Interop;
diff --git a/sources/ClangSharp.Interop/clang/CXType.cs b/sources/ClangSharp.Interop/clang/CXType.cs
index ba107bfd..447288d8 100644
--- a/sources/ClangSharp.Interop/clang/CXType.cs
+++ b/sources/ClangSharp.Interop/clang/CXType.cs
@@ -1,6 +1,6 @@
// Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
-// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-18.1.3/clang/include/clang-c
+// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-20.1.2/clang/include/clang-c
// Original source is Copyright (c) the LLVM Project and Contributors. Licensed under the Apache License v2.0 with LLVM Exceptions. See NOTICE.txt in the project root for license information.
using System.Runtime.CompilerServices;
diff --git a/sources/ClangSharp.Interop/clang/CXTypeKind.cs b/sources/ClangSharp.Interop/clang/CXTypeKind.cs
index ce97a87a..710c1c7c 100644
--- a/sources/ClangSharp.Interop/clang/CXTypeKind.cs
+++ b/sources/ClangSharp.Interop/clang/CXTypeKind.cs
@@ -1,6 +1,6 @@
// Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
-// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-18.1.3/clang/include/clang-c
+// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-20.1.2/clang/include/clang-c
// Original source is Copyright (c) the LLVM Project and Contributors. Licensed under the Apache License v2.0 with LLVM Exceptions. See NOTICE.txt in the project root for license information.
namespace ClangSharp.Interop;
@@ -133,4 +133,6 @@ public enum CXTypeKind
CXType_ExtVector = 176,
CXType_Atomic = 177,
CXType_BTFTagAttributed = 178,
+ CXType_HLSLResource = 179,
+ CXType_HLSLAttributedResource = 180,
}
diff --git a/sources/ClangSharp.Interop/clang/CXTypeLayoutError.cs b/sources/ClangSharp.Interop/clang/CXTypeLayoutError.cs
index 963e824b..13e9ef80 100644
--- a/sources/ClangSharp.Interop/clang/CXTypeLayoutError.cs
+++ b/sources/ClangSharp.Interop/clang/CXTypeLayoutError.cs
@@ -1,6 +1,6 @@
// Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
-// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-18.1.3/clang/include/clang-c
+// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-20.1.2/clang/include/clang-c
// Original source is Copyright (c) the LLVM Project and Contributors. Licensed under the Apache License v2.0 with LLVM Exceptions. See NOTICE.txt in the project root for license information.
namespace ClangSharp.Interop;
diff --git a/sources/ClangSharp.Interop/clang/CXTypeNullabilityKind.cs b/sources/ClangSharp.Interop/clang/CXTypeNullabilityKind.cs
index 58f5075b..b181dd1c 100644
--- a/sources/ClangSharp.Interop/clang/CXTypeNullabilityKind.cs
+++ b/sources/ClangSharp.Interop/clang/CXTypeNullabilityKind.cs
@@ -1,6 +1,6 @@
// Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
-// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-18.1.3/clang/include/clang-c
+// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-20.1.2/clang/include/clang-c
// Original source is Copyright (c) the LLVM Project and Contributors. Licensed under the Apache License v2.0 with LLVM Exceptions. See NOTICE.txt in the project root for license information.
namespace ClangSharp.Interop;
diff --git a/sources/ClangSharp.Interop/clang/CXUnaryOperatorKind.cs b/sources/ClangSharp.Interop/clang/CXUnaryOperatorKind.cs
index e4abc5eb..51ee1741 100644
--- a/sources/ClangSharp.Interop/clang/CXUnaryOperatorKind.cs
+++ b/sources/ClangSharp.Interop/clang/CXUnaryOperatorKind.cs
@@ -1,6 +1,6 @@
// Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
-// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-18.1.3/clang/include/clang-c
+// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-20.1.2/clang/include/clang-c
// Original source is Copyright (c) the LLVM Project and Contributors. Licensed under the Apache License v2.0 with LLVM Exceptions. See NOTICE.txt in the project root for license information.
namespace ClangSharp.Interop;
diff --git a/sources/ClangSharp.Interop/clang/CXUnsavedFile.cs b/sources/ClangSharp.Interop/clang/CXUnsavedFile.cs
index a4c5130e..f32048da 100644
--- a/sources/ClangSharp.Interop/clang/CXUnsavedFile.cs
+++ b/sources/ClangSharp.Interop/clang/CXUnsavedFile.cs
@@ -1,6 +1,6 @@
// Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
-// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-18.1.3/clang/include/clang-c
+// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-20.1.2/clang/include/clang-c
// Original source is Copyright (c) the LLVM Project and Contributors. Licensed under the Apache License v2.0 with LLVM Exceptions. See NOTICE.txt in the project root for license information.
namespace ClangSharp.Interop;
diff --git a/sources/ClangSharp.Interop/clang/CXVersion.cs b/sources/ClangSharp.Interop/clang/CXVersion.cs
index c04fefd2..88cf9ede 100644
--- a/sources/ClangSharp.Interop/clang/CXVersion.cs
+++ b/sources/ClangSharp.Interop/clang/CXVersion.cs
@@ -1,6 +1,6 @@
// Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
-// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-18.1.3/clang/include/clang-c
+// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-20.1.2/clang/include/clang-c
// Original source is Copyright (c) the LLVM Project and Contributors. Licensed under the Apache License v2.0 with LLVM Exceptions. See NOTICE.txt in the project root for license information.
namespace ClangSharp.Interop;
diff --git a/sources/ClangSharp.Interop/clang/CXVisibilityKind.cs b/sources/ClangSharp.Interop/clang/CXVisibilityKind.cs
index 9901eba3..b49c89d4 100644
--- a/sources/ClangSharp.Interop/clang/CXVisibilityKind.cs
+++ b/sources/ClangSharp.Interop/clang/CXVisibilityKind.cs
@@ -1,6 +1,6 @@
// Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
-// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-18.1.3/clang/include/clang-c
+// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-20.1.2/clang/include/clang-c
// Original source is Copyright (c) the LLVM Project and Contributors. Licensed under the Apache License v2.0 with LLVM Exceptions. See NOTICE.txt in the project root for license information.
namespace ClangSharp.Interop;
diff --git a/sources/ClangSharp.Interop/clang/CXVisitorResult.cs b/sources/ClangSharp.Interop/clang/CXVisitorResult.cs
index 0af560b7..5abbdcc5 100644
--- a/sources/ClangSharp.Interop/clang/CXVisitorResult.cs
+++ b/sources/ClangSharp.Interop/clang/CXVisitorResult.cs
@@ -1,6 +1,6 @@
// Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
-// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-18.1.3/clang/include/clang-c
+// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-20.1.2/clang/include/clang-c
// Original source is Copyright (c) the LLVM Project and Contributors. Licensed under the Apache License v2.0 with LLVM Exceptions. See NOTICE.txt in the project root for license information.
namespace ClangSharp.Interop;
diff --git a/sources/ClangSharp.Interop/clang/CX_BinaryOperatorKind.cs b/sources/ClangSharp.Interop/clang/CX_BinaryOperatorKind.cs
new file mode 100644
index 00000000..650102f0
--- /dev/null
+++ b/sources/ClangSharp.Interop/clang/CX_BinaryOperatorKind.cs
@@ -0,0 +1,45 @@
+// Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
+
+// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-20.1.2/clang/include/clang-c
+// Original source is Copyright (c) the LLVM Project and Contributors. Licensed under the Apache License v2.0 with LLVM Exceptions. See NOTICE.txt in the project root for license information.
+
+namespace ClangSharp.Interop;
+
+public enum CX_BinaryOperatorKind
+{
+ CX_BO_Invalid = 0,
+ CX_BO_PtrMemD = 1,
+ CX_BO_PtrMemI = 2,
+ CX_BO_Mul = 3,
+ CX_BO_Div = 4,
+ CX_BO_Rem = 5,
+ CX_BO_Add = 6,
+ CX_BO_Sub = 7,
+ CX_BO_Shl = 8,
+ CX_BO_Shr = 9,
+ CX_BO_Cmp = 10,
+ CX_BO_LT = 11,
+ CX_BO_GT = 12,
+ CX_BO_LE = 13,
+ CX_BO_GE = 14,
+ CX_BO_EQ = 15,
+ CX_BO_NE = 16,
+ CX_BO_And = 17,
+ CX_BO_Xor = 18,
+ CX_BO_Or = 19,
+ CX_BO_LAnd = 20,
+ CX_BO_LOr = 21,
+ CX_BO_Assign = 22,
+ CX_BO_MulAssign = 23,
+ CX_BO_DivAssign = 24,
+ CX_BO_RemAssign = 25,
+ CX_BO_AddAssign = 26,
+ CX_BO_SubAssign = 27,
+ CX_BO_ShlAssign = 28,
+ CX_BO_ShrAssign = 29,
+ CX_BO_AndAssign = 30,
+ CX_BO_XorAssign = 31,
+ CX_BO_OrAssign = 32,
+ CX_BO_Comma = 33,
+ CX_BO_LAST = CX_BO_Comma,
+}
diff --git a/sources/ClangSharp.Interop/clang/CX_CXXAccessSpecifier.cs b/sources/ClangSharp.Interop/clang/CX_CXXAccessSpecifier.cs
index 104284df..861e0eaf 100644
--- a/sources/ClangSharp.Interop/clang/CX_CXXAccessSpecifier.cs
+++ b/sources/ClangSharp.Interop/clang/CX_CXXAccessSpecifier.cs
@@ -1,6 +1,6 @@
// Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
-// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-18.1.3/clang/include/clang-c
+// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-20.1.2/clang/include/clang-c
// Original source is Copyright (c) the LLVM Project and Contributors. Licensed under the Apache License v2.0 with LLVM Exceptions. See NOTICE.txt in the project root for license information.
namespace ClangSharp.Interop;
diff --git a/sources/ClangSharp.Interop/clang/CX_StorageClass.cs b/sources/ClangSharp.Interop/clang/CX_StorageClass.cs
index 53854116..fd9388d0 100644
--- a/sources/ClangSharp.Interop/clang/CX_StorageClass.cs
+++ b/sources/ClangSharp.Interop/clang/CX_StorageClass.cs
@@ -1,6 +1,6 @@
// Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
-// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-18.1.3/clang/include/clang-c
+// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-20.1.2/clang/include/clang-c
// Original source is Copyright (c) the LLVM Project and Contributors. Licensed under the Apache License v2.0 with LLVM Exceptions. See NOTICE.txt in the project root for license information.
namespace ClangSharp.Interop;
diff --git a/sources/ClangSharp.Interop/clang/IndexerCallbacks.cs b/sources/ClangSharp.Interop/clang/IndexerCallbacks.cs
index 9c461643..84600c29 100644
--- a/sources/ClangSharp.Interop/clang/IndexerCallbacks.cs
+++ b/sources/ClangSharp.Interop/clang/IndexerCallbacks.cs
@@ -1,6 +1,6 @@
// Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
-// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-18.1.3/clang/include/clang-c
+// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-20.1.2/clang/include/clang-c
// Original source is Copyright (c) the LLVM Project and Contributors. Licensed under the Apache License v2.0 with LLVM Exceptions. See NOTICE.txt in the project root for license information.
namespace ClangSharp.Interop;
diff --git a/sources/ClangSharp.Interop/clang/clang.cs b/sources/ClangSharp.Interop/clang/clang.cs
index 5d1d1abb..66a93eaf 100644
--- a/sources/ClangSharp.Interop/clang/clang.cs
+++ b/sources/ClangSharp.Interop/clang/clang.cs
@@ -1,6 +1,6 @@
// Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
-// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-18.1.3/clang/include/clang-c
+// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-20.1.2/clang/include/clang-c
// Original source is Copyright (c) the LLVM Project and Contributors. Licensed under the Apache License v2.0 with LLVM Exceptions. See NOTICE.txt in the project root for license information.
using System;
@@ -194,6 +194,10 @@ public static unsafe partial class @clang
[return: NativeTypeName("unsigned int")]
public static extern uint equalLocations(CXSourceLocation loc1, CXSourceLocation loc2);
+ [DllImport("libclang", CallingConvention = CallingConvention.Cdecl, EntryPoint = "clang_isBeforeInTranslationUnit", ExactSpelling = true)]
+ [return: NativeTypeName("unsigned int")]
+ public static extern uint isBeforeInTranslationUnit(CXSourceLocation loc1, CXSourceLocation loc2);
+
[DllImport("libclang", CallingConvention = CallingConvention.Cdecl, EntryPoint = "clang_Location_isInSystemHeader", ExactSpelling = true)]
public static extern int Location_isInSystemHeader(CXSourceLocation location);
@@ -893,10 +897,21 @@ public static unsafe partial class @clang
[return: NativeTypeName("unsigned int")]
public static extern uint isVirtualBase(CXCursor param0);
+ [DllImport("libclang", CallingConvention = CallingConvention.Cdecl, EntryPoint = "clang_getOffsetOfBase", ExactSpelling = true)]
+ [return: NativeTypeName("long long")]
+ public static extern long getOffsetOfBase(CXCursor Parent, CXCursor Base);
+
[DllImport("libclang", CallingConvention = CallingConvention.Cdecl, EntryPoint = "clang_getCXXAccessSpecifier", ExactSpelling = true)]
[return: NativeTypeName("enum CX_CXXAccessSpecifier")]
public static extern CX_CXXAccessSpecifier getCXXAccessSpecifier(CXCursor param0);
+ [DllImport("libclang", CallingConvention = CallingConvention.Cdecl, EntryPoint = "clang_Cursor_getBinaryOpcode", ExactSpelling = true)]
+ [return: NativeTypeName("enum CX_BinaryOperatorKind")]
+ public static extern CX_BinaryOperatorKind Cursor_getBinaryOpcode(CXCursor C);
+
+ [DllImport("libclang", CallingConvention = CallingConvention.Cdecl, EntryPoint = "clang_Cursor_getBinaryOpcodeStr", ExactSpelling = true)]
+ public static extern CXString Cursor_getBinaryOpcodeStr([NativeTypeName("enum CX_BinaryOperatorKind")] CX_BinaryOperatorKind Op);
+
[DllImport("libclang", CallingConvention = CallingConvention.Cdecl, EntryPoint = "clang_Cursor_getStorageClass", ExactSpelling = true)]
[return: NativeTypeName("enum CX_StorageClass")]
public static extern CX_StorageClass Cursor_getStorageClass(CXCursor param0);
@@ -963,6 +978,9 @@ public static unsafe partial class @clang
[DllImport("libclang", CallingConvention = CallingConvention.Cdecl, EntryPoint = "clang_getCursorPrettyPrinted", ExactSpelling = true)]
public static extern CXString getCursorPrettyPrinted(CXCursor Cursor, [NativeTypeName("CXPrintingPolicy")] void* Policy);
+ [DllImport("libclang", CallingConvention = CallingConvention.Cdecl, EntryPoint = "clang_getTypePrettyPrinted", ExactSpelling = true)]
+ public static extern CXString getTypePrettyPrinted(CXType CT, [NativeTypeName("CXPrintingPolicy")] void* cxPolicy);
+
[DllImport("libclang", CallingConvention = CallingConvention.Cdecl, EntryPoint = "clang_getCursorDisplayName", ExactSpelling = true)]
public static extern CXString getCursorDisplayName(CXCursor param0);
@@ -1399,6 +1417,10 @@ public static unsafe partial class @clang
[return: NativeTypeName("unsigned int")]
public static extern uint Type_visitFields(CXType T, [NativeTypeName("CXFieldVisitor")] delegate* unmanaged[Cdecl] visitor, [NativeTypeName("CXClientData")] void* client_data);
+ [DllImport("libclang", CallingConvention = CallingConvention.Cdecl, EntryPoint = "clang_visitCXXBaseClasses", ExactSpelling = true)]
+ [return: NativeTypeName("unsigned int")]
+ public static extern uint visitCXXBaseClasses(CXType T, [NativeTypeName("CXFieldVisitor")] delegate* unmanaged[Cdecl] visitor, [NativeTypeName("CXClientData")] void* client_data);
+
[DllImport("libclang", CallingConvention = CallingConvention.Cdecl, EntryPoint = "clang_getBinaryOperatorKindSpelling", ExactSpelling = true)]
public static extern CXString getBinaryOperatorKindSpelling([NativeTypeName("enum CXBinaryOperatorKind")] CXBinaryOperatorKind kind);
diff --git a/sources/ClangSharp.Interop/clangsharp/CX_AtomicOperatorKind.cs b/sources/ClangSharp.Interop/clangsharp/CX_AtomicOperatorKind.cs
index 8afe0084..94781f63 100644
--- a/sources/ClangSharp.Interop/clangsharp/CX_AtomicOperatorKind.cs
+++ b/sources/ClangSharp.Interop/clangsharp/CX_AtomicOperatorKind.cs
@@ -6,91 +6,93 @@ namespace ClangSharp.Interop;
public enum CX_AtomicOperatorKind
{
CX_AO_Invalid,
- CX_AO__c11_atomic_init,
- CX_AO__c11_atomic_load,
- CX_AO__c11_atomic_store,
- CX_AO__c11_atomic_exchange,
- CX_AO__c11_atomic_compare_exchange_strong,
- CX_AO__c11_atomic_compare_exchange_weak,
- CX_AO__c11_atomic_fetch_add,
- CX_AO__c11_atomic_fetch_sub,
- CX_AO__c11_atomic_fetch_and,
- CX_AO__c11_atomic_fetch_or,
- CX_AO__c11_atomic_fetch_xor,
- CX_AO__c11_atomic_fetch_nand,
- CX_AO__c11_atomic_fetch_max,
- CX_AO__c11_atomic_fetch_min,
- CX_AO__atomic_load,
- CX_AO__atomic_load_n,
- CX_AO__atomic_store,
- CX_AO__atomic_store_n,
- CX_AO__atomic_exchange,
- CX_AO__atomic_exchange_n,
+ CX_AO__atomic_add_fetch,
+ CX_AO__atomic_and_fetch,
+ CX_AO__atomic_clear,
CX_AO__atomic_compare_exchange,
CX_AO__atomic_compare_exchange_n,
+ CX_AO__atomic_exchange,
+ CX_AO__atomic_exchange_n,
CX_AO__atomic_fetch_add,
- CX_AO__atomic_fetch_sub,
CX_AO__atomic_fetch_and,
+ CX_AO__atomic_fetch_max,
+ CX_AO__atomic_fetch_min,
+ CX_AO__atomic_fetch_nand,
CX_AO__atomic_fetch_or,
+ CX_AO__atomic_fetch_sub,
CX_AO__atomic_fetch_xor,
- CX_AO__atomic_fetch_nand,
- CX_AO__atomic_add_fetch,
- CX_AO__atomic_sub_fetch,
- CX_AO__atomic_and_fetch,
- CX_AO__atomic_or_fetch,
- CX_AO__atomic_xor_fetch,
+ CX_AO__atomic_load,
+ CX_AO__atomic_load_n,
CX_AO__atomic_max_fetch,
CX_AO__atomic_min_fetch,
CX_AO__atomic_nand_fetch,
- CX_AO__scoped_atomic_load,
- CX_AO__scoped_atomic_load_n,
- CX_AO__scoped_atomic_store,
- CX_AO__scoped_atomic_store_n,
- CX_AO__scoped_atomic_exchange,
- CX_AO__scoped_atomic_exchange_n,
+ CX_AO__atomic_or_fetch,
+ CX_AO__atomic_store,
+ CX_AO__atomic_store_n,
+ CX_AO__atomic_sub_fetch,
+ CX_AO__atomic_test_and_set,
+ CX_AO__atomic_xor_fetch,
+ CX_AO__c11_atomic_compare_exchange_strong,
+ CX_AO__c11_atomic_compare_exchange_weak,
+ CX_AO__c11_atomic_exchange,
+ CX_AO__c11_atomic_fetch_add,
+ CX_AO__c11_atomic_fetch_and,
+ CX_AO__c11_atomic_fetch_max,
+ CX_AO__c11_atomic_fetch_min,
+ CX_AO__c11_atomic_fetch_nand,
+ CX_AO__c11_atomic_fetch_or,
+ CX_AO__c11_atomic_fetch_sub,
+ CX_AO__c11_atomic_fetch_xor,
+ CX_AO__c11_atomic_init,
+ CX_AO__c11_atomic_load,
+ CX_AO__c11_atomic_store,
+ CX_AO__hip_atomic_compare_exchange_strong,
+ CX_AO__hip_atomic_compare_exchange_weak,
+ CX_AO__hip_atomic_exchange,
+ CX_AO__hip_atomic_fetch_add,
+ CX_AO__hip_atomic_fetch_and,
+ CX_AO__hip_atomic_fetch_max,
+ CX_AO__hip_atomic_fetch_min,
+ CX_AO__hip_atomic_fetch_or,
+ CX_AO__hip_atomic_fetch_sub,
+ CX_AO__hip_atomic_fetch_xor,
+ CX_AO__hip_atomic_load,
+ CX_AO__hip_atomic_store,
+ CX_AO__opencl_atomic_compare_exchange_strong,
+ CX_AO__opencl_atomic_compare_exchange_weak,
+ CX_AO__opencl_atomic_exchange,
+ CX_AO__opencl_atomic_fetch_add,
+ CX_AO__opencl_atomic_fetch_and,
+ CX_AO__opencl_atomic_fetch_max,
+ CX_AO__opencl_atomic_fetch_min,
+ CX_AO__opencl_atomic_fetch_or,
+ CX_AO__opencl_atomic_fetch_sub,
+ CX_AO__opencl_atomic_fetch_xor,
+ CX_AO__opencl_atomic_init,
+ CX_AO__opencl_atomic_load,
+ CX_AO__opencl_atomic_store,
+ CX_AO__scoped_atomic_add_fetch,
+ CX_AO__scoped_atomic_and_fetch,
CX_AO__scoped_atomic_compare_exchange,
CX_AO__scoped_atomic_compare_exchange_n,
+ CX_AO__scoped_atomic_exchange,
+ CX_AO__scoped_atomic_exchange_n,
CX_AO__scoped_atomic_fetch_add,
- CX_AO__scoped_atomic_fetch_sub,
CX_AO__scoped_atomic_fetch_and,
+ CX_AO__scoped_atomic_fetch_max,
+ CX_AO__scoped_atomic_fetch_min,
+ CX_AO__scoped_atomic_fetch_nand,
CX_AO__scoped_atomic_fetch_or,
+ CX_AO__scoped_atomic_fetch_sub,
CX_AO__scoped_atomic_fetch_xor,
- CX_AO__scoped_atomic_fetch_nand,
- CX_AO__scoped_atomic_add_fetch,
- CX_AO__scoped_atomic_sub_fetch,
- CX_AO__scoped_atomic_and_fetch,
- CX_AO__scoped_atomic_or_fetch,
- CX_AO__scoped_atomic_xor_fetch,
+ CX_AO__scoped_atomic_load,
+ CX_AO__scoped_atomic_load_n,
CX_AO__scoped_atomic_max_fetch,
CX_AO__scoped_atomic_min_fetch,
CX_AO__scoped_atomic_nand_fetch,
- CX_AO__scoped_atomic_fetch_min,
- CX_AO__scoped_atomic_fetch_max,
- CX_AO__opencl_atomic_init,
- CX_AO__opencl_atomic_load,
- CX_AO__opencl_atomic_store,
- CX_AO__opencl_atomic_exchange,
- CX_AO__opencl_atomic_compare_exchange_strong,
- CX_AO__opencl_atomic_compare_exchange_weak,
- CX_AO__opencl_atomic_fetch_add,
- CX_AO__opencl_atomic_fetch_sub,
- CX_AO__opencl_atomic_fetch_and,
- CX_AO__opencl_atomic_fetch_or,
- CX_AO__opencl_atomic_fetch_xor,
- CX_AO__opencl_atomic_fetch_min,
- CX_AO__opencl_atomic_fetch_max,
- CX_AO__atomic_fetch_min,
- CX_AO__atomic_fetch_max,
- CX_AO__hip_atomic_load,
- CX_AO__hip_atomic_store,
- CX_AO__hip_atomic_compare_exchange_weak,
- CX_AO__hip_atomic_compare_exchange_strong,
- CX_AO__hip_atomic_exchange,
- CX_AO__hip_atomic_fetch_add,
- CX_AO__hip_atomic_fetch_sub,
- CX_AO__hip_atomic_fetch_and,
- CX_AO__hip_atomic_fetch_or,
- CX_AO__hip_atomic_fetch_xor,
- CX_AO__hip_atomic_fetch_min,
- CX_AO__hip_atomic_fetch_max,
+ CX_AO__scoped_atomic_or_fetch,
+ CX_AO__scoped_atomic_store,
+ CX_AO__scoped_atomic_store_n,
+ CX_AO__scoped_atomic_sub_fetch,
+ CX_AO__scoped_atomic_xor_fetch,
}
diff --git a/sources/ClangSharp.Interop/clangsharp/CX_AttrKind.cs b/sources/ClangSharp.Interop/clangsharp/CX_AttrKind.cs
index 5468ac8e..a42e0ce2 100644
--- a/sources/ClangSharp.Interop/clangsharp/CX_AttrKind.cs
+++ b/sources/ClangSharp.Interop/clangsharp/CX_AttrKind.cs
@@ -7,7 +7,9 @@ public enum CX_AttrKind
{
CX_AttrKind_Invalid,
CX_AttrKind_AddressSpace,
+ CX_AttrKind_Allocating,
CX_AttrKind_AnnotateType,
+ CX_AttrKind_ArmAgnostic,
CX_AttrKind_ArmIn,
CX_AttrKind_ArmInOut,
CX_AttrKind_ArmMveStrictPolymorphism,
@@ -16,10 +18,16 @@ public enum CX_AttrKind
CX_AttrKind_ArmStreaming,
CX_AttrKind_ArmStreamingCompatible,
CX_AttrKind_BTFTypeTag,
+ CX_AttrKind_Blocking,
CX_AttrKind_CmseNSCall,
+ CX_AttrKind_HLSLContainedType,
CX_AttrKind_HLSLGroupSharedAddressSpace,
- CX_AttrKind_HLSLParamModifier,
+ CX_AttrKind_HLSLROV,
+ CX_AttrKind_HLSLRawBuffer,
+ CX_AttrKind_HLSLResourceClass,
CX_AttrKind_NoDeref,
+ CX_AttrKind_NonAllocating,
+ CX_AttrKind_NonBlocking,
CX_AttrKind_ObjCGC,
CX_AttrKind_ObjCInertUnsafeUnretained,
CX_AttrKind_ObjCKindOf,
@@ -35,12 +43,14 @@ public enum CX_AttrKind
CX_AttrKind_SPtr,
CX_AttrKind_TypeNonNull,
CX_AttrKind_TypeNullUnspecified,
- CX_AttrKind_TypeNullable,
CX_AttrKind_TypeNullableResult,
CX_AttrKind_UPtr,
CX_AttrKind_WebAssemblyFuncref,
+ CX_AttrKind_CXXAssume,
CX_AttrKind_CodeAlign,
CX_AttrKind_FallThrough,
+ CX_AttrKind_HLSLControlFlowHint,
+ CX_AttrKind_HLSLLoopHint,
CX_AttrKind_Likely,
CX_AttrKind_MustTail,
CX_AttrKind_OpenCLUnrollHint,
@@ -55,9 +65,12 @@ public enum CX_AttrKind
CX_AttrKind_AcquireHandle,
CX_AttrKind_AnyX86NoCfCheck,
CX_AttrKind_CDecl,
+ CX_AttrKind_CountedBy,
+ CX_AttrKind_CountedByOrNull,
CX_AttrKind_FastCall,
CX_AttrKind_IntelOclBicc,
CX_AttrKind_LifetimeBound,
+ CX_AttrKind_LifetimeCaptureBy,
CX_AttrKind_M68kRTD,
CX_AttrKind_MSABI,
CX_AttrKind_NSReturnsRetained,
@@ -66,18 +79,25 @@ public enum CX_AttrKind
CX_AttrKind_Pcs,
CX_AttrKind_PreserveAll,
CX_AttrKind_PreserveMost,
+ CX_AttrKind_PreserveNone,
+ CX_AttrKind_RISCVVectorCC,
CX_AttrKind_RegCall,
+ CX_AttrKind_SizedBy,
+ CX_AttrKind_SizedByOrNull,
CX_AttrKind_StdCall,
CX_AttrKind_SwiftAsyncCall,
+ CX_AttrKind_SwiftAttr,
CX_AttrKind_SwiftCall,
CX_AttrKind_SysVABI,
CX_AttrKind_ThisCall,
+ CX_AttrKind_TypeNullable,
CX_AttrKind_VectorCall,
+ CX_AttrKind_Annotate,
+ CX_AttrKind_HLSLParamModifier,
CX_AttrKind_SwiftAsyncContext,
CX_AttrKind_SwiftContext,
CX_AttrKind_SwiftErrorResult,
CX_AttrKind_SwiftIndirectResult,
- CX_AttrKind_Annotate,
CX_AttrKind_CFConsumed,
CX_AttrKind_CarriesDependency,
CX_AttrKind_NSConsumed,
@@ -86,9 +106,13 @@ public enum CX_AttrKind
CX_AttrKind_PassObjectSize,
CX_AttrKind_ReleaseHandle,
CX_AttrKind_UseHandle,
+ CX_AttrKind_HLSLPackOffset,
CX_AttrKind_HLSLSV_DispatchThreadID,
+ CX_AttrKind_HLSLSV_GroupID,
CX_AttrKind_HLSLSV_GroupIndex,
+ CX_AttrKind_HLSLSV_GroupThreadID,
CX_AttrKind_AMDGPUFlatWorkGroupSize,
+ CX_AttrKind_AMDGPUMaxNumWorkGroups,
CX_AttrKind_AMDGPUNumSGPR,
CX_AttrKind_AMDGPUNumVGPR,
CX_AttrKind_AMDGPUWavesPerEU,
@@ -118,9 +142,9 @@ public enum CX_AttrKind
CX_AttrKind_AssertExclusiveLock,
CX_AttrKind_AssertSharedLock,
CX_AttrKind_AssumeAligned,
- CX_AttrKind_Assumption,
CX_AttrKind_Availability,
CX_AttrKind_AvailableOnlyInDefaultEvalMethod,
+ CX_AttrKind_BPFFastCall,
CX_AttrKind_BPFPreserveAccessIndex,
CX_AttrKind_BPFPreserveStaticOffset,
CX_AttrKind_BTFDeclTag,
@@ -140,6 +164,7 @@ public enum CX_AttrKind
CX_AttrKind_CUDADeviceBuiltinSurfaceType,
CX_AttrKind_CUDADeviceBuiltinTextureType,
CX_AttrKind_CUDAGlobal,
+ CX_AttrKind_CUDAGridConstant,
CX_AttrKind_CUDAHost,
CX_AttrKind_CUDAInvalidTarget,
CX_AttrKind_CUDALaunchBounds,
@@ -150,6 +175,7 @@ public enum CX_AttrKind
CX_AttrKind_Capability,
CX_AttrKind_CapturedRecord,
CX_AttrKind_Cleanup,
+ CX_AttrKind_ClspvLibclcBuiltin,
CX_AttrKind_CmseNSEntry,
CX_AttrKind_CodeModel,
CX_AttrKind_CodeSeg,
@@ -162,12 +188,13 @@ public enum CX_AttrKind
CX_AttrKind_ConsumableAutoCast,
CX_AttrKind_ConsumableSetOnRead,
CX_AttrKind_Convergent,
+ CX_AttrKind_CoroAwaitElidable,
+ CX_AttrKind_CoroAwaitElidableArgument,
CX_AttrKind_CoroDisableLifetimeBound,
CX_AttrKind_CoroLifetimeBound,
CX_AttrKind_CoroOnlyDestroyWhenComplete,
CX_AttrKind_CoroReturnType,
CX_AttrKind_CoroWrapper,
- CX_AttrKind_CountedBy,
CX_AttrKind_DLLExport,
CX_AttrKind_DLLExportStaticLocal,
CX_AttrKind_DLLImport,
@@ -186,6 +213,7 @@ public enum CX_AttrKind
CX_AttrKind_Error,
CX_AttrKind_ExcludeFromExplicitInstantiation,
CX_AttrKind_ExclusiveTrylockFunction,
+ CX_AttrKind_ExplicitInit,
CX_AttrKind_ExternalSourceSymbol,
CX_AttrKind_Final,
CX_AttrKind_FlagEnum,
@@ -201,7 +229,9 @@ public enum CX_AttrKind
CX_AttrKind_HLSLResource,
CX_AttrKind_HLSLResourceBinding,
CX_AttrKind_HLSLShader,
+ CX_AttrKind_HLSLWaveSize,
CX_AttrKind_Hot,
+ CX_AttrKind_HybridPatchable,
CX_AttrKind_IBAction,
CX_AttrKind_IBOutlet,
CX_AttrKind_IBOutletCollection,
@@ -239,6 +269,7 @@ public enum CX_AttrKind
CX_AttrKind_Naked,
CX_AttrKind_NoAlias,
CX_AttrKind_NoCommon,
+ CX_AttrKind_NoConvergent,
CX_AttrKind_NoDebug,
CX_AttrKind_NoDestroy,
CX_AttrKind_NoDuplicate,
@@ -249,15 +280,18 @@ public enum CX_AttrKind
CX_AttrKind_NoRandomizeLayout,
CX_AttrKind_NoReturn,
CX_AttrKind_NoSanitize,
+ CX_AttrKind_NoSpecializations,
CX_AttrKind_NoSpeculativeLoadHardening,
CX_AttrKind_NoSplitStack,
CX_AttrKind_NoStackProtector,
CX_AttrKind_NoThreadSafetyAnalysis,
CX_AttrKind_NoThrow,
+ CX_AttrKind_NoTrivialAutoVarInit,
CX_AttrKind_NoUniqueAddress,
CX_AttrKind_NoUwtable,
CX_AttrKind_NotTailCalled,
CX_AttrKind_OMPAllocateDecl,
+ CX_AttrKind_OMPAssume,
CX_AttrKind_OMPCaptureNoInit,
CX_AttrKind_OMPDeclareTargetDecl,
CX_AttrKind_OMPDeclareVariant,
@@ -315,6 +349,7 @@ public enum CX_AttrKind
CX_AttrKind_ReturnsNonNull,
CX_AttrKind_ReturnsTwice,
CX_AttrKind_SYCLKernel,
+ CX_AttrKind_SYCLKernelEntryPoint,
CX_AttrKind_SYCLSpecialClass,
CX_AttrKind_ScopedLockable,
CX_AttrKind_Section,
@@ -329,7 +364,6 @@ public enum CX_AttrKind
CX_AttrKind_SwiftAsync,
CX_AttrKind_SwiftAsyncError,
CX_AttrKind_SwiftAsyncName,
- CX_AttrKind_SwiftAttr,
CX_AttrKind_SwiftBridge,
CX_AttrKind_SwiftBridgedTypedef,
CX_AttrKind_SwiftError,
@@ -355,6 +389,7 @@ public enum CX_AttrKind
CX_AttrKind_Used,
CX_AttrKind_UsingIfExists,
CX_AttrKind_Uuid,
+ CX_AttrKind_VTablePointerAuthentication,
CX_AttrKind_VecReturn,
CX_AttrKind_VecTypeHint,
CX_AttrKind_Visibility,
@@ -397,7 +432,6 @@ public enum CX_AttrKind
CX_AttrKind_ObjCRuntimeVisible,
CX_AttrKind_OpenCLAccess,
CX_AttrKind_Overloadable,
- CX_AttrKind_RenderScriptKernel,
CX_AttrKind_SwiftObjCMembers,
CX_AttrKind_SwiftVersionedAddition,
CX_AttrKind_SwiftVersionedRemoval,
@@ -406,7 +440,7 @@ public enum CX_AttrKind
CX_AttrKind_LastAttr = CX_AttrKind_Thread,
CX_AttrKind_FirstTypeAttr = CX_AttrKind_AddressSpace,
CX_AttrKind_LastTypeAttr = CX_AttrKind_WebAssemblyFuncref,
- CX_AttrKind_FirstStmtAttr = CX_AttrKind_CodeAlign,
+ CX_AttrKind_FirstStmtAttr = CX_AttrKind_CXXAssume,
CX_AttrKind_LastStmtAttr = CX_AttrKind_Unlikely,
CX_AttrKind_FirstDeclOrStmtAttr = CX_AttrKind_AlwaysInline,
CX_AttrKind_LastDeclOrStmtAttr = CX_AttrKind_Suppress,
@@ -414,10 +448,12 @@ public enum CX_AttrKind
CX_AttrKind_LastInheritableAttr = CX_AttrKind_ZeroCallUsedRegs,
CX_AttrKind_FirstDeclOrTypeAttr = CX_AttrKind_AArch64SVEPcs,
CX_AttrKind_LastDeclOrTypeAttr = CX_AttrKind_VectorCall,
- CX_AttrKind_FirstInheritableParamAttr = CX_AttrKind_SwiftAsyncContext,
+ CX_AttrKind_FirstInheritableParamAttr = CX_AttrKind_Annotate,
CX_AttrKind_LastInheritableParamAttr = CX_AttrKind_UseHandle,
- CX_AttrKind_FirstParameterABIAttr = CX_AttrKind_SwiftAsyncContext,
+ CX_AttrKind_FirstInheritableParamOrStmtAttr = CX_AttrKind_Annotate,
+ CX_AttrKind_LastInheritableParamOrStmtAttr = CX_AttrKind_Annotate,
+ CX_AttrKind_FirstParameterABIAttr = CX_AttrKind_HLSLParamModifier,
CX_AttrKind_LastParameterABIAttr = CX_AttrKind_SwiftIndirectResult,
- CX_AttrKind_FirstHLSLAnnotationAttr = CX_AttrKind_HLSLSV_DispatchThreadID,
- CX_AttrKind_LastHLSLAnnotationAttr = CX_AttrKind_HLSLSV_GroupIndex,
+ CX_AttrKind_FirstHLSLAnnotationAttr = CX_AttrKind_HLSLPackOffset,
+ CX_AttrKind_LastHLSLAnnotationAttr = CX_AttrKind_HLSLSV_GroupThreadID,
}
diff --git a/sources/ClangSharp.Interop/clangsharp/CX_CastKind.cs b/sources/ClangSharp.Interop/clangsharp/CX_CastKind.cs
index 443be8fb..1ddd91d1 100644
--- a/sources/ClangSharp.Interop/clangsharp/CX_CastKind.cs
+++ b/sources/ClangSharp.Interop/clangsharp/CX_CastKind.cs
@@ -71,4 +71,6 @@ public enum CX_CastKind
CX_CK_ZeroToOCLOpaqueType,
CX_CK_AddressSpaceConversion,
CX_CK_IntToOCLSampler,
+ CX_CK_HLSLVectorTruncation,
+ CX_CK_HLSLArrayRValue,
}
diff --git a/sources/ClangSharp.Interop/clangsharp/CX_DeclKind.cs b/sources/ClangSharp.Interop/clangsharp/CX_DeclKind.cs
index 3e3dbbe6..4b54d0c8 100644
--- a/sources/ClangSharp.Interop/clangsharp/CX_DeclKind.cs
+++ b/sources/ClangSharp.Interop/clangsharp/CX_DeclKind.cs
@@ -7,13 +7,14 @@ public enum CX_DeclKind
{
CX_DeclKind_Invalid,
CX_DeclKind_TranslationUnit,
+ CX_DeclKind_TopLevelStmt,
CX_DeclKind_RequiresExprBody,
+ CX_DeclKind_OutlinedFunction,
CX_DeclKind_LinkageSpec,
CX_DeclKind_ExternCContext,
CX_DeclKind_Export,
CX_DeclKind_Captured,
CX_DeclKind_Block,
- CX_DeclKind_TopLevelStmt,
CX_DeclKind_StaticAssert,
CX_DeclKind_PragmaDetectMismatch,
CX_DeclKind_PragmaComment,
diff --git a/sources/ClangSharp.Interop/clangsharp/CX_FloatingSemantics.cs b/sources/ClangSharp.Interop/clangsharp/CX_FloatingSemantics.cs
index e76a082d..4cf9f909 100644
--- a/sources/ClangSharp.Interop/clangsharp/CX_FloatingSemantics.cs
+++ b/sources/ClangSharp.Interop/clangsharp/CX_FloatingSemantics.cs
@@ -12,12 +12,19 @@ public enum CX_FloatingSemantics
CX_FLK_IEEEdouble,
CX_FLK_IEEEquad,
CX_FLK_PPCDoubleDouble,
+ CX_FLK_PPCDoubleDoubleLegacy,
CX_FLK_Float8E5M2,
CX_FLK_Float8E5M2FNUZ,
+ CX_FLK_Float8E4M3,
CX_FLK_Float8E4M3FN,
CX_FLK_Float8E4M3FNUZ,
CX_FLK_Float8E4M3B11FNUZ,
+ CX_FLK_Float8E3M4,
CX_FLK_FloatTF32,
+ CX_FLK_Float8E8M0FNU,
+ CX_FLK_Float6E3M2FN,
+ CX_FLK_Float6E2M3FN,
+ CX_FLK_Float4E2M1FN,
CX_FLK_x87DoubleExtended,
CX_FLK_MaxSemantics = CX_FLK_x87DoubleExtended,
}
diff --git a/sources/ClangSharp.Interop/clangsharp/CX_StmtClass.cs b/sources/ClangSharp.Interop/clangsharp/CX_StmtClass.cs
index 0c5dba6f..3d4cfc6d 100644
--- a/sources/ClangSharp.Interop/clangsharp/CX_StmtClass.cs
+++ b/sources/ClangSharp.Interop/clangsharp/CX_StmtClass.cs
@@ -27,11 +27,13 @@ public enum CX_StmtClass
CX_StmtClass_PredefinedExpr,
CX_StmtClass_ParenListExpr,
CX_StmtClass_ParenExpr,
+ CX_StmtClass_PackIndexingExpr,
CX_StmtClass_PackExpansionExpr,
CX_StmtClass_UnresolvedMemberExpr,
CX_StmtClass_UnresolvedLookupExpr,
CX_StmtClass_FirstOverloadExpr = CX_StmtClass_UnresolvedMemberExpr,
CX_StmtClass_LastOverloadExpr = CX_StmtClass_UnresolvedLookupExpr,
+ CX_StmtClass_OpenACCAsteriskSizeExpr,
CX_StmtClass_OpaqueValueExpr,
CX_StmtClass_OffsetOfExpr,
CX_StmtClass_ObjCSubscriptRefExpr,
@@ -51,7 +53,6 @@ public enum CX_StmtClass
CX_StmtClass_ObjCArrayLiteral,
CX_StmtClass_OMPIteratorExpr,
CX_StmtClass_OMPArrayShapingExpr,
- CX_StmtClass_OMPArraySectionExpr,
CX_StmtClass_NoInitExpr,
CX_StmtClass_MemberExpr,
CX_StmtClass_MatrixSubscriptExpr,
@@ -63,6 +64,7 @@ public enum CX_StmtClass
CX_StmtClass_InitListExpr,
CX_StmtClass_ImplicitValueInitExpr,
CX_StmtClass_ImaginaryLiteral,
+ CX_StmtClass_HLSLOutArgExpr,
CX_StmtClass_GenericSelectionExpr,
CX_StmtClass_GNUNullExpr,
CX_StmtClass_FunctionParmPackExpr,
@@ -74,6 +76,7 @@ public enum CX_StmtClass
CX_StmtClass_FixedPointLiteral,
CX_StmtClass_ExtVectorElementExpr,
CX_StmtClass_ExpressionTraitExpr,
+ CX_StmtClass_EmbedExpr,
CX_StmtClass_DesignatedInitUpdateExpr,
CX_StmtClass_DesignatedInitExpr,
CX_StmtClass_DependentScopeDeclRefExpr,
@@ -145,6 +148,7 @@ public enum CX_StmtClass
CX_StmtClass_AsTypeExpr,
CX_StmtClass_ArrayTypeTraitExpr,
CX_StmtClass_ArraySubscriptExpr,
+ CX_StmtClass_ArraySectionExpr,
CX_StmtClass_ArrayInitLoopExpr,
CX_StmtClass_ArrayInitIndexExpr,
CX_StmtClass_AddrLabelExpr,
@@ -162,11 +166,28 @@ public enum CX_StmtClass
CX_StmtClass_CaseStmt,
CX_StmtClass_FirstSwitchCase = CX_StmtClass_DefaultStmt,
CX_StmtClass_LastSwitchCase = CX_StmtClass_CaseStmt,
+ CX_StmtClass_SYCLKernelCallStmt,
CX_StmtClass_SEHTryStmt,
CX_StmtClass_SEHLeaveStmt,
CX_StmtClass_SEHFinallyStmt,
CX_StmtClass_SEHExceptStmt,
CX_StmtClass_ReturnStmt,
+ CX_StmtClass_OpenACCWaitConstruct,
+ CX_StmtClass_OpenACCUpdateConstruct,
+ CX_StmtClass_OpenACCShutdownConstruct,
+ CX_StmtClass_OpenACCSetConstruct,
+ CX_StmtClass_OpenACCInitConstruct,
+ CX_StmtClass_OpenACCExitDataConstruct,
+ CX_StmtClass_OpenACCEnterDataConstruct,
+ CX_StmtClass_OpenACCLoopConstruct,
+ CX_StmtClass_OpenACCHostDataConstruct,
+ CX_StmtClass_OpenACCDataConstruct,
+ CX_StmtClass_OpenACCComputeConstruct,
+ CX_StmtClass_OpenACCCombinedConstruct,
+ CX_StmtClass_FirstOpenACCAssociatedStmtConstruct = CX_StmtClass_OpenACCLoopConstruct,
+ CX_StmtClass_LastOpenACCAssociatedStmtConstruct = CX_StmtClass_OpenACCCombinedConstruct,
+ CX_StmtClass_FirstOpenACCConstructStmt = CX_StmtClass_OpenACCWaitConstruct,
+ CX_StmtClass_LastOpenACCConstructStmt = CX_StmtClass_OpenACCCombinedConstruct,
CX_StmtClass_ObjCForCollectionStmt,
CX_StmtClass_ObjCAutoreleasePoolStmt,
CX_StmtClass_ObjCAtTryStmt,
@@ -202,8 +223,10 @@ public enum CX_StmtClass
CX_StmtClass_OMPMaskedDirective,
CX_StmtClass_OMPUnrollDirective,
CX_StmtClass_OMPTileDirective,
+ CX_StmtClass_OMPReverseDirective,
+ CX_StmtClass_OMPInterchangeDirective,
CX_StmtClass_FirstOMPLoopTransformationDirective = CX_StmtClass_OMPUnrollDirective,
- CX_StmtClass_LastOMPLoopTransformationDirective = CX_StmtClass_OMPTileDirective,
+ CX_StmtClass_LastOMPLoopTransformationDirective = CX_StmtClass_OMPInterchangeDirective,
CX_StmtClass_OMPTeamsGenericLoopDirective,
CX_StmtClass_OMPTeamsDistributeSimdDirective,
CX_StmtClass_OMPTeamsDistributeParallelForSimdDirective,
@@ -252,8 +275,9 @@ public enum CX_StmtClass
CX_StmtClass_OMPCancelDirective,
CX_StmtClass_OMPBarrierDirective,
CX_StmtClass_OMPAtomicDirective,
+ CX_StmtClass_OMPAssumeDirective,
CX_StmtClass_FirstOMPExecutableDirective = CX_StmtClass_OMPTeamsDirective,
- CX_StmtClass_LastOMPExecutableDirective = CX_StmtClass_OMPAtomicDirective,
+ CX_StmtClass_LastOMPExecutableDirective = CX_StmtClass_OMPAssumeDirective,
CX_StmtClass_OMPCanonicalLoop,
CX_StmtClass_NullStmt,
CX_StmtClass_MSDependentExistsStmt,
diff --git a/sources/ClangSharp.Interop/clangsharp/CX_TemplateNameKind.cs b/sources/ClangSharp.Interop/clangsharp/CX_TemplateNameKind.cs
index e0358a00..32a7bace 100644
--- a/sources/ClangSharp.Interop/clangsharp/CX_TemplateNameKind.cs
+++ b/sources/ClangSharp.Interop/clangsharp/CX_TemplateNameKind.cs
@@ -14,4 +14,5 @@ public enum CX_TemplateNameKind
CX_TNK_SubstTemplateTemplateParm,
CX_TNK_SubstTemplateTemplateParmPack,
CX_TNK_UsingTemplate,
+ CX_TNK_DeducedTemplate,
}
diff --git a/sources/ClangSharp.Interop/clangsharp/CX_TypeClass.cs b/sources/ClangSharp.Interop/clangsharp/CX_TypeClass.cs
index f6a7e4c7..81708516 100644
--- a/sources/ClangSharp.Interop/clangsharp/CX_TypeClass.cs
+++ b/sources/ClangSharp.Interop/clangsharp/CX_TypeClass.cs
@@ -9,6 +9,7 @@ public enum CX_TypeClass
CX_TypeClass_Adjusted,
CX_TypeClass_Decayed,
CX_TypeClass_ConstantArray,
+ CX_TypeClass_ArrayParameter,
CX_TypeClass_DependentSizedArray,
CX_TypeClass_IncompleteArray,
CX_TypeClass_VariableArray,
@@ -17,6 +18,7 @@ public enum CX_TypeClass
CX_TypeClass_BTFTagAttributed,
CX_TypeClass_BitInt,
CX_TypeClass_BlockPointer,
+ CX_TypeClass_CountAttributed,
CX_TypeClass_Builtin,
CX_TypeClass_Complex,
CX_TypeClass_Decltype,
@@ -31,6 +33,7 @@ public enum CX_TypeClass
CX_TypeClass_Elaborated,
CX_TypeClass_FunctionNoProto,
CX_TypeClass_FunctionProto,
+ CX_TypeClass_HLSLAttributedResource,
CX_TypeClass_InjectedClassName,
CX_TypeClass_MacroQualified,
CX_TypeClass_ConstantMatrix,
@@ -41,6 +44,7 @@ public enum CX_TypeClass
CX_TypeClass_ObjCInterface,
CX_TypeClass_ObjCTypeParam,
CX_TypeClass_PackExpansion,
+ CX_TypeClass_PackIndexing,
CX_TypeClass_Paren,
CX_TypeClass_Pipe,
CX_TypeClass_Pointer,
diff --git a/sources/ClangSharp.Interop/clangsharp/CX_UnaryExprOrTypeTrait.cs b/sources/ClangSharp.Interop/clangsharp/CX_UnaryExprOrTypeTrait.cs
index 24a2b68c..68e94aed 100644
--- a/sources/ClangSharp.Interop/clangsharp/CX_UnaryExprOrTypeTrait.cs
+++ b/sources/ClangSharp.Interop/clangsharp/CX_UnaryExprOrTypeTrait.cs
@@ -10,8 +10,9 @@ public enum CX_UnaryExprOrTypeTrait
CX_UETT_DataSizeOf,
CX_UETT_AlignOf,
CX_UETT_PreferredAlignOf,
+ CX_UETT_PtrAuthTypeDiscriminator,
CX_UETT_VecStep,
CX_UETT_OpenMPRequiredSimdAlign,
CX_UETT_VectorElements,
- CX_UETT_Last = -1 + 1 + 1 + 1 + 1 + 1 + 1 + 1,
+ CX_UETT_Last = -1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1,
}
diff --git a/sources/ClangSharp.Interop/clangsharp/clangsharp.cs b/sources/ClangSharp.Interop/clangsharp/clangsharp.cs
index 91979977..540329f0 100644
--- a/sources/ClangSharp.Interop/clangsharp/clangsharp.cs
+++ b/sources/ClangSharp.Interop/clangsharp/clangsharp.cs
@@ -1043,6 +1043,9 @@ public static partial class @clangsharp
[DllImport("libClangSharp", CallingConvention = CallingConvention.Cdecl, EntryPoint = "clangsharp_Type_getOriginalType", ExactSpelling = true)]
public static extern CXType Type_getOriginalType(CXType CT);
+ [DllImport("libClangSharp", CallingConvention = CallingConvention.Cdecl, EntryPoint = "clangsharp_Type_getSubstTemplateTypeParamAssociatedDecl", ExactSpelling = true)]
+ public static extern CXCursor Type_getSubstTemplateTypeParamAssociatedDecl(CXType CT);
+
[DllImport("libClangSharp", CallingConvention = CallingConvention.Cdecl, EntryPoint = "clangsharp_Type_getOwnedTagDecl", ExactSpelling = true)]
public static extern CXCursor Type_getOwnedTagDecl(CXType CT);
diff --git a/sources/ClangSharp.PInvokeGenerator/Abstractions/FunctionOrDelegateDesc.cs b/sources/ClangSharp.PInvokeGenerator/Abstractions/FunctionOrDelegateDesc.cs
index d05c90b3..8a369cb9 100644
--- a/sources/ClangSharp.PInvokeGenerator/Abstractions/FunctionOrDelegateDesc.cs
+++ b/sources/ClangSharp.PInvokeGenerator/Abstractions/FunctionOrDelegateDesc.cs
@@ -21,6 +21,7 @@ internal struct FunctionOrDelegateDesc
public bool HasBody { get; set; }
public bool IsInherited { get; set; }
public bool NeedsUnscopedRef { get; set; }
+ public string[]? ParameterTypes { get; set; }
public bool IsVirtual
{
@@ -65,6 +66,21 @@ readonly get
}
}
+ public bool IsReadOnly
+ {
+ readonly get
+ {
+ return (Flags & FunctionOrDelegateFlags.IsReadOnly) != 0;
+ }
+
+ set
+ {
+ Flags = value
+ ? Flags | FunctionOrDelegateFlags.IsReadOnly
+ : Flags & ~FunctionOrDelegateFlags.IsReadOnly;
+ }
+ }
+
public bool HasFnPtrCodeGen
{
readonly get
diff --git a/sources/ClangSharp.PInvokeGenerator/CSharp/CSharpOutputBuilder.Visit.cs b/sources/ClangSharp.PInvokeGenerator/CSharp/CSharpOutputBuilder.Visit.cs
index 522d5c79..7ffda523 100644
--- a/sources/ClangSharp.PInvokeGenerator/CSharp/CSharpOutputBuilder.Visit.cs
+++ b/sources/ClangSharp.PInvokeGenerator/CSharp/CSharpOutputBuilder.Visit.cs
@@ -89,7 +89,7 @@ public void WriteIid(string name, Guid value)
WriteIndented("ReadOnlySpan data = ");
- if (_generator.Config.GenerateLatestCode)
+ if (!_generator.Config.GenerateCompatibleCode)
{
WriteLine('[');
}
@@ -124,7 +124,7 @@ public void WriteIid(string name, Guid value)
WriteNewline();
DecreaseIndentation();
- if (_generator.Config.GenerateLatestCode)
+ if (!_generator.Config.GenerateCompatibleCode)
{
WriteIndented(']');
}
diff --git a/sources/ClangSharp.PInvokeGenerator/CSharp/CSharpOutputBuilder.VisitDecl.cs b/sources/ClangSharp.PInvokeGenerator/CSharp/CSharpOutputBuilder.VisitDecl.cs
index 712f8c81..5060f29d 100644
--- a/sources/ClangSharp.PInvokeGenerator/CSharp/CSharpOutputBuilder.VisitDecl.cs
+++ b/sources/ClangSharp.PInvokeGenerator/CSharp/CSharpOutputBuilder.VisitDecl.cs
@@ -372,6 +372,12 @@ public void BeginFunctionOrDelegate(in FunctionOrDelegateDesc desc, ref bool isM
Write(desc.ParentName);
Write('.');
Write(desc.EscapedName);
+ if (desc.ParameterTypes is not null)
+ {
+ Write('(');
+ Write(string.Join(", ", desc.ParameterTypes));
+ Write(')');
+ }
WriteLine("\" />");
}
else
@@ -511,6 +517,11 @@ public void BeginFunctionOrDelegate(in FunctionOrDelegateDesc desc, ref bool isM
Write("new ");
}
+ if (desc.IsReadOnly)
+ {
+ Write("readonly ");
+ }
+
if (desc.IsUnsafe)
{
if (!desc.IsCtxCxxRecord)
@@ -802,7 +813,7 @@ public void BeginStruct(in StructDesc desc)
Write(".Interface");
}
- if ((desc.Uuid is not null) && _generator.Config.GenerateGuidMember && _generator.Config.GenerateLatestCode)
+ if ((desc.Uuid is not null) && _generator.Config.GenerateGuidMember && !_generator.Config.GenerateCompatibleCode)
{
Write(desc.HasVtbl ? ", " : " : ");
Write("INativeGuid");
diff --git a/sources/ClangSharp.PInvokeGenerator/CSharp/CSharpOutputBuilder.cs b/sources/ClangSharp.PInvokeGenerator/CSharp/CSharpOutputBuilder.cs
index 30b8ccc1..f6d52daa 100644
--- a/sources/ClangSharp.PInvokeGenerator/CSharp/CSharpOutputBuilder.cs
+++ b/sources/ClangSharp.PInvokeGenerator/CSharp/CSharpOutputBuilder.cs
@@ -18,8 +18,8 @@ internal sealed partial class CSharpOutputBuilder(string name, PInvokeGenerator
private readonly PInvokeGenerator _generator = generator;
private readonly List _contents = [];
private readonly StringBuilder _currentLine = new StringBuilder();
- private readonly SortedSet _usingDirectives = [];
- private readonly SortedSet _staticUsingDirectives = [];
+ private readonly SortedSet _usingDirectives = new SortedSet(StringComparer.Ordinal);
+ private readonly SortedSet _staticUsingDirectives = new SortedSet(StringComparer.Ordinal);
private readonly string _indentationString = indentationString;
private readonly bool _isTestOutput = isTestOutput;
@@ -80,6 +80,8 @@ public void WriteBlockEnd()
public void Write(T value) => _ = _currentLine.Append(value);
+ public void Write(ReadOnlySpan value) => _ = _currentLine.Append(value);
+
public void WriteIndentation()
{
WriteNewlineIfNeeded();
@@ -102,6 +104,31 @@ public void WriteIndentedLine(T value)
WriteLine(value);
}
+ public void WriteLabel(string name)
+ {
+ if (_currentLine.Length >= _indentationString.Length)
+ {
+ var match = true;
+
+ for (var i = 0; i < _indentationString.Length; i++)
+ {
+ if (_currentLine[_currentLine.Length - i - 1] != _indentationString[_indentationString.Length - 1 - i])
+ {
+ match = false;
+ break;
+ }
+ }
+
+ if (match)
+ {
+ _ = _currentLine.Remove(_currentLine.Length - _indentationString.Length, _indentationString.Length);
+ }
+ }
+
+ Write(name);
+ WriteLine(':');
+ }
+
public void WriteLine(T value)
{
Write(value);
diff --git a/sources/ClangSharp.PInvokeGenerator/ClangSharp.PInvokeGenerator.csproj b/sources/ClangSharp.PInvokeGenerator/ClangSharp.PInvokeGenerator.csproj
index a8c82d4a..bfdcb5f6 100644
--- a/sources/ClangSharp.PInvokeGenerator/ClangSharp.PInvokeGenerator.csproj
+++ b/sources/ClangSharp.PInvokeGenerator/ClangSharp.PInvokeGenerator.csproj
@@ -3,7 +3,7 @@
ClangSharp
- net8.0
+ net10.0
diff --git a/sources/ClangSharp.PInvokeGenerator/FunctionOrDelegateFlags.cs b/sources/ClangSharp.PInvokeGenerator/FunctionOrDelegateFlags.cs
index aeb0eab6..3f4d5396 100644
--- a/sources/ClangSharp.PInvokeGenerator/FunctionOrDelegateFlags.cs
+++ b/sources/ClangSharp.PInvokeGenerator/FunctionOrDelegateFlags.cs
@@ -21,4 +21,5 @@ internal enum FunctionOrDelegateFlags
NeedsReturnFixup = 1 << 13,
IsCxxConstructor = 1 << 14,
IsManualImport = 1 << 15,
+ IsReadOnly = 1 << 16,
}
diff --git a/sources/ClangSharp.PInvokeGenerator/OutputBuilderFactory.cs b/sources/ClangSharp.PInvokeGenerator/OutputBuilderFactory.cs
index 5aa2100f..de4693e7 100644
--- a/sources/ClangSharp.PInvokeGenerator/OutputBuilderFactory.cs
+++ b/sources/ClangSharp.PInvokeGenerator/OutputBuilderFactory.cs
@@ -12,7 +12,7 @@ namespace ClangSharp;
internal sealed class OutputBuilderFactory(PInvokeGenerator generator)
{
private readonly bool _writeSourceLocation = generator.Config.GenerateSourceLocationAttribute;
- private readonly Dictionary _outputBuilders = [];
+ private readonly Dictionary _outputBuilders = new Dictionary(StringComparer.Ordinal);
public IEnumerable OutputBuilders => _outputBuilders.Values;
diff --git a/sources/ClangSharp.PInvokeGenerator/PInvokeGenerator.VisitDecl.cs b/sources/ClangSharp.PInvokeGenerator/PInvokeGenerator.VisitDecl.cs
index c1e270f5..88992629 100644
--- a/sources/ClangSharp.PInvokeGenerator/PInvokeGenerator.VisitDecl.cs
+++ b/sources/ClangSharp.PInvokeGenerator/PInvokeGenerator.VisitDecl.cs
@@ -7,11 +7,9 @@
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
-using System.Text.RegularExpressions;
using ClangSharp.Abstractions;
using ClangSharp.CSharp;
using static ClangSharp.Interop.CX_CastKind;
-using static ClangSharp.Interop.CX_CharacterKind;
using static ClangSharp.Interop.CX_DeclKind;
using static ClangSharp.Interop.CX_StmtClass;
using static ClangSharp.Interop.CX_StorageClass;
@@ -374,8 +372,7 @@ private void VisitEnumDecl(EnumDecl enumDecl)
{
var typeName = GetRemappedTypeName(enumDecl, context: null, enumDecl.IntegerType, out var nativeTypeName);
- desc = new EnumDesc()
- {
+ desc = new EnumDesc() {
AccessSpecifier = accessSpecifier,
TypeName = typeName,
EscapedName = escapedName,
@@ -501,6 +498,7 @@ private void VisitFunctionDecl(FunctionDecl functionDecl)
var name = GetRemappedCursorName(functionDecl);
var cxxMethodDecl = functionDecl as CXXMethodDecl;
+ uint overloadCount = 0;
if (cxxMethodDecl is not null and CXXConstructorDecl)
{
@@ -509,6 +507,11 @@ private void VisitFunctionDecl(FunctionDecl functionDecl)
name = GetRemappedCursorName(parent);
}
+ if (cxxMethodDecl is not null)
+ {
+ overloadCount = GetOverloadCount(cxxMethodDecl);
+ }
+
var isManualImport = _config.WithManualImports.Contains(name);
var className = name;
@@ -602,6 +605,7 @@ private void VisitFunctionDecl(FunctionDecl functionDecl)
IsCxx = cxxMethodDecl is not null,
IsStatic = isDllImport || (cxxMethodDecl is null) || cxxMethodDecl.IsStatic,
NeedsNewKeyword = NeedsNewKeyword(escapedName, functionDecl.Parameters),
+ IsReadOnly = IsReadonly(cxxMethodDecl),
IsUnsafe = IsUnsafe(functionDecl),
IsCtxCxxRecord = cxxRecordDecl is not null,
IsCxxRecordCtxUnsafe = cxxRecordDecl is not null && IsUnsafe(cxxRecordDecl),
@@ -622,6 +626,7 @@ private void VisitFunctionDecl(FunctionDecl functionDecl)
}
},
CustomAttrGeneratorData = (functionDecl, _outputBuilder, this),
+ ParameterTypes = overloadCount > 1 ? [.. functionDecl.Parameters.Select(param => GetTargetTypeName(param, out var _))] : null,
};
Debug.Assert(_outputBuilder is not null);
@@ -655,8 +660,7 @@ private void VisitFunctionDecl(FunctionDecl functionDecl)
if (needsReturnFixup)
{
_outputBuilder.WriteParameterSeparator();
- parameterDesc = new()
- {
+ parameterDesc = new() {
Name = "_result",
Type = $"{returnTypeName}*"
};
@@ -678,8 +682,7 @@ private void VisitFunctionDecl(FunctionDecl functionDecl)
{
_outputBuilder.WriteParameterSeparator();
}
- var parameterDesc = new ParameterDesc
- {
+ var parameterDesc = new ParameterDesc {
Name = "",
Type = "__arglist"
};
@@ -808,9 +811,11 @@ void VisitCtorInitializers(CXXConstructorDecl cxxConstructorDecl, int firstCtorI
{
continue;
}
-
- var memberRef = (Ref)cxxConstructorDecl.CursorChildren[i];
- var memberInit = (Stmt)cxxConstructorDecl.CursorChildren[++i];
+ if (cxxConstructorDecl.CursorChildren[i] is not Ref memberRef
+ || cxxConstructorDecl.CursorChildren[++i] is not Stmt memberInit)
+ {
+ continue;
+ }
if (memberInit is ImplicitValueInitExpr)
{
@@ -820,7 +825,7 @@ void VisitCtorInitializers(CXXConstructorDecl cxxConstructorDecl, int firstCtorI
var memberRefName = GetRemappedCursorName(memberRef.Referenced);
var memberInitName = memberInit.Spelling;
- if (memberInit is CastExpr {SubExprAsWritten: DeclRefExpr declRefExpr})
+ if (memberInit is CastExpr { SubExprAsWritten: DeclRefExpr declRefExpr })
{
memberInitName = GetRemappedCursorName(declRefExpr.Decl);
}
@@ -852,6 +857,7 @@ void VisitCtorInitializers(CXXConstructorDecl cxxConstructorDecl, int firstCtorI
{
_outputBuilder.EndConstructorInitializer();
}
+
}
}
}
@@ -865,7 +871,7 @@ private void VisitIndirectFieldDecl(IndirectFieldDecl indirectFieldDecl)
return;
}
- if (IsPrevContextDecl(out var prevContext, out _) && prevContext.IsAnonymous)
+ if (IsPrevContextDecl(out var prevContext, out _) && prevContext.IsAnonymousStructOrUnion)
{
// We shouldn't process indirect fields where the prev context is an anonymous record decl
return;
@@ -880,7 +886,7 @@ private void VisitIndirectFieldDecl(IndirectFieldDecl indirectFieldDecl)
var contextNameParts = new Stack();
var contextTypeParts = new Stack();
- while (rootRecordDecl.IsAnonymous && (rootRecordDecl.Parent is RecordDecl parentRecordDecl))
+ while (rootRecordDecl.IsAnonymousStructOrUnion && (rootRecordDecl.Parent is RecordDecl parentRecordDecl))
{
// The name of a field of an anonymous type should be same as the type's name minus the
// type kind tag at the end and the leading `_`.
@@ -937,7 +943,7 @@ private void VisitIndirectFieldDecl(IndirectFieldDecl indirectFieldDecl)
ParentName = GetRemappedCursorName(parent),
Offset = null,
NeedsNewKeyword = false,
- NeedsUnscopedRef = _config.GenerateLatestCode && !fieldDecl.IsBitField,
+ NeedsUnscopedRef = !_config.GenerateCompatibleCode && !fieldDecl.IsBitField,
Location = fieldDecl.Location,
HasBody = true,
WriteCustomAttrs = static context => {
@@ -1103,13 +1109,13 @@ private void VisitIndirectFieldDecl(IndirectFieldDecl indirectFieldDecl)
code.Write(arraySize);
code.Write(')');
}
- else if (!_config.GenerateLatestCode || arraySize == 1)
+ else if (_config.GenerateCompatibleCode || arraySize == 1)
{
code.Write(".AsSpan(");
if (arraySize == 1)
{
- if (TryGetRemappedValue(indirectFieldDecl, _config.WithLengths, out var length))
+ if (TryGetRemappedValue(indirectFieldDecl, _config._withLengths, out var length))
{
code.Write(length);
}
@@ -1312,8 +1318,7 @@ void ForTypedefDecl(ParmVarDecl parmVarDecl, TypedefDecl typedefDecl)
escapedName += index;
}
- var desc = new ParameterDesc
- {
+ var desc = new ParameterDesc {
Name = escapedName,
Type = typeName,
NativeTypeName = nativeTypeName,
@@ -1384,7 +1389,7 @@ private void VisitRecordDecl(RecordDecl recordDecl)
var maxAlignm = recordDecl.Fields.Any() ? recordDecl.Fields.Max((fieldDecl) => Math.Max(fieldDecl.Type.Handle.AlignOf, 1)) : alignment;
var isTopLevelStruct = _config.WithTypes.TryGetValue(name, out var withType) && withType.Equals("struct", StringComparison.Ordinal);
- var generateTestsClass = !recordDecl.IsAnonymous && recordDecl.DeclContext is not RecordDecl;
+ var generateTestsClass = !recordDecl.IsAnonymousStructOrUnion && recordDecl.DeclContext is not RecordDecl;
var testOutputStarted = false;
var nullableUuid = (Guid?)null;
@@ -1404,7 +1409,15 @@ private void VisitRecordDecl(RecordDecl recordDecl)
var className = GetClass(uuidName);
_testOutputBuilder.AddUsingDirective("System");
- _testOutputBuilder.AddUsingDirective($"static {GetNamespace(className)}.{className}");
+
+ if (_config.DontUseUsingStaticsForGuidMember)
+ {
+ _testOutputBuilder.AddUsingDirective($"{GetNamespace(className)}");
+ }
+ else
+ {
+ _testOutputBuilder.AddUsingDirective($"static {GetNamespace(className)}.{className}");
+ }
_testOutputBuilder.WriteIndented("/// Validates that the of the (StringComparer.Ordinal);
}
if (desc.LayoutAttribute is not null)
@@ -1619,13 +1638,41 @@ private void VisitRecordDecl(RecordDecl recordDecl)
_outputBuilder.EmitUsingDirective("System");
_outputBuilder.EmitUsingDirective("System.Runtime.CompilerServices");
- _outputBuilder.EmitUsingDirective($"static {GetNamespace(uuidClassName)}.{uuidClassName}");
+ if (_config.DontUseUsingStaticsForGuidMember)
+ {
+ _outputBuilder.EmitUsingDirective($"{GetNamespace(uuidClassName)}");
+ }
+ else
+ {
+ _outputBuilder.EmitUsingDirective($"static {GetNamespace(uuidClassName)}.{uuidClassName}");
+ }
+
+ var usableUuidName = uuidName;
+ if (_config.DontUseUsingStaticsForGuidMember)
+ {
+ usableUuidName = $"{uuidClassName}.{usableUuidName}";
+ }
+
_outputBuilder.BeginValue(in valueDesc);
var code = _outputBuilder.BeginCSharpCode();
- code.Write("(Guid*)Unsafe.AsPointer(ref Unsafe.AsRef(in ");
- code.Write(uuidName);
- code.Write("))");
+
+ code.Write("(Guid*)Unsafe.AsPointer(");
+
+ if (!_config.GenerateLatestCode)
+ {
+ code.Write("ref Unsafe.AsRef(");
+ }
+
+ code.Write("in ");
+ code.Write(usableUuidName);
+ code.Write(')');
+
+ if (!_config.GenerateLatestCode)
+ {
+ code.Write(')');
+ }
+
_outputBuilder.EndCSharpCode(code);
_outputBuilder.EndValue(in valueDesc);
@@ -2104,8 +2151,7 @@ void OutputVtblEntry(CXXRecordDecl cxxRecordDecl, CXXMethodDecl cxxMethodDecl)
var remappedName = FixupNameForMultipleHits(cxxMethodDecl);
var escapedName = EscapeAndStripMethodName(remappedName);
- var desc = new FieldDesc
- {
+ var desc = new FieldDesc {
AccessSpecifier = AccessSpecifier.Public,
NativeTypeName = nativeTypeName,
EscapedName = escapedName,
@@ -2180,6 +2226,7 @@ void OutputVtblHelperMethod(CXXRecordDecl cxxRecordDecl, CXXMethodDecl cxxMethod
HasFnPtrCodeGen = !_config.ExcludeFnptrCodegen,
IsCtxCxxRecord = true,
IsCxxRecordCtxUnsafe = IsUnsafe(cxxRecordDecl),
+ IsReadOnly = IsReadonly(cxxMethodDecl),
IsUnsafe = true,
NeedsReturnFixup = needsReturnFixup,
ReturnType = returnTypeName,
@@ -2302,7 +2349,27 @@ void OutputVtblHelperMethod(CXXRecordDecl cxxRecordDecl, CXXMethodDecl cxxMethod
{
body.Write('(');
body.Write(escapedCXXRecordDeclName);
- body.Write("*)Unsafe.AsPointer(ref this)");
+ body.Write("*)Unsafe.AsPointer(");
+
+ if (IsReadonly(cxxMethodDecl))
+ {
+ if (!_config.GenerateLatestCode)
+ {
+ body.Write("ref Unsafe.AsRef(");
+ }
+
+ body.Write("in this");
+
+ if (!_config.GenerateLatestCode)
+ {
+ body.Write(')');
+ }
+ }
+ else
+ {
+ body.Write("ref this");
+ }
+ body.Write(')');
}
body.EndMarker("param");
@@ -2681,204 +2748,282 @@ void VisitBitfieldDecl(FieldDecl fieldDecl, BitfieldDesc[] bitfieldDescs, Record
_outputBuilder.BeginField(in desc);
_outputBuilder.WriteRegularField(typeName, escapedName);
_outputBuilder.BeginBody();
- _outputBuilder.BeginGetter(_config.GenerateAggressiveInlining, isReadOnly: !Config.GenerateCompatibleCode);
- var code = _outputBuilder.BeginCSharpCode();
-
- code.WriteIndented("return ");
var recordDeclName = GetCursorName(recordDecl);
- var isSmallType = currentSize < 4;
- var isRemappedToSelf = _config.RemappedNames.TryGetValue(typeName, out var remappedTypeName) && typeName.Equals(remappedTypeName, StringComparison.Ordinal);
- var isTypeMismatch = type != builtinTypeBacking;
- var isUnsignedToSigned = !isTypeBackingSigned && isTypeSigned;
+ // Small types become uint32/int32s after shifting
+ var isSmallType = fieldDecl.Type.Handle.SizeOf < 4;
+ var isSmallTypeBacking = currentSize < 4;
- var needsCast = isSmallType || isRemappedToSelf || isTypeMismatch || isUnsignedToSigned;
- var needsParenFirst = !isSmallType && isUnsignedToSigned;
- var needsParenSecond = !needsParenFirst || isRemappedToSelf;
+ // Check if field/backing types match
+ var isTypeMismatch = type != builtinTypeBacking;
+ // Signed types are sign extended when shifted
+ var isUnsignedToSigned = !isTypeBackingSigned && isTypeSigned;
+
+ // Check if type is directly shiftable/maskable
+ // Remapped types are not guaranteed to be shiftable or maskable
+ // Enums are maskable, but not shiftable
+ var isTypeLikelyRemapped = !isTypeMismatch && (typeName != typeNameBacking);
+ var isTypeAnEnum = IsType(fieldDecl);
+
+ // Main cases:
// backing int, current int (value << cns) >> cns
// backing int, current uint (uint)((value >> cns) & msk)
- // backing uint, current int ((int)value << cns) >> cns
+ // backing uint, current int (int)(value << cns) >> cns
// backing uint, current uint (value >> cns) & msk
// backing uint, current byte (byte)((value >> cns) & msk)
- // backing uint, current sbyte (sbyte)((value << cns) >> cns)
+ // backing uint, current sbyte (sbyte)((sbyte)(value << cns) >> cns)
- if (needsCast)
+ // Getter
{
- code.Write('(');
- code.BeginMarker("typeName");
- code.Write(typeName);
- code.EndMarker("typeName");
- code.Write(")(");
- }
+ _outputBuilder.BeginGetter(_config.GenerateAggressiveInlining,
+ isReadOnly: !Config.GenerateCompatibleCode);
+ var code = _outputBuilder.BeginCSharpCode();
- if ((!needsParenFirst && (bitfieldOffset != 0)) || (!isUnsignedToSigned && isTypeSigned))
- {
- code.Write('(');
- }
+ code.WriteIndented("return ");
- if (!string.IsNullOrWhiteSpace(contextName))
- {
- code.BeginMarker("contextName");
- code.Write(contextName);
- code.EndMarker("contextName");
- code.Write('.');
- }
+ var needsCastToFinal = (isSmallType || isTypeMismatch || isUnsignedToSigned) && !isTypeAnEnum;
- code.BeginMarker("bitfieldName");
- code.Write(bitfieldName);
- code.EndMarker("bitfieldName");
+ // This is to handle the "backing uint, current sbyte" case
+ var needsCastToFinalAgain = isUnsignedToSigned && isSmallType;
+ if (needsCastToFinalAgain)
+ {
+ code.Write('(');
+ code.BeginMarker("typeName");
+ code.Write(typeName);
+ code.EndMarker("typeName");
+ code.Write(")(");
+ }
- if (isTypeSigned)
- {
- code.Write(" << ");
- code.BeginMarker("remainingBitsMinusBitWidth");
- code.Write(remainingBits - fieldDecl.BitWidthValue);
- code.EndMarker("remainingBitsMinusBitWidth");
- code.Write(')');
+ if (needsCastToFinal)
+ {
+ code.Write('(');
+ code.BeginMarker("typeName");
+ code.Write(typeName);
+ code.EndMarker("typeName");
+ code.Write(")");
+ }
- code.Write(" >> ");
- code.BeginMarker("currentSizeMinusBitWidth");
- code.Write((currentSize * 8) - fieldDecl.BitWidthValue);
- code.EndMarker("currentSizeMinusBitWidth");
- }
- else
- {
- if (bitfieldOffset != 0)
+ var needsCastToFinalParen = needsCastToFinal && !isUnsignedToSigned;
+ if (needsCastToFinalParen)
{
- code.Write(" >> ");
- code.BeginMarker("bitfieldOffset");
- code.Write(bitfieldOffset);
- code.EndMarker("bitfieldOffset");
+ code.Write('(');
+ }
+
+ var needsCastBeforeOp = isTypeLikelyRemapped || isTypeAnEnum;
+ if (needsCastBeforeOp)
+ {
+ code.Write('(');
+ code.BeginMarker("typeName");
+ code.Write(typeName);
+ code.EndMarker("typeName");
+ code.Write(")(");
+ }
+
+ if (isTypeSigned)
+ {
+ code.Write('(');
+
+ if (!string.IsNullOrWhiteSpace(contextName))
+ {
+ code.BeginMarker("contextName");
+ code.Write(contextName);
+ code.EndMarker("contextName");
+ code.Write('.');
+ }
+
+ code.BeginMarker("bitfieldName");
+ code.Write(bitfieldName);
+ code.EndMarker("bitfieldName");
+
+ code.Write(" << ");
+ code.BeginMarker("remainingBitsMinusBitWidth");
+ code.Write(remainingBits - fieldDecl.BitWidthValue);
+ code.EndMarker("remainingBitsMinusBitWidth");
+
code.Write(')');
+
+ code.Write(" >> ");
+ code.BeginMarker("currentSizeMinusBitWidth");
+ code.Write((currentSize * 8) - fieldDecl.BitWidthValue);
+ code.EndMarker("currentSizeMinusBitWidth");
}
+ else
+ {
+ var needsOffset = bitfieldOffset != 0;
+ if (needsOffset)
+ {
+ code.Write('(');
+ }
- code.Write(" & 0x");
- code.BeginMarker("bitwidthHexStringBacking");
- code.Write(bitwidthHexStringBacking);
- code.EndMarker("bitwidthHexStringBacking");
- }
+ if (!string.IsNullOrWhiteSpace(contextName))
+ {
+ code.BeginMarker("contextName");
+ code.Write(contextName);
+ code.EndMarker("contextName");
+ code.Write('.');
+ }
- if (needsCast && needsParenSecond)
- {
- code.Write(')');
- }
+ code.BeginMarker("bitfieldName");
+ code.Write(bitfieldName);
+ code.EndMarker("bitfieldName");
- code.WriteSemicolon();
- code.WriteNewline();
- _outputBuilder.EndCSharpCode(code);
- _outputBuilder.EndGetter();
+ if (needsOffset)
+ {
+ code.Write(" >> ");
+ code.BeginMarker("bitfieldOffset");
+ code.Write(bitfieldOffset);
+ code.EndMarker("bitfieldOffset");
- _outputBuilder.BeginSetter(_config.GenerateAggressiveInlining);
- code = _outputBuilder.BeginCSharpCode();
- code.WriteIndentation();
+ code.Write(')');
+ }
- if (!string.IsNullOrWhiteSpace(contextName))
- {
- code.BeginMarker("contextName");
- code.Write(contextName);
- code.EndMarker("contextName");
- code.Write('.');
- }
+ code.Write(" & 0x");
+ code.BeginMarker("bitwidthHexStringBacking");
+ code.Write(bitwidthHexStringBacking);
+ code.EndMarker("bitwidthHexStringBacking");
+ }
- code.BeginMarker("bitfieldName");
- code.Write(bitfieldName);
- code.EndMarker("bitfieldName");
+ if (needsCastBeforeOp)
+ {
+ code.Write(')');
+ }
- code.Write(" = ");
+ if (needsCastToFinalParen)
+ {
+ code.Write(')');
+ }
- if (currentSize < 4)
- {
- code.Write('(');
- code.BeginMarker("typeNameBacking");
- code.Write(typeNameBacking);
- code.EndMarker("typeNameBacking");
- code.Write(")(");
- }
+ if (needsCastToFinalAgain)
+ {
+ code.Write(')');
+ }
- code.Write('(');
+ code.WriteSemicolon();
+ code.WriteNewline();
+ _outputBuilder.EndCSharpCode(code);
+ _outputBuilder.EndGetter();
+ }
- if (!string.IsNullOrWhiteSpace(contextName))
+ // Setter
{
- code.Write(contextName);
- code.Write('.');
- }
+ _outputBuilder.BeginSetter(_config.GenerateAggressiveInlining);
+ var code = _outputBuilder.BeginCSharpCode();
+ code.WriteIndentation();
- code.Write(bitfieldName);
+ if (!string.IsNullOrWhiteSpace(contextName))
+ {
+ code.BeginMarker("contextName");
+ code.Write(contextName);
+ code.EndMarker("contextName");
+ code.Write('.');
+ }
- code.Write(" & ~");
+ code.BeginMarker("bitfieldName");
+ code.Write(bitfieldName);
+ code.EndMarker("bitfieldName");
- if (bitfieldOffset != 0)
- {
+ code.Write(" = ");
+
+ var needsCastToFinal = isSmallTypeBacking;
+ if (needsCastToFinal)
+ {
+ code.Write('(');
+ code.BeginMarker("typeNameBacking");
+ code.Write(typeNameBacking);
+ code.EndMarker("typeNameBacking");
+ code.Write(")(");
+ }
+
+ // Zero out target bits
code.Write('(');
- }
- code.Write("0x");
- code.BeginMarker("bitwidthHexStringBacking");
- code.Write(bitwidthHexStringBacking);
- code.EndMarker("bitwidthHexStringBacking");
+ if (!string.IsNullOrWhiteSpace(contextName))
+ {
+ code.Write(contextName);
+ code.Write('.');
+ }
- if (bitfieldOffset != 0)
- {
- code.Write(" << ");
- code.BeginMarker("bitfieldOffset");
- code.Write(bitfieldOffset);
- code.EndMarker("bitfieldOffset");
- code.Write(')');
- }
+ code.Write(bitfieldName);
- code.Write(") | ");
+ code.Write(" & ~");
- if ((builtinType != builtinTypeBacking) && !IsType(fieldDecl))
- {
- code.Write('(');
- code.Write(typeNameBacking);
- code.Write(')');
- }
+ if (bitfieldOffset != 0)
+ {
+ code.Write('(');
+ }
- code.Write('(');
+ code.Write("0x");
+ code.BeginMarker("bitwidthHexStringBacking");
+ code.Write(bitwidthHexStringBacking);
+ code.EndMarker("bitwidthHexStringBacking");
- if (bitfieldOffset != 0)
- {
- code.Write('(');
- }
+ if (bitfieldOffset != 0)
+ {
+ code.Write(" << ");
+ code.BeginMarker("bitfieldOffset");
+ code.Write(bitfieldOffset);
+ code.EndMarker("bitfieldOffset");
+ code.Write(')');
+ }
+
+ // Write to target bits
+ code.Write(") | ");
+
+ var needsCastBeforeLogicalOr = isTypeMismatch && !isTypeAnEnum;
+ if (needsCastBeforeLogicalOr)
+ {
+ code.Write('(');
+ code.Write(typeNameBacking);
+ code.Write(")");
+ }
- if (IsType(fieldDecl) || isRemappedToSelf)
- {
code.Write('(');
- code.Write(typeNameBacking);
- code.Write(")(value)");
- }
- else
- {
- code.Write("value");
- }
- code.Write(" & 0x");
- code.BeginMarker("bitwidthHexString");
- code.Write(bitwidthHexString);
- code.EndMarker("bitwidthHexString");
+ if (bitfieldOffset != 0)
+ {
+ code.Write('(');
+ }
+
+ var needsCastBeforeOp = isTypeLikelyRemapped || isTypeAnEnum;
+ if (needsCastBeforeOp)
+ {
+ code.Write('(');
+ code.Write(typeNameBacking);
+ code.Write(")(value)");
+ }
+ else
+ {
+ code.Write("value");
+ }
- if (bitfieldOffset != 0)
- {
- code.Write(") << ");
- code.Write(bitfieldOffset);
- }
+ code.Write(" & 0x");
+ code.BeginMarker("bitwidthHexString");
+ code.Write(bitwidthHexString);
+ code.EndMarker("bitwidthHexString");
- code.Write(')');
+ if (bitfieldOffset != 0)
+ {
+ code.Write(") << ");
+ code.Write(bitfieldOffset);
+ }
- if (currentSize < 4)
- {
code.Write(')');
+
+ if (needsCastToFinal)
+ {
+ code.Write(')');
+ }
+
+ code.WriteSemicolon();
+ code.WriteNewline();
+ _outputBuilder.EndCSharpCode(code);
+ _outputBuilder.EndSetter();
}
- code.WriteSemicolon();
- code.WriteNewline();
- _outputBuilder.EndCSharpCode(code);
- _outputBuilder.EndSetter();
_outputBuilder.EndBody();
_outputBuilder.EndField(in desc);
_outputBuilder.WriteDivider();
@@ -2919,7 +3064,7 @@ void VisitConstantOrIncompleteArrayFieldDecl(RecordDecl recordDecl, FieldDecl co
var arraySize = Math.Max((arrayType as ConstantArrayType)?.Size ?? 0, 1);
var totalSize = arraySize;
var totalSizeString = $"{arraySize}";
- var sizePerDimension = new List<(long index, long size)>() {(0, arraySize) };
+ var sizePerDimension = new List<(long index, long size)>() { (0, arraySize) };
while (IsTypeConstantOrIncompleteArray(recordDecl, elementType, out var subArrayType))
{
@@ -2941,7 +3086,7 @@ void VisitConstantOrIncompleteArrayFieldDecl(RecordDecl recordDecl, FieldDecl co
AddDiagnostic(DiagnosticLevel.Info, $"{escapedName} (constant array field) has a size of 0", constantOrIncompleteArray);
}
- if (!_config.GenerateLatestCode || (totalSize <= 1) || isUnsafeElementType)
+ if (_config.GenerateCompatibleCode || (totalSize <= 1) || isUnsafeElementType)
{
totalSizeString = null;
}
@@ -3067,7 +3212,7 @@ void VisitConstantOrIncompleteArrayFieldDecl(RecordDecl recordDecl, FieldDecl co
}
else if (totalSizeString is null)
{
- _outputBuilder.BeginIndexer(AccessSpecifier.Public, isUnsafe: false, needsUnscopedRef: _config.GenerateLatestCode);
+ _outputBuilder.BeginIndexer(AccessSpecifier.Public, isUnsafe: false, needsUnscopedRef: !_config.GenerateCompatibleCode);
_outputBuilder.WriteIndexer($"ref {arrayTypeName}");
_outputBuilder.BeginIndexerParameters();
var param = new ParameterDesc {
@@ -3088,6 +3233,7 @@ void VisitConstantOrIncompleteArrayFieldDecl(RecordDecl recordDecl, FieldDecl co
if (arraySize == 1)
{
+ code.AddUsingDirective("System.Runtime.CompilerServices");
code.Write("Unsafe.Add(ref e0, index)");
}
else
@@ -3112,7 +3258,7 @@ void VisitConstantOrIncompleteArrayFieldDecl(RecordDecl recordDecl, FieldDecl co
ReturnType = $"Span<{arrayTypeName}>",
Location = constantOrIncompleteArray.Location,
HasBody = true,
- NeedsUnscopedRef = _config.GenerateLatestCode,
+ NeedsUnscopedRef = !_config.GenerateCompatibleCode,
};
var isUnsafe = false;
@@ -3277,7 +3423,7 @@ void ForUnderlyingType(TypedefDecl typedefDecl, Type underlyingType, bool onlyHa
{
if (!_allValidNameRemappings.TryGetValue(underlyingName, out var allRemappings))
{
- allRemappings = [];
+ allRemappings = new HashSet(QualifiedNameComparer.Default);
_allValidNameRemappings[underlyingName] = allRemappings;
}
_ = allRemappings.Add(typedefName);
@@ -3287,7 +3433,7 @@ void ForUnderlyingType(TypedefDecl typedefDecl, Type underlyingType, bool onlyHa
{
if (!_traversedValidNameRemappings.TryGetValue(underlyingName, out var traversedRemappings))
{
- traversedRemappings = [];
+ traversedRemappings = new HashSet(QualifiedNameComparer.Default);
_traversedValidNameRemappings[underlyingName] = traversedRemappings;
}
_ = traversedRemappings.Add(typedefName);
@@ -3429,7 +3575,7 @@ private void VisitVarDecl(VarDecl varDecl)
case CX_SLK_UTF32:
{
- typeName = (_config.GenerateLatestCode && flags.HasFlag(ValueFlags.Constant)) ? "ReadOnlySpan" : "uint[]";
+ typeName = (!_config.GenerateCompatibleCode && flags.HasFlag(ValueFlags.Constant)) ? "ReadOnlySpan" : "uint[]";
break;
}
@@ -3840,7 +3986,7 @@ private bool IsConstant(string targetTypeName, Expr initExpr)
}
// case CX_StmtClass_NoInitExpr:
- // case CX_StmtClass_OMPArraySectionExpr:
+ // case CX_StmtClass_ArraySectionExpr:
// case CX_StmtClass_ObjCArrayLiteral:
// case CX_StmtClass_ObjCAvailabilityCheckExpr:
// case CX_StmtClass_ObjCBoolLiteralExpr:
diff --git a/sources/ClangSharp.PInvokeGenerator/PInvokeGenerator.VisitStmt.cs b/sources/ClangSharp.PInvokeGenerator/PInvokeGenerator.VisitStmt.cs
index 3fd39a09..5eaf6372 100644
--- a/sources/ClangSharp.PInvokeGenerator/PInvokeGenerator.VisitStmt.cs
+++ b/sources/ClangSharp.PInvokeGenerator/PInvokeGenerator.VisitStmt.cs
@@ -41,7 +41,60 @@ private void VisitBinaryOperator(BinaryOperator binaryOperator)
outputBuilder.Write(' ');
outputBuilder.Write(binaryOperator.OpcodeStr);
outputBuilder.Write(' ');
- Visit(binaryOperator.RHS);
+
+ if (binaryOperator.IsShiftOp || binaryOperator.IsShiftAssignOp)
+ {
+ // RHS of shift operation in C# must be an int
+
+ // Negative shifts are undefined behavior in C/C++, but still needs to have a compilable output
+ var isNegated = binaryOperator.RHS is UnaryOperator { Opcode: CXUnaryOperator_Minus };
+ var sign = isNegated ? -1 : 1;
+
+ var rhs = isNegated ? ((UnaryOperator)binaryOperator.RHS).SubExpr : binaryOperator.RHS;
+ switch (rhs)
+ {
+ case IntegerLiteral literal:
+ {
+ var value = sign * literal.Value;
+ if (value is > int.MaxValue or < int.MinValue)
+ {
+ // Literal is in int32 range
+ outputBuilder.Write("(int)(");
+ outputBuilder.Write(sign * literal.Value);
+ outputBuilder.Write(")");
+ }
+ else
+ {
+ // Literal is not in int32 range
+ outputBuilder.Write(sign * literal.Value);
+ }
+
+ break;
+ }
+ // Already the correct type or implicitly castable
+ case { Type.Kind: CXType_Int or CXType_UShort or CXType_Short or CXType_Char_U or CXType_Char_S or CXType_UChar or CXType_SChar }:
+ case { Type.Kind: CXType_Long } when _config is { GenerateUnixTypes: false }:
+ case { Type.Kind: CXType_Char16 } when _config is { GenerateDisableRuntimeMarshalling: false }:
+ case { Type.Kind: CXType_WChar } when _config is { GenerateDisableRuntimeMarshalling: false, GenerateUnixTypes: false }:
+ {
+ Visit(binaryOperator.RHS);
+ break;
+ }
+ // Fallback
+ default:
+ {
+ outputBuilder.Write("(int)(");
+ Visit(binaryOperator.RHS);
+ outputBuilder.Write(")");
+ break;
+ }
+ }
+ }
+ else
+ {
+ Visit(binaryOperator.RHS);
+ }
+
StopCSharpCode();
}
@@ -194,7 +247,7 @@ private void VisitCallExpr(CallExpr callExpr)
{
var args = callExpr.Args;
- if (Config.GenerateLatestCode)
+ if (!Config.GenerateCompatibleCode)
{
outputBuilder.AddUsingDirective("System.Runtime.InteropServices");
outputBuilder.Write("NativeMemory.Copy");
@@ -253,13 +306,13 @@ private void VisitCallExpr(CallExpr callExpr)
break;
}
- if (Config.GenerateLatestCode)
+ if (!Config.GenerateCompatibleCode)
{
args = [args[0], args[2], args[1]];
}
}
- if (Config.GenerateLatestCode)
+ if (!Config.GenerateCompatibleCode)
{
outputBuilder.AddUsingDirective("System.Runtime.InteropServices");
outputBuilder.Write("NativeMemory.Fill");
@@ -356,7 +409,27 @@ void VisitArgs(CallExpr callExpr, IReadOnlyList? args = null)
outputBuilder.AddUsingDirective("System.Runtime.CompilerServices");
outputBuilder.Write('(');
outputBuilder.Write(referenceTypeName);
- outputBuilder.Write(")Unsafe.AsPointer(ref this)");
+ outputBuilder.Write(")Unsafe.AsPointer(");
+
+ if (referenceType.IsLocalConstQualified)
+ {
+ if (!_config.GenerateLatestCode)
+ {
+ outputBuilder.Write("ref Unsafe.AsRef(");
+ }
+
+ outputBuilder.Write("in this");
+
+ if (!_config.GenerateLatestCode)
+ {
+ outputBuilder.Write(')');
+ }
+ }
+ else
+ {
+ outputBuilder.Write("ref this");
+ }
+ outputBuilder.Write(')');
needsComma = true;
continue;
@@ -379,7 +452,27 @@ void VisitArgs(CallExpr callExpr, IReadOnlyList? args = null)
else if (IsStmtAsWritten(arg, out _) && (functionName == "memcpy"))
{
outputBuilder.AddUsingDirective("System.Runtime.CompilerServices");
- outputBuilder.Write("Unsafe.AsPointer(ref this)");
+ outputBuilder.Write("Unsafe.AsPointer(");
+
+ if (functionProtoType.ParamTypes[i].IsLocalConstQualified)
+ {
+ if (!_config.GenerateLatestCode)
+ {
+ outputBuilder.Write("ref Unsafe.AsRef(");
+ }
+
+ outputBuilder.Write("in this");
+
+ if (!_config.GenerateLatestCode)
+ {
+ outputBuilder.Write(')');
+ }
+ }
+ else
+ {
+ outputBuilder.Write("ref this");
+ }
+ outputBuilder.Write(')');
needsComma = true;
continue;
@@ -751,7 +844,7 @@ private void VisitCXXOperatorCallExpr(CXXOperatorCallExpr cxxOperatorCallExpr)
{
Visit(args[0]);
outputBuilder.Write(' ');
- outputBuilder.Write(functionDeclName[8..]);
+ outputBuilder.Write(functionDeclName.AsSpan()[8..]);
outputBuilder.Write(' ');
Visit(args[1]);
StopCSharpCode();
@@ -760,7 +853,7 @@ private void VisitCXXOperatorCallExpr(CXXOperatorCallExpr cxxOperatorCallExpr)
case "operator~":
{
- outputBuilder.Write(functionDeclName[8..]);
+ outputBuilder.Write(functionDeclName.AsSpan()[8..]);
Visit(args[0]);
StopCSharpCode();
return;
@@ -1108,7 +1201,7 @@ private void VisitFloatingLiteral(FloatingLiteral floatingLiteral)
var outputBuilder = StartCSharpCode();
if (floatingLiteral.ValueString.EndsWith(".f", StringComparison.Ordinal))
{
- outputBuilder.Write(floatingLiteral.ValueString[0..^1]);
+ outputBuilder.Write(floatingLiteral.ValueString.AsSpan()[..^1]);
outputBuilder.Write("0f");
}
else
@@ -1703,7 +1796,7 @@ void HandleUnmanagedConstant(CSharpOutputBuilder outputBuilder, InitListExpr ini
outputBuilder.WriteIndented("ReadOnlySpan data = ");
- if (_config.GenerateLatestCode)
+ if (!_config.GenerateCompatibleCode)
{
outputBuilder.WriteLine("[");
}
@@ -1719,7 +1812,7 @@ void HandleUnmanagedConstant(CSharpOutputBuilder outputBuilder, InitListExpr ini
outputBuilder.WriteNewline();
outputBuilder.DecreaseIndentation();
- if (_config.GenerateLatestCode)
+ if (!_config.GenerateCompatibleCode)
{
outputBuilder.WriteIndented(']');
}
@@ -1901,76 +1994,83 @@ void HandleUnmanagedConstant(CSharpOutputBuilder outputBuilder, InitListExpr ini
private void VisitIntegerLiteral(IntegerLiteral integerLiteral)
{
- var valueString = integerLiteral.ValueString;
+ var valueString = integerLiteral.ValueString.AsSpan();
+ var valueSuffix = "";
if (valueString.EndsWith("ui8", StringComparison.OrdinalIgnoreCase))
{
- valueString = valueString[0..^3];
+ valueString = valueString[..^3];
}
else if (valueString.EndsWith("i8", StringComparison.OrdinalIgnoreCase))
{
- valueString = valueString[0..^2];
+ valueString = valueString[..^2];
}
else if (valueString.EndsWith("ui16", StringComparison.OrdinalIgnoreCase))
{
- valueString = valueString[0..^4];
+ valueString = valueString[..^4];
}
else if (valueString.EndsWith("i16", StringComparison.OrdinalIgnoreCase))
{
- valueString = valueString[0..^3];
+ valueString = valueString[..^3];
}
else if (valueString.EndsWith("ui32", StringComparison.OrdinalIgnoreCase))
{
- valueString = valueString[0..^4] + "U";
+ valueString = valueString[..^4];
+ valueSuffix = "U";
}
else if (valueString.EndsWith("i32", StringComparison.OrdinalIgnoreCase))
{
- valueString = valueString[0..^3];
+ valueString = valueString[..^3];
}
else if (valueString.EndsWith("ui64", StringComparison.OrdinalIgnoreCase))
{
- valueString = valueString[0..^4] + "UL";
+ valueString = valueString[..^4];
+ valueSuffix = "UL";
}
else if (valueString.EndsWith("i64", StringComparison.OrdinalIgnoreCase))
{
- valueString = valueString[0..^3] + "L";
+ valueString = valueString[..^3];
+ valueSuffix = "L";
}
else if (
valueString.EndsWith("ull", StringComparison.OrdinalIgnoreCase) ||
valueString.EndsWith("llu", StringComparison.OrdinalIgnoreCase))
{
- valueString = valueString[0..^3] + "UL";
+ valueString = valueString[..^3];
+ valueSuffix = "UL";
}
else if (valueString.EndsWith("ll", StringComparison.OrdinalIgnoreCase))
{
- valueString = valueString[0..^2] + "L";
+ valueString = valueString[..^2];
+ valueSuffix = "L";
}
else if (
valueString.EndsWith("ul", StringComparison.OrdinalIgnoreCase) ||
valueString.EndsWith("lu", StringComparison.OrdinalIgnoreCase))
{
- valueString = valueString[0..^2] + "U";
+ valueString = valueString[..^2];
+ valueSuffix = "U";
}
else if (valueString.EndsWith('u') || valueString.EndsWith('U'))
{
- valueString = valueString[0..^1] + "U";
+ valueString = valueString[..^1];
+ valueSuffix = "U";
}
else if (valueString.EndsWith('l') || valueString.EndsWith('L'))
{
- valueString = valueString[0..^1];
+ valueString = valueString[..^1];
}
var outputBuilder = StartCSharpCode();
outputBuilder.Write(valueString);
+ outputBuilder.Write(valueSuffix);
StopCSharpCode();
}
private void VisitLabelStmt(LabelStmt labelStmt)
{
var outputBuilder = StartCSharpCode();
-
- outputBuilder.Write(labelStmt.Decl.Name);
- outputBuilder.WriteLine(':');
+ outputBuilder.WriteLabel(labelStmt.Decl.Name);
outputBuilder.WriteIndentation();
Visit(labelStmt.SubStmt);
@@ -2128,7 +2228,27 @@ private void VisitReturnStmt(ReturnStmt returnStmt)
outputBuilder.AddUsingDirective("System.Runtime.CompilerServices");
outputBuilder.Write('(');
outputBuilder.Write(referenceTypeName);
- outputBuilder.Write(")Unsafe.AsPointer(ref this)");
+ outputBuilder.Write(")Unsafe.AsPointer(");
+
+ if (referenceType.IsLocalConstQualified)
+ {
+ if (!_config.GenerateLatestCode)
+ {
+ outputBuilder.Write("ref Unsafe.AsRef(");
+ }
+
+ outputBuilder.Write("in this");
+
+ if (!_config.GenerateLatestCode)
+ {
+ outputBuilder.Write(')');
+ }
+ }
+ else
+ {
+ outputBuilder.Write("ref this");
+ }
+ outputBuilder.Write(')');
StopCSharpCode();
return;
@@ -2555,7 +2675,7 @@ private void VisitStmt(Stmt stmt)
}
// case CX_StmtClass_NoInitExpr:
- // case CX_StmtClass_OMPArraySectionExpr:
+ // case CX_StmtClass_ArraySectionExpr:
// case CX_StmtClass_ObjCArrayLiteral:
// case CX_StmtClass_ObjCAvailabilityCheckExpr:
// case CX_StmtClass_ObjCBoolLiteralExpr:
@@ -2731,7 +2851,7 @@ private void VisitStringLiteral(StringLiteral stringLiteral)
case CX_SLK_Ordinary:
case CX_SLK_UTF8:
{
- if (Config.GenerateLatestCode)
+ if (!Config.GenerateCompatibleCode)
{
outputBuilder.Write('"');
outputBuilder.Write(EscapeString(stringLiteral.String));
@@ -2789,7 +2909,7 @@ private void VisitStringLiteral(StringLiteral stringLiteral)
case CX_SLK_UTF32:
{
- if (_config.GenerateLatestCode)
+ if (!_config.GenerateCompatibleCode)
{
outputBuilder.Write('[');
}
@@ -2810,7 +2930,7 @@ private void VisitStringLiteral(StringLiteral stringLiteral)
outputBuilder.Write("0x00000000");
- if (_config.GenerateLatestCode)
+ if (!_config.GenerateCompatibleCode)
{
outputBuilder.Write(']');
}
@@ -2944,12 +3064,12 @@ private void VisitUnaryExprOrTypeTraitExpr(UnaryExprOrTypeTraitExpr unaryExprOrT
{
if ((parentType.Handle.SizeOf == 8) && IsPrevContextDecl(out var varDecl, out _))
{
- var cursorName = GetCursorName(varDecl);
+ var cursorName = GetCursorName(varDecl).AsSpan();
if (cursorName.StartsWith("ClangSharpMacro_", StringComparison.Ordinal))
{
cursorName = cursorName["ClangSharpMacro_".Length..];
- parentTypeIsVariableSized |= _config.WithTypes.TryGetValue(cursorName, out var remappedTypeName) && (remappedTypeName.Equals("int", StringComparison.Ordinal) || remappedTypeName.Equals("uint", StringComparison.Ordinal));
+ parentTypeIsVariableSized |= _config._withTypes.GetAlternateLookup>().TryGetValue(cursorName, out var remappedTypeName) && (remappedTypeName.Equals("int", StringComparison.Ordinal) || remappedTypeName.Equals("uint", StringComparison.Ordinal));
}
}
diff --git a/sources/ClangSharp.PInvokeGenerator/PInvokeGenerator.cs b/sources/ClangSharp.PInvokeGenerator/PInvokeGenerator.cs
index 0984aaf3..01eb5810 100644
--- a/sources/ClangSharp.PInvokeGenerator/PInvokeGenerator.cs
+++ b/sources/ClangSharp.PInvokeGenerator/PInvokeGenerator.cs
@@ -7,6 +7,7 @@
using System.Globalization;
using System.IO;
using System.Linq;
+using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Text;
using System.Text.RegularExpressions;
@@ -15,17 +16,17 @@
using ClangSharp.Interop;
using ClangSharp.XML;
using static ClangSharp.Interop.CX_AttrKind;
-using static ClangSharp.Interop.CXBinaryOperatorKind;
using static ClangSharp.Interop.CX_CXXAccessSpecifier;
using static ClangSharp.Interop.CX_StmtClass;
using static ClangSharp.Interop.CX_UnaryExprOrTypeTrait;
-using static ClangSharp.Interop.CXUnaryOperatorKind;
+using static ClangSharp.Interop.CXBinaryOperatorKind;
using static ClangSharp.Interop.CXCallingConv;
using static ClangSharp.Interop.CXDiagnosticSeverity;
using static ClangSharp.Interop.CXEvalResultKind;
using static ClangSharp.Interop.CXTemplateArgumentKind;
using static ClangSharp.Interop.CXTranslationUnit_Flags;
using static ClangSharp.Interop.CXTypeKind;
+using static ClangSharp.Interop.CXUnaryOperatorKind;
namespace ClangSharp;
@@ -37,8 +38,8 @@ public sealed partial class PInvokeGenerator : IDisposable
private static readonly string[] s_doubleColonSeparator = ["::"];
private static readonly char[] s_doubleQuoteSeparator = ['"'];
- private const string ExpectedClangVersion = "version 18.1";
- private const string ExpectedClangSharpVersion = "version 18.1";
+ private const string ExpectedClangVersion = "version 20.1";
+ private const string ExpectedClangSharpVersion = "version 20.1";
private readonly CXIndex _index;
private readonly OutputBuilderFactory _outputBuilderFactory;
@@ -61,6 +62,7 @@ public sealed partial class PInvokeGenerator : IDisposable
private readonly Dictionary _topLevelClassIsUnsafe;
private readonly Dictionary> _topLevelClassUsings;
private readonly Dictionary> _topLevelClassAttributes;
+ private readonly Dictionary _fileContents;
private readonly HashSet _topLevelClassNames;
private readonly HashSet _usedRemappings;
private readonly string _placeholderMacroType;
@@ -136,30 +138,31 @@ public PInvokeGenerator(PInvokeGeneratorConfiguration config, Func(StringComparer.Ordinal);
_diagnostics = [];
_context = new LinkedList<(Cursor, object?)>();
- _uuidsToGenerate = [];
- _generatedUuids = [];
+ _uuidsToGenerate = new Dictionary(StringComparer.Ordinal);
+ _generatedUuids = new HashSet(StringComparer.Ordinal);
_cursorNames = [];
_cursorQualifiedNames = [];
_typeNames = [];
- _allValidNameRemappings = new Dictionary>() {
+ _allValidNameRemappings = new Dictionary>(QualifiedNameComparer.Default) {
["intptr_t"] = ["IntPtr", "nint"],
["ptrdiff_t"] = ["IntPtr", "nint"],
["size_t"] = ["UIntPtr", "nuint"],
["uintptr_t"] = ["UIntPtr", "nuint"],
["_GUID"] = ["Guid"],
};
- _traversedValidNameRemappings = [];
+ _traversedValidNameRemappings = new Dictionary>(StringComparer.Ordinal);
_overloadIndices = [];
_isExcluded = [];
- _topLevelClassHasGuidMember = [];
- _topLevelClassIsUnsafe = [];
- _topLevelClassNames = [];
- _topLevelClassAttributes = [];
- _topLevelClassUsings = [];
- _usedRemappings = [];
+ _topLevelClassHasGuidMember = new Dictionary(StringComparer.Ordinal);
+ _topLevelClassIsUnsafe = new Dictionary(StringComparer.Ordinal);
+ _topLevelClassNames = new HashSet(StringComparer.Ordinal);
+ _topLevelClassAttributes = new Dictionary>(StringComparer.Ordinal);
+ _fileContents = [];
+ _topLevelClassUsings = new Dictionary>(StringComparer.Ordinal);
+ _usedRemappings = new HashSet(StringComparer.Ordinal);
_filePath = "";
_clangCommandLineArgs = [];
_placeholderMacroType = GetPlaceholderMacroType();
@@ -212,8 +215,8 @@ public void Close()
Stream? stream = null;
Stream? testStream = null;
- var methodClassOutputBuilders = new Dictionary();
- var methodClassTestOutputBuilders = new Dictionary();
+ var methodClassOutputBuilders = new Dictionary(StringComparer.Ordinal);
+ var methodClassTestOutputBuilders = new Dictionary(StringComparer.Ordinal);
var emitNamespaceDeclaration = true;
var leaveStreamOpen = false;
@@ -1409,7 +1412,7 @@ static void GenerateTransparentStructs(PInvokeGenerator generator, Stream? strea
sw.Write(indentString);
sw.WriteLine(" {");
sw.Write(indentString);
- sw.Write(" if (obj is ");
+ sw.Write(" if (obj is ");
sw.Write(name);
sw.WriteLine(" other)");
sw.Write(indentString);
@@ -1697,14 +1700,8 @@ public void GenerateBindings(TranslationUnit translationUnit, string filePath, s
{
if (_config.GenerateMacroBindings)
{
- var translationUnitHandle = translationUnit.Handle;
-
- var file = translationUnitHandle.GetFile(_filePath);
- var fileContents = translationUnitHandle.GetFileContents(file, out var size);
var fileContentsBuilder = _fileContentsBuilder;
- _ = fileContentsBuilder.Append(Encoding.UTF8.GetString(fileContents));
-
foreach (var cursor in translationUnit.TranslationUnitDecl.CursorChildren)
{
if (cursor is PreprocessedEntity preprocessedEntity)
@@ -1716,7 +1713,10 @@ public void GenerateBindings(TranslationUnit translationUnit, string filePath, s
var unsavedFileContents = fileContentsBuilder.ToString();
_ = fileContentsBuilder.Clear();
- using var unsavedFile = CXUnsavedFile.Create(_filePath, unsavedFileContents);
+ var translationUnitHandle = translationUnit.Handle;
+ var file = translationUnitHandle.GetFile(_filePath);
+
+ using var unsavedFile = CXUnsavedFile.Create(_filePath, translationUnitHandle, file, unsavedFileContents);
var unsavedFiles = new CXUnsavedFile[] { unsavedFile };
translationFlags = _translationFlags & ~CXTranslationUnit_DetailedPreprocessingRecord;
@@ -1734,53 +1734,61 @@ public void GenerateBindings(TranslationUnit translationUnit, string filePath, s
{
foreach (var kvp in _traversedValidNameRemappings)
{
- var name = kvp.Key;
+ var name = kvp.Key.AsSpan();
var remappings = kvp.Value;
- if (name.Contains('<', StringComparison.OrdinalIgnoreCase))
+ if (name.Contains('<'))
{
var parts = name.Split('<');
- if (parts.Length >= 2)
+ if (parts.MoveNext())
{
- name = parts[0];
+ var part = parts.Current;
+
+ if (parts.MoveNext())
+ {
+ name = name[part];
+ }
}
}
- if (!_config.RemappedNames.TryGetValue(name, out _))
+ var remappedNamesLookup = _config._remappedNames.GetAlternateLookup>();
+
+ if (!remappedNamesLookup.TryGetValue(name, out _))
{
- var addDiag = false;
+ var addDiag = true;
- var altName = name;
var smlName = name;
+ var lastSeparatorIndex = smlName.LastIndexOf("::", StringComparison.Ordinal);
- if (name.Contains("::", StringComparison.Ordinal))
+ if (lastSeparatorIndex != -1)
{
- altName = name.Replace("::", ".", StringComparison.Ordinal);
- smlName = altName.Split('.')[^1];
+ smlName = smlName[(lastSeparatorIndex + 2)..];
+ addDiag = false;
}
- else if (name.Contains('.', StringComparison.Ordinal))
+
+ lastSeparatorIndex = smlName.LastIndexOf('.');
+
+ if (lastSeparatorIndex != -1)
{
- altName = name.Replace(".", "::", StringComparison.Ordinal);
- smlName = altName.Split("::")[^1];
+ smlName = smlName[(lastSeparatorIndex + 1)..];
+ addDiag = false;
}
- else
+
+ if (!addDiag && !remappedNamesLookup.TryGetValue(smlName, out _))
{
addDiag = true;
}
- if (!addDiag && !_config.RemappedNames.TryGetValue(altName, out _))
+ if (addDiag)
{
- if (!_config.RemappedNames.TryGetValue(smlName, out _))
+ var remappingsLookup = remappings.GetAlternateLookup>();
+
+ if (!remappingsLookup.Contains(name) && !remappingsLookup.Contains(smlName))
{
- addDiag = true;
+ AddDiagnostic(DiagnosticLevel.Info, $"Potential missing remapping '{name}'. {GetFoundRemappingString(name, remappings)}");
}
}
-
- if (addDiag && !remappings.Contains(altName) && !remappings.Contains(smlName))
- {
- AddDiagnostic(DiagnosticLevel.Info, $"Potential missing remapping '{name}'. {GetFoundRemappingString(name, remappings)}");
- }
}
}
@@ -1789,34 +1797,32 @@ public void GenerateBindings(TranslationUnit translationUnit, string filePath, s
var name = kvp.Key;
var remappings = kvp.Value;
- if (_config.RemappedNames.TryGetValue(name, out var remappedName) && !remappings.Contains(remappedName) && (name != remappedName) && !_config.ForceRemappedNames.Contains(name))
+ var remappedNamesLookup = _config._remappedNames.GetAlternateLookup>();
+
+ if (remappedNamesLookup.TryGetValue(name, out var remappedName) && !remappings.Contains(remappedName) && (name != remappedName) && !_config.ForceRemappedNames.Contains(name))
{
- var addDiag = false;
+ var addDiag = true;
- var altName = name;
var smlName = name;
+ var lastSeparatorIndex = smlName.LastIndexOf("::", StringComparison.Ordinal);
- if (name.Contains("::", StringComparison.Ordinal))
- {
- altName = name.Replace("::", ".", StringComparison.Ordinal);
- smlName = altName.Split('.')[^1];
- }
- else if (name.Contains('.', StringComparison.Ordinal))
+ if (lastSeparatorIndex != -1)
{
- altName = name.Replace(".", "::", StringComparison.Ordinal);
- smlName = altName.Split("::")[^1];
+ smlName = smlName[(lastSeparatorIndex + 2)..];
+ addDiag = false;
}
- else
+
+ lastSeparatorIndex = smlName.LastIndexOf('.');
+
+ if (lastSeparatorIndex != -1)
{
- addDiag = true;
+ smlName = smlName[(lastSeparatorIndex + 1)..];
+ addDiag = false;
}
- if (!addDiag && _config.RemappedNames.TryGetValue(altName, out remappedName) && !remappings.Contains(remappedName) && (altName != remappedName) && !_config.ForceRemappedNames.Contains(altName))
+ if (!addDiag && remappedNamesLookup.TryGetValue(smlName, out remappedName) && !remappings.Contains(remappedName) && (smlName != remappedName) && !_config.ForceRemappedNames.Contains(smlName))
{
- if (_config.RemappedNames.TryGetValue(smlName, out remappedName) && !remappings.Contains(remappedName) && (smlName != remappedName) && !_config.ForceRemappedNames.Contains(smlName))
- {
- addDiag = true;
- }
+ addDiag = true;
}
if (addDiag)
@@ -1830,34 +1836,32 @@ public void GenerateBindings(TranslationUnit translationUnit, string filePath, s
{
var remappedName = _config.RemappedNames[name];
- if (!_allValidNameRemappings.ContainsKey(name) && (name != remappedName) && !_config.ForceRemappedNames.Contains(name))
+ var allValidNameRemappingsLookup = _allValidNameRemappings.GetAlternateLookup>();
+
+ if (!allValidNameRemappingsLookup.ContainsKey(name) && (name != remappedName) && !_config.ForceRemappedNames.Contains(name))
{
- var addDiag = false;
+ var addDiag = true;
- var altName = name;
var smlName = name;
+ var lastSeparatorIndex = smlName.LastIndexOf("::", StringComparison.Ordinal);
- if (name.Contains("::", StringComparison.Ordinal))
+ if (lastSeparatorIndex != -1)
{
- altName = name.Replace("::", ".", StringComparison.Ordinal);
- smlName = altName.Split('.')[^1];
+ smlName = smlName[(lastSeparatorIndex + 2)..];
+ addDiag = false;
}
- else if (name.Contains('.', StringComparison.Ordinal))
- {
- altName = name.Replace(".", "::", StringComparison.Ordinal);
- smlName = altName.Split("::")[^1];
- }
- else
+
+ lastSeparatorIndex = smlName.LastIndexOf('.');
+
+ if (lastSeparatorIndex != -1)
{
- addDiag = true;
+ smlName = smlName[(lastSeparatorIndex + 1)..];
+ addDiag = false;
}
- if (!addDiag && !_allValidNameRemappings.ContainsKey(altName) && (altName != remappedName) && !_config.ForceRemappedNames.Contains(altName))
+ if (!addDiag && !allValidNameRemappingsLookup.ContainsKey(smlName) && (smlName != remappedName) && !_config.ForceRemappedNames.Contains(smlName))
{
- if (!_allValidNameRemappings.ContainsKey(smlName) && (smlName != remappedName) && !_config.ForceRemappedNames.Contains(smlName))
- {
- addDiag = true;
- }
+ addDiag = true;
}
if (addDiag)
@@ -1867,62 +1871,71 @@ public void GenerateBindings(TranslationUnit translationUnit, string filePath, s
}
}
- static string GetFoundRemappingString(string name, HashSet remappings)
+ static ReadOnlySpan GetFoundRemappingString(ReadOnlySpan name, HashSet remappings)
{
- var recommendedRemapping = "";
+ var recommendedRemappingString = "";
+ var recommendedRemapping = recommendedRemappingString.AsSpan();
if (remappings.Count == 1)
{
- recommendedRemapping = remappings.Single();
+ recommendedRemappingString = remappings.Single();
+ recommendedRemapping = recommendedRemappingString;
}
- if (string.IsNullOrEmpty(recommendedRemapping) && name.StartsWith('_'))
+ var remappingsLookup = remappings.GetAlternateLookup>();
+
+ if (recommendedRemapping.IsWhiteSpace() && name.StartsWith('_'))
{
var remapping = name[1..];
- if (remappings.Contains(remapping))
+ if (remappingsLookup.Contains(remapping))
{
recommendedRemapping = remapping;
+ recommendedRemappingString = null;
}
}
- if (string.IsNullOrEmpty(recommendedRemapping) && name.StartsWith("tag", StringComparison.Ordinal))
+ if (recommendedRemapping.IsWhiteSpace() && name.StartsWith("tag", StringComparison.Ordinal))
{
var remapping = name[3..];
- if (remappings.Contains(remapping))
+ if (remappingsLookup.Contains(remapping))
{
recommendedRemapping = remapping;
+ recommendedRemappingString = null;
}
}
- if (string.IsNullOrEmpty(recommendedRemapping) && name.EndsWith('_'))
+ if (recommendedRemapping.IsWhiteSpace() && name.EndsWith('_'))
{
- var remapping = name[0..^1];
+ var remapping = name[..^1];
- if (remappings.Contains(remapping))
+ if (remappingsLookup.Contains(remapping))
{
recommendedRemapping = remapping;
+ recommendedRemappingString = null;
}
}
- if (string.IsNullOrEmpty(recommendedRemapping) && name.EndsWith("tag", StringComparison.Ordinal))
+ if (recommendedRemapping.IsWhiteSpace() && name.EndsWith("tag", StringComparison.Ordinal))
{
- var remapping = name[0..^3];
+ var remapping = name[..^3];
- if (remappings.Contains(remapping))
+ if (remappingsLookup.Contains(remapping))
{
recommendedRemapping = remapping;
+ recommendedRemappingString = null;
}
}
- if (string.IsNullOrEmpty(recommendedRemapping))
+ if (recommendedRemapping.IsWhiteSpace())
{
- var remapping = name.ToUpperInvariant();
+ var remapping = name.ToString().ToUpperInvariant();
- if (remappings.Contains(remapping))
+ if (remappingsLookup.Contains(remapping))
{
- recommendedRemapping = remapping;
+ recommendedRemappingString = remapping;
+ recommendedRemapping = recommendedRemappingString;
}
}
@@ -1930,7 +1943,7 @@ static string GetFoundRemappingString(string name, HashSet remappings)
var remainingRemappings = (IEnumerable)remappings;
var remainingString = "Found";
- if (!string.IsNullOrEmpty(recommendedRemapping))
+ if (!recommendedRemapping.IsWhiteSpace())
{
result += $"Recommended remapping: '{name}={recommendedRemapping}'.";
@@ -1941,7 +1954,7 @@ static string GetFoundRemappingString(string name, HashSet remappings)
else
{
result += ' ';
- remainingRemappings = remappings.Except([recommendedRemapping]);
+ remainingRemappings = remappings.Except([recommendedRemappingString ?? recommendedRemapping.ToString()]);
remainingString = "Other";
}
}
@@ -2036,9 +2049,9 @@ private void CloseOutputBuilder(Stream stream, IOutputBuilder outputBuilder, boo
if (isMethodClass)
{
- var nonTestName = outputBuilder.IsTestOutput ? outputBuilder.Name[0..^5] : outputBuilder.Name;
+ var nonTestName = outputBuilder.IsTestOutput ? outputBuilder.Name.AsSpan()[..^5] : outputBuilder.Name;
- if (_topLevelClassUsings.TryGetValue(nonTestName, out var withUsings))
+ if (_topLevelClassUsings.GetAlternateLookup>().TryGetValue(nonTestName, out var withUsings))
{
foreach (var withUsing in withUsings)
{
@@ -2101,17 +2114,17 @@ private void CloseOutputBuilder(Stream stream, IOutputBuilder outputBuilder, boo
}
}
- void ForCSharp(CSharpOutputBuilder csharpOutputBuilder)
+ void ForCSharp(CSharpOutputBuilder outputBuilder)
{
- var indentationString = csharpOutputBuilder.IndentationString;
- var nonTestName = outputBuilder.IsTestOutput ? outputBuilder.Name[0..^5] : outputBuilder.Name;
+ var indentationString = outputBuilder.IndentationString;
+ var nonTestName = outputBuilder.IsTestOutput ? outputBuilder.Name.AsSpan()[..^5] : outputBuilder.Name;
if (emitNamespaceDeclaration)
{
sw.Write("namespace ");
sw.Write(GetNamespace(nonTestName));
- if (csharpOutputBuilder.IsTestOutput)
+ if (outputBuilder.IsTestOutput)
{
sw.Write(".UnitTests");
}
@@ -2135,7 +2148,7 @@ void ForCSharp(CSharpOutputBuilder csharpOutputBuilder)
if (isMethodClass)
{
- var isTopLevelStruct = _config.WithTypes.TryGetValue(nonTestName, out var withType) && withType.Equals("struct", StringComparison.Ordinal);
+ var isTopLevelStruct = _config._withTypes.GetAlternateLookup>().TryGetValue(nonTestName, out var withType) && withType.Equals("struct", StringComparison.Ordinal);
if (outputBuilder.IsTestOutput)
{
@@ -2156,7 +2169,7 @@ void ForCSharp(CSharpOutputBuilder csharpOutputBuilder)
sw.WriteLine(".");
}
- if (_topLevelClassAttributes.TryGetValue(nonTestName, out var withAttributes))
+ if (_topLevelClassAttributes.GetAlternateLookup>().TryGetValue(nonTestName, out var withAttributes))
{
if (withAttributes.Count != 0)
{
@@ -2184,7 +2197,7 @@ void ForCSharp(CSharpOutputBuilder csharpOutputBuilder)
sw.Write("static ");
}
- if ((_topLevelClassIsUnsafe.TryGetValue(nonTestName, out var isUnsafe) && isUnsafe) || (outputBuilder.IsTestOutput && isTopLevelStruct))
+ if ((_topLevelClassIsUnsafe.GetAlternateLookup>().TryGetValue(nonTestName, out var isUnsafe) && isUnsafe) || (outputBuilder.IsTestOutput && isTopLevelStruct))
{
sw.Write("unsafe ");
}
@@ -2211,15 +2224,15 @@ void ForCSharp(CSharpOutputBuilder csharpOutputBuilder)
sw.Write(indentationString);
sw.Write('{');
- if ((!outputBuilder.IsTestOutput && !isTopLevelStruct) || !string.IsNullOrEmpty(csharpOutputBuilder.Contents.First()))
+ if ((!outputBuilder.IsTestOutput && !isTopLevelStruct) || !string.IsNullOrEmpty(outputBuilder.Contents.First()))
{
sw.WriteLine();
}
- indentationString += csharpOutputBuilder.IndentationString;
+ indentationString += outputBuilder.IndentationString;
}
- foreach (var line in csharpOutputBuilder.Contents)
+ foreach (var line in outputBuilder.Contents)
{
if (string.IsNullOrWhiteSpace(line))
{
@@ -2234,7 +2247,7 @@ void ForCSharp(CSharpOutputBuilder csharpOutputBuilder)
if (isMethodClass)
{
- indentationString = indentationString[..^csharpOutputBuilder.IndentationString.Length];
+ indentationString = indentationString[..^outputBuilder.IndentationString.Length];
sw.Write(indentationString);
sw.WriteLine('}');
@@ -2246,7 +2259,7 @@ void ForCSharp(CSharpOutputBuilder csharpOutputBuilder)
}
}
- void ForXml(XmlOutputBuilder xmlOutputBuilder)
+ void ForXml(XmlOutputBuilder outputBuilder)
{
const string Indent = " ";
var indentationString = Indent;
@@ -2255,7 +2268,7 @@ void ForXml(XmlOutputBuilder xmlOutputBuilder)
{
sw.Write(indentationString);
sw.Write("");
}
@@ -2265,10 +2278,10 @@ void ForXml(XmlOutputBuilder xmlOutputBuilder)
{
sw.Write(indentationString);
sw.Write(" value.Replace(@"\0", "\0",
private AccessSpecifier GetAccessSpecifier(NamedDecl namedDecl, bool matchStar)
{
- if (!TryGetRemappedValue(namedDecl, _config.WithAccessSpecifiers, out var accessSpecifier, matchStar) || (accessSpecifier == AccessSpecifier.None))
+ if (!TryGetRemappedValue(namedDecl, _config._withAccessSpecifiers, out var accessSpecifier, matchStar) || (accessSpecifier == AccessSpecifier.None))
{
switch (namedDecl.Access)
{
@@ -2629,7 +2642,7 @@ private CallConv GetCallingConvention(Cursor? cursor, Cursor? context, Type type
if (cursor is NamedDecl namedDecl)
{
- if (TryGetRemappedValue(namedDecl, _config.WithCallConvs, out var callConv, matchStar: true))
+ if (TryGetRemappedValue(namedDecl, _config._withCallConvs, out var callConv, matchStar: true))
{
if (Enum.TryParse(callConv, true, out var remappedCallingConvention))
{
@@ -2773,22 +2786,26 @@ private CallConv GetCallingConvention(Cursor? cursor, Cursor? context, Type type
private string GetCursorName(NamedDecl namedDecl)
{
- if (!_cursorNames.TryGetValue(namedDecl, out var name))
+ if (!_cursorNames.TryGetValue(namedDecl, out var nameString))
{
- name = namedDecl.Name.NormalizePath();
+ nameString = namedDecl.Name.NormalizePath();
+ var name = nameString.AsSpan();
// strip the prefix
if (name.StartsWith("enum ", StringComparison.Ordinal))
{
name = name[5..];
+ nameString = null;
}
else if (name.StartsWith("struct ", StringComparison.Ordinal))
{
name = name[7..];
+ nameString = null;
}
else if (name.StartsWith("union ", StringComparison.Ordinal))
{
name = name[6..];
+ nameString = null;
}
var anonymousNameStartIndex = name.IndexOf("::(", StringComparison.Ordinal);
@@ -2797,21 +2814,26 @@ private string GetCursorName(NamedDecl namedDecl)
{
anonymousNameStartIndex += 2;
name = name[anonymousNameStartIndex..];
+ nameString = null;
}
if (namedDecl is CXXConstructorDecl cxxConstructorDecl)
{
var parent = cxxConstructorDecl.Parent;
Debug.Assert(parent is not null);
- name = GetCursorName(parent);
+
+ nameString = GetCursorName(parent);
+ name = nameString;
}
else if (namedDecl is CXXDestructorDecl cxxDestructorDecl)
{
var parent = cxxDestructorDecl.Parent;
Debug.Assert(parent is not null);
- name = $"~{GetCursorName(parent)}";
+
+ nameString = $"~{GetCursorName(parent)}";
+ name = nameString;
}
- else if (string.IsNullOrWhiteSpace(name) || name.StartsWith('('))
+ else if (name.IsWhiteSpace() || name.StartsWith('('))
{
#if DEBUG
if (name.StartsWith('('))
@@ -2829,17 +2851,20 @@ private string GetCursorName(NamedDecl namedDecl)
if (namedDecl is TypeDecl typeDecl)
{
- name = (typeDecl is TagDecl tagDecl) && tagDecl.Handle.IsAnonymous
- ? GetAnonymousName(tagDecl, tagDecl.TypeForDecl.KindSpelling)
- : GetTypeName(namedDecl, context: null, type: typeDecl.TypeForDecl, ignoreTransparentStructsWhereRequired: false, isTemplate: false, nativeTypeName: out _);
+ nameString = (typeDecl is TagDecl tagDecl) && tagDecl.Handle.IsAnonymous
+ ? GetAnonymousName(tagDecl, tagDecl.TypeForDecl.KindSpelling)
+ : GetTypeName(namedDecl, context: null, type: typeDecl.TypeForDecl, ignoreTransparentStructsWhereRequired: false, isTemplate: false, nativeTypeName: out _);
+ name = nameString;
}
else if (namedDecl is ParmVarDecl)
{
- name = "param";
+ nameString = "param";
+ name = nameString;
}
else if (namedDecl is FieldDecl fieldDecl)
{
- name = GetAnonymousName(fieldDecl, fieldDecl.CursorKindSpelling);
+ nameString = GetAnonymousName(fieldDecl, fieldDecl.CursorKindSpelling);
+ name = nameString;
}
else
{
@@ -2847,11 +2872,12 @@ private string GetCursorName(NamedDecl namedDecl)
}
}
- _cursorNames[namedDecl] = name;
+ nameString ??= name.ToString();
+ _cursorNames[namedDecl] = nameString;
}
- Debug.Assert(!string.IsNullOrWhiteSpace(name));
- return name;
+ Debug.Assert(!string.IsNullOrWhiteSpace(nameString));
+ return nameString;
}
private string GetCursorQualifiedName(NamedDecl namedDecl, bool truncateParameters = false)
@@ -3096,6 +3122,39 @@ uint GetOverloadIndex(CXXMethodDecl cxxMethodDeclToMatch, CXXRecordDecl cxxRecor
}
}
+ private uint GetOverloadCount(CXXMethodDecl cxxMethodDeclToMatch)
+ {
+ var parent = cxxMethodDeclToMatch.Parent;
+ Debug.Assert(parent is not null);
+
+ return GetOverloadIndex(cxxMethodDeclToMatch, parent, baseCount: 0);
+
+ uint GetOverloadIndex(CXXMethodDecl cxxMethodDeclToMatch, CXXRecordDecl cxxRecordDecl, uint baseCount)
+ {
+ var count = baseCount;
+
+ foreach (var cxxBaseSpecifier in cxxRecordDecl.Bases)
+ {
+ var baseCxxRecordDecl = GetRecordDecl(cxxBaseSpecifier);
+ count = GetOverloadIndex(cxxMethodDeclToMatch, baseCxxRecordDecl, count);
+ }
+
+ foreach (var cxxMethodDecl in cxxRecordDecl.Methods)
+ {
+ if (IsExcluded(cxxMethodDecl))
+ {
+ continue;
+ }
+ else if (cxxMethodDecl.Name == cxxMethodDeclToMatch.Name)
+ {
+ count++;
+ }
+ }
+
+ return count;
+ }
+ }
+
private CXXRecordDecl GetRecordDecl(CXXBaseSpecifier cxxBaseSpecifier)
{
var baseType = cxxBaseSpecifier.Type;
@@ -3123,15 +3182,6 @@ private string GetRemappedCursorName(NamedDecl namedDecl, out string nativeTypeN
return remappedName;
}
- name = name.Replace("::", ".", StringComparison.Ordinal);
- remappedName = GetRemappedName(name, namedDecl, tryRemapOperatorName: true, out wasRemapped, skipUsing);
-
- if (wasRemapped)
- {
- return remappedName;
- }
-
-
name = GetCursorQualifiedName(namedDecl, truncateParameters: true);
remappedName = GetRemappedName(name, namedDecl, tryRemapOperatorName: true, out wasRemapped, skipUsing);
@@ -3140,14 +3190,6 @@ private string GetRemappedCursorName(NamedDecl namedDecl, out string nativeTypeN
return remappedName;
}
- name = name.Replace("::", ".", StringComparison.Ordinal);
- remappedName = GetRemappedName(name, namedDecl, tryRemapOperatorName: true, out wasRemapped, skipUsing);
-
- if (wasRemapped)
- {
- return remappedName;
- }
-
name = GetCursorName(namedDecl);
remappedName = GetRemappedName(name, namedDecl, tryRemapOperatorName: true, out wasRemapped, skipUsing);
@@ -3168,7 +3210,7 @@ private string GetRemappedCursorName(NamedDecl namedDecl, out string nativeTypeN
}
else if ((namedDecl is FieldDecl fieldDecl) && name.StartsWith("__AnonymousFieldDecl_", StringComparison.Ordinal))
{
- if (fieldDecl.Type.AsCXXRecordDecl?.IsAnonymous == true)
+ if (fieldDecl.Type.AsCXXRecordDecl?.IsAnonymousStructOrUnion == true)
{
// For fields of anonymous types, use the name of the type but clean off the type
// kind tag at the end.
@@ -3200,12 +3242,65 @@ private string GetRemappedCursorName(NamedDecl namedDecl, out string nativeTypeN
return remappedName;
}
+ private static int GetAnonymousRecordIndex(RecordDecl recordDecl, RecordDecl parentRecordDecl)
+ {
+ var index = -1;
+ var parentAnonRecordCount = parentRecordDecl.AnonymousRecords.Count;
+
+ if (parentAnonRecordCount != 0)
+ {
+ index = parentRecordDecl.AnonymousRecords.IndexOf(recordDecl);
+
+ if (index != -1)
+ {
+ if (parentAnonRecordCount > 1)
+ {
+ index++;
+ }
+
+ if (parentRecordDecl.Parent is RecordDecl grandparentRecordDecl)
+ {
+ var parentIndex = GetAnonymousRecordIndex(parentRecordDecl, grandparentRecordDecl);
+
+ // We can't have the nested anonymous record have the same name as the parent
+ // so skip that index and just go one higher instead. This could still conflict
+ // with another anonymous record at a different level, but that is less likely
+ // and will still be unambiguous in total.
+
+ if ((parentIndex == index) || ((parentIndex > 0) && (index > parentIndex)))
+ {
+ if (recordDecl.IsUnion == parentRecordDecl.IsUnion)
+ {
+ index++;
+ }
+ }
+ }
+ }
+ }
+
+ return index;
+ }
+
private string GetRemappedNameForAnonymousRecord(RecordDecl recordDecl)
{
if (recordDecl.Parent is RecordDecl parentRecordDecl)
{
var remappedNameBuilder = new StringBuilder();
- var matchingField = parentRecordDecl.Fields.Where((fieldDecl) => fieldDecl.Type.CanonicalType == recordDecl.TypeForDecl.CanonicalType).FirstOrDefault();
+ var matchingField = null as FieldDecl;
+
+ if (!recordDecl.IsAnonymousStructOrUnion)
+ {
+ matchingField = parentRecordDecl.Fields.Where((fieldDecl) => {
+ var fieldType = fieldDecl.Type.CanonicalType;
+
+ if (fieldType is ArrayType arrayType)
+ {
+ fieldType = arrayType.ElementType.CanonicalType;
+ }
+
+ return fieldType == recordDecl.TypeForDecl.CanonicalType;
+ }).FirstOrDefault();
+ }
if ((matchingField is not null) && !matchingField.IsAnonymousField)
{
@@ -3216,28 +3311,11 @@ private string GetRemappedNameForAnonymousRecord(RecordDecl recordDecl)
{
_ = remappedNameBuilder.Append("_Anonymous");
- // If there is more than one anonymous type, then add a numeral to differentiate.
- if (parentRecordDecl.AnonymousRecords.Count > 1)
- {
- var index = parentRecordDecl.AnonymousRecords.IndexOf(recordDecl) + 1;
- Debug.Assert(index > 0);
- _ = remappedNameBuilder.Append(index);
- }
+ var index = GetAnonymousRecordIndex(recordDecl, parentRecordDecl);
- // C# doesn't allow a nested type to have the same name as the parent, so if the
- // parent is also anonymous, add the nesting depth as a way to avoid conflicts with
- // the parent's name.
- if (parentRecordDecl.IsAnonymous)
+ if (index != 0)
{
- var depth = 1;
- var currentParent = parentRecordDecl.Parent;
- while ((currentParent is RecordDecl currentParentRecordDecl) && currentParentRecordDecl.IsAnonymous)
- {
- depth++;
- currentParent = currentParentRecordDecl.Parent;
- }
- _ = remappedNameBuilder.Append('_');
- _ = remappedNameBuilder.Append(depth);
+ _ = remappedNameBuilder.Append(index);
}
}
@@ -3257,7 +3335,9 @@ private string GetRemappedName(string name, Cursor? cursor, bool tryRemapOperato
private string GetRemappedName(string name, Cursor? cursor, bool tryRemapOperatorName, out bool wasRemapped, bool skipUsing, bool skipUsingIfNotRemapped)
{
- if (_config.RemappedNames.TryGetValue(name, out var remappedName))
+ var remappedNamesLookup = _config._remappedNames.GetAlternateLookup>();
+
+ if (remappedNamesLookup.TryGetValue(name, out var remappedName))
{
wasRemapped = true;
_ = _usedRemappings.Add(name);
@@ -3266,13 +3346,13 @@ private string GetRemappedName(string name, Cursor? cursor, bool tryRemapOperato
if (name.StartsWith("const ", StringComparison.Ordinal))
{
- var tmpName = name[6..];
+ var tmpName = name.AsSpan()[6..];
- if (_config.RemappedNames.TryGetValue(tmpName, out remappedName))
+ if (remappedNamesLookup.TryGetValue(tmpName, out remappedName))
{
wasRemapped = true;
- _ = _usedRemappings.Add(tmpName);
+ _ = _usedRemappings.Add(tmpName.ToString());
return AddUsingDirectiveIfNeeded(_outputBuilder, remappedName, skipUsing);
}
}
@@ -3330,38 +3410,32 @@ private string GetRemappedTypeName(Cursor? cursor, Cursor? context, Type type, o
if (!wasRemapped)
{
- nameToCheck = nameToCheck.Replace("::", ".", StringComparison.Ordinal);
- remappedName = GetRemappedName(nameToCheck, cursor, tryRemapOperatorName: false, out wasRemapped, skipUsing, skipUsingIfNotRemapped: true);
+ nameToCheck = name;
+ remappedName = GetRemappedName(nameToCheck, cursor, tryRemapOperatorName: false, out wasRemapped, skipUsing);
if (!wasRemapped)
{
- nameToCheck = name;
- remappedName = GetRemappedName(nameToCheck, cursor, tryRemapOperatorName: false, out wasRemapped, skipUsing);
-
- if (!wasRemapped)
+ if (IsTypeConstantOrIncompleteArray(cursor, type, out var arrayType) && IsType(cursor, arrayType.ElementType))
{
- if (IsTypeConstantOrIncompleteArray(cursor, type, out var arrayType) && IsType(cursor, arrayType.ElementType))
- {
- type = arrayType.ElementType;
- }
+ type = arrayType.ElementType;
+ }
- if (IsType(cursor, type, out var recordType) && remappedName.StartsWith("__AnonymousRecord_", StringComparison.Ordinal))
- {
- var recordDecl = recordType.Decl;
- remappedName = GetRemappedNameForAnonymousRecord(recordDecl);
- }
- else if (IsType(cursor, type, out var enumType) && remappedName.StartsWith("__AnonymousEnum_", StringComparison.Ordinal))
- {
- remappedName = GetRemappedTypeName(enumType.Decl, context: null, enumType.Decl.IntegerType, out _, skipUsing);
- }
- else if (cursor is EnumDecl enumDecl)
- {
- // Even though some types have entries with names like *_FORCE_DWORD or *_FORCE_UINT
- // MSVC and Clang both still treat this as "signed" values and thus we don't want
- // to specially handle it as uint, as that can break ABI handling on some platforms.
+ if (IsType(cursor, type, out var recordType) && remappedName.StartsWith("__AnonymousRecord_", StringComparison.Ordinal))
+ {
+ var recordDecl = recordType.Decl;
+ remappedName = GetRemappedNameForAnonymousRecord(recordDecl);
+ }
+ else if (IsType(cursor, type, out var enumType) && remappedName.StartsWith("__AnonymousEnum_", StringComparison.Ordinal))
+ {
+ remappedName = GetRemappedTypeName(enumType.Decl, context: null, enumType.Decl.IntegerType, out _, skipUsing);
+ }
+ else if (cursor is EnumDecl enumDecl)
+ {
+ // Even though some types have entries with names like *_FORCE_DWORD or *_FORCE_UINT
+ // MSVC and Clang both still treat this as "signed" values and thus we don't want
+ // to specially handle it as uint, as that can break ABI handling on some platforms.
- WithType(enumDecl, ref remappedName, ref nativeTypeName);
- }
+ WithType(enumDecl, ref remappedName, ref nativeTypeName);
}
}
}
@@ -3385,7 +3459,19 @@ private string GetRemappedTypeName(Cursor? cursor, Cursor? context, Type type, o
return remappedName;
}
- private static string GetSourceRangeContents(CXTranslationUnit translationUnit, CXSourceRange sourceRange)
+ private unsafe ReadOnlySpan GetFileContents(CXTranslationUnit translationUnit, CXFile file)
+ {
+ if (!_fileContents.TryGetValue(file, out var fileContentsMetadata))
+ {
+ var fileContents = translationUnit.GetFileContents(file, out _);
+ fileContentsMetadata = ((nuint)Unsafe.AsPointer(ref MemoryMarshal.GetReference(fileContents)), (uint)fileContents.Length);
+ _fileContents.Add(file, fileContentsMetadata);
+ }
+
+ return new ReadOnlySpan((byte*)fileContentsMetadata.Address, (int)fileContentsMetadata.Length);
+ }
+
+ private string GetSourceRangeContents(CXTranslationUnit translationUnit, CXSourceRange sourceRange)
{
sourceRange.Start.GetFileLocation(out var startFile, out _, out _, out var startOffset);
sourceRange.End.GetFileLocation(out var endFile, out _, out _, out var endOffset);
@@ -3395,9 +3481,9 @@ private static string GetSourceRangeContents(CXTranslationUnit translationUnit,
return string.Empty;
}
- var fileContents = translationUnit.GetFileContents(startFile, out _);
- fileContents = fileContents.Slice(unchecked((int)startOffset), unchecked((int)(endOffset - startOffset)));
- return Encoding.UTF8.GetString(fileContents);
+ var contents = GetFileContents(translationUnit, startFile);
+ contents = contents.Slice(unchecked((int)startOffset), unchecked((int)(endOffset - startOffset)));
+ return Encoding.UTF8.GetString(contents);
}
private string GetTargetTypeName(Cursor cursor, out string nativeTypeName)
@@ -3433,13 +3519,13 @@ private string GetTargetTypeName(Cursor cursor, out string nativeTypeName)
else
{
var type = varDecl.Type;
- var cursorName = GetCursorName(varDecl);
+ var cursorName = GetCursorName(varDecl).AsSpan();
if (cursorName.StartsWith("ClangSharpMacro_", StringComparison.Ordinal))
{
cursorName = cursorName["ClangSharpMacro_".Length..];
- if (_config.WithTypes.TryGetValue(cursorName, out targetTypeName))
+ if (_config._withTypes.GetAlternateLookup>().TryGetValue(cursorName, out targetTypeName))
{
return targetTypeName;
}
@@ -4553,7 +4639,7 @@ private void GetTypeSize(Cursor cursor, Type type, ref long alignment32, ref lon
}
private bool HasSuppressGCTransition(Cursor? cursor)
- => (cursor is NamedDecl namedDecl) && HasRemapping(namedDecl, _config.WithSuppressGCTransitions);
+ => (cursor is NamedDecl namedDecl) && HasRemapping(namedDecl, _config._withSuppressGCTransitions);
private bool HasBaseField(CXXRecordDecl cxxRecordDecl)
{
@@ -4575,7 +4661,7 @@ private bool HasBaseField(CXXRecordDecl cxxRecordDecl)
private bool HasField(RecordDecl recordDecl)
{
- var hasField = recordDecl.Fields.Any() || recordDecl.Decls.Any((decl) => (decl is RecordDecl nestedRecordDecl) && nestedRecordDecl.IsAnonymous && HasField(nestedRecordDecl));
+ var hasField = recordDecl.Fields.Any() || recordDecl.Decls.Any((decl) => (decl is RecordDecl nestedRecordDecl) && nestedRecordDecl.IsAnonymousStructOrUnion && HasField(nestedRecordDecl));
if (!hasField && (recordDecl is CXXRecordDecl cxxRecordDecl))
{
@@ -4832,9 +4918,7 @@ bool IsExcludedByName(Cursor cursor, ref uint isExcludedValue)
}
}
- var dottedQualifiedName = qualifiedName.Replace("::", ".", StringComparison.Ordinal);
-
- if (_config.ExcludedNames.Contains(qualifiedName) || _config.ExcludedNames.Contains(dottedQualifiedName))
+ if (_config.ExcludedNames.Contains(qualifiedName))
{
if (_config.LogExclusions)
{
@@ -4854,9 +4938,7 @@ bool IsExcludedByName(Cursor cursor, ref uint isExcludedValue)
return true;
}
- var dottedQualifiedNameWithoutParameters = qualifiedNameWithoutParameters.Replace("::", ".", StringComparison.Ordinal);
-
- if (_config.ExcludedNames.Contains(qualifiedNameWithoutParameters) || _config.ExcludedNames.Contains(dottedQualifiedNameWithoutParameters) || _config.ExcludedNames.Contains(name))
+ if (_config.ExcludedNames.Contains(qualifiedNameWithoutParameters) || _config.ExcludedNames.Contains(name))
{
if (_config.LogExclusions)
{
@@ -4886,9 +4968,7 @@ bool IsExcludedByName(Cursor cursor, ref uint isExcludedValue)
}
if (_config.IncludedNames.Count != 0 && !_config.IncludedNames.Contains(qualifiedName)
- && !_config.IncludedNames.Contains(dottedQualifiedName)
&& !_config.IncludedNames.Contains(qualifiedNameWithoutParameters)
- && !_config.IncludedNames.Contains(dottedQualifiedNameWithoutParameters)
&& !_config.IncludedNames.Contains(name))
{
var semanticParentCursor = cursor.SemanticParentCursor;
@@ -5126,7 +5206,7 @@ bool IsEmptyRecord(RecordDecl recordDecl)
foreach (var decl in recordDecl.Decls)
{
- if ((decl is RecordDecl nestedRecordDecl) && nestedRecordDecl.IsAnonymous && !IsEmptyRecord(nestedRecordDecl))
+ if ((decl is RecordDecl nestedRecordDecl) && nestedRecordDecl.IsAnonymousStructOrUnion && !IsEmptyRecord(nestedRecordDecl))
{
return false;
}
@@ -5177,9 +5257,7 @@ private bool IsBaseExcluded(CXXRecordDecl cxxRecordDecl, CXXRecordDecl baseCxxRe
baseFieldName = GetRemappedName(baseFieldName, cxxBaseSpecifier, tryRemapOperatorName: true, out _, skipUsing: true);
var qualifiedName = $"{GetCursorQualifiedName(cxxRecordDecl)}::{baseFieldName}";
- var dottedQualifiedName = qualifiedName.Replace("::", ".", StringComparison.Ordinal);
-
- return _config.ExcludedNames.Contains(qualifiedName) || _config.ExcludedNames.Contains(dottedQualifiedName);
+ return _config.ExcludedNames.Contains(qualifiedName);
}
private bool IsFixedSize(Cursor cursor, Type type)
@@ -5317,6 +5395,15 @@ private bool IsPrevContextStmt([MaybeNullWhen(false)] out T cursor, out objec
}
}
+ private bool IsReadonly(CXXMethodDecl? cxxMethodDecl)
+ {
+ if (cxxMethodDecl is not null)
+ {
+ return cxxMethodDecl.IsConst || HasRemapping(cxxMethodDecl, _config._withReadonlys, matchStar: true);
+ }
+ return false;
+ }
+
private static bool IsStmtAsWritten(Cursor cursor, [MaybeNullWhen(false)] out T value, bool removeParens = false)
where T : Stmt
{
@@ -5503,7 +5590,7 @@ internal bool IsSupportedFixedSizedBufferType(string typeName)
case "ulong":
{
// We want to prefer InlineArray in modern code, as it is safer and supports more features
- return !Config.GenerateLatestCode;
+ return Config.GenerateCompatibleCode;
}
default:
@@ -5770,7 +5857,7 @@ private bool IsUnchecked(string targetTypeName, Stmt stmt)
}
// case CX_StmtClass_NoInitExpr:
- // case CX_StmtClass_OMPArraySectionExpr:
+ // case CX_StmtClass_ArraySectionExpr:
// case CX_StmtClass_ObjCArrayLiteral:
// case CX_StmtClass_ObjCAvailabilityCheckExpr:
// case CX_StmtClass_ObjCBoolLiteralExpr:
@@ -6153,7 +6240,7 @@ private bool IsUnsafe(RecordDecl recordDecl)
{
return true;
}
- else if ((decl is RecordDecl nestedRecordDecl) && nestedRecordDecl.IsAnonymous && (IsUnsafe(nestedRecordDecl) || Config.GenerateCompatibleCode))
+ else if ((decl is RecordDecl nestedRecordDecl) && nestedRecordDecl.IsAnonymousStructOrUnion && (IsUnsafe(nestedRecordDecl) || Config.GenerateCompatibleCode))
{
return true;
}
@@ -6440,7 +6527,7 @@ private void StopUsingOutputBuilder()
private bool TryGetUuid(RecordDecl recordDecl, out Guid uuid)
{
- if (TryGetRemappedValue(recordDecl, _config.WithGuids, out var guid))
+ if (TryGetRemappedValue(recordDecl, _config._withGuids, out var guid))
{
uuid = guid;
return true;
@@ -6774,7 +6861,7 @@ private void WithAttributes(NamedDecl namedDecl, bool onlySupportedOSPlatform =
var outputBuilder = isTestOutput ? _testOutputBuilder : _outputBuilder;
Debug.Assert(outputBuilder is not null);
- if (TryGetRemappedValue(namedDecl, _config.WithAttributes, out var attributes, matchStar: true))
+ if (TryGetRemappedValue(namedDecl, _config._withAttributes, out var attributes, matchStar: true))
{
foreach (var attribute in attributes.Where((a) => !onlySupportedOSPlatform || a.StartsWith("SupportedOSPlatform(", StringComparison.Ordinal)))
{
@@ -6874,16 +6961,16 @@ private string GetClass(string remappedName, bool disallowPrefixMatch = false)
return className;
}
- private bool TryGetClass(string remappedName, [MaybeNullWhen(false)] out string className, bool disallowPrefixMatch = false)
+ private bool TryGetClass(ReadOnlySpan remappedName, [MaybeNullWhen(false)] out string className, bool disallowPrefixMatch = false)
{
- var index = remappedName.IndexOf('*', StringComparison.Ordinal);
+ var index = remappedName.IndexOf('*');
if (index != -1)
{
remappedName = remappedName[..index];
}
- if (_config.WithClasses.TryGetValue(remappedName, out className))
+ if (_config._withClasses.GetAlternateLookup>().TryGetValue(remappedName, out className))
{
_ = _topLevelClassNames.Add(className);
_ = _topLevelClassNames.Add($"{className}Tests");
@@ -6895,14 +6982,14 @@ private bool TryGetClass(string remappedName, [MaybeNullWhen(false)] out string
return false;
}
- foreach (var withClass in _config.WithClasses)
+ foreach (var withClass in _config._withClasses)
{
if (!withClass.Key.EndsWith('*'))
{
continue;
}
- var prefix = withClass.Key[0..^1];
+ var prefix = withClass.Key.AsSpan()[..^1];
if (remappedName.StartsWith(prefix, StringComparison.Ordinal))
{
@@ -6915,7 +7002,7 @@ private bool TryGetClass(string remappedName, [MaybeNullWhen(false)] out string
return false;
}
- private string GetNamespace(string remappedName, NamedDecl? namedDecl = null)
+ private string GetNamespace(ReadOnlySpan remappedName, NamedDecl? namedDecl = null)
{
if (!TryGetNamespace(remappedName, out var namespaceName))
{
@@ -6932,37 +7019,32 @@ private string GetNamespace(string remappedName, NamedDecl? namedDecl = null)
return namespaceName;
}
- private bool TryGetNamespace(string remappedName, [MaybeNullWhen(false)] out string namespaceName)
+ private bool TryGetNamespace(ReadOnlySpan remappedName, [MaybeNullWhen(false)] out string namespaceName)
{
- var index = remappedName.IndexOf('*', StringComparison.Ordinal);
+ var index = remappedName.IndexOf('*');
if (index != -1)
{
remappedName = remappedName[..index];
}
- return _config.WithNamespaces.TryGetValue(remappedName, out namespaceName);
+ return _config._withNamespaces.GetAlternateLookup>().TryGetValue(remappedName, out namespaceName);
}
- private bool GetSetLastError(NamedDecl namedDecl) => HasRemapping(namedDecl, _config.WithSetLastErrors, matchStar: true);
+ private bool GetSetLastError(NamedDecl namedDecl) => HasRemapping(namedDecl, _config._withSetLastErrors, matchStar: true);
- private bool HasRemapping(NamedDecl namedDecl, IReadOnlyCollection entries, bool matchStar = false)
+ private bool HasRemapping(NamedDecl namedDecl, HashSet entries, bool matchStar = false)
{
- var name = GetCursorQualifiedName(namedDecl);
+ var name = GetCursorQualifiedName(namedDecl).AsSpan();
if (name.StartsWith("ClangSharpMacro_", StringComparison.Ordinal))
{
name = name["ClangSharpMacro_".Length..];
}
- if (entries.Contains(name))
- {
- return true;
- }
+ var entriesLookup = entries.GetAlternateLookup>();
- name = name.Replace("::", ".", StringComparison.Ordinal);
-
- if (entries.Contains(name))
+ if (entriesLookup.Contains(name))
{
return true;
}
@@ -6974,14 +7056,7 @@ private bool HasRemapping(NamedDecl namedDecl, IReadOnlyCollection entri
name = name["ClangSharpMacro_".Length..];
}
- if (entries.Contains(name))
- {
- return true;
- }
-
- name = name.Replace("::", ".", StringComparison.Ordinal);
-
- if (entries.Contains(name))
+ if (entriesLookup.Contains(name))
{
return true;
}
@@ -6993,26 +7068,21 @@ private bool HasRemapping(NamedDecl namedDecl, IReadOnlyCollection entri
name = name["ClangSharpMacro_".Length..];
}
- return entries.Contains(name) || (matchStar && entries.Contains("*"));
+ return entriesLookup.Contains(name) || (matchStar && entriesLookup.Contains("*"));
}
- private bool TryGetRemappedValue(NamedDecl namedDecl, IReadOnlyDictionary remappings, [MaybeNullWhen(false)] out T value, bool matchStar = false)
+ private bool TryGetRemappedValue(NamedDecl namedDecl, Dictionary remappings, [MaybeNullWhen(false)] out T value, bool matchStar = false)
{
- var name = GetCursorQualifiedName(namedDecl);
+ var name = GetCursorQualifiedName(namedDecl).AsSpan();
if (name.StartsWith("ClangSharpMacro_", StringComparison.Ordinal))
{
name = name["ClangSharpMacro_".Length..];
}
- if (remappings.TryGetValue(name, out value))
- {
- return true;
- }
-
- name = name.Replace("::", ".", StringComparison.Ordinal);
+ var remappingsLookup = remappings.GetAlternateLookup>();
- if (remappings.TryGetValue(name, out value))
+ if (remappingsLookup.TryGetValue(name, out value))
{
return true;
}
@@ -7024,14 +7094,7 @@ private bool TryGetRemappedValue(NamedDecl namedDecl, IReadOnlyDictionary(NamedDecl namedDecl, IReadOnlyDictionary _excludedNames;
- private readonly SortedSet _forceRemappedNames;
- private readonly SortedSet _includedNames;
- private readonly SortedSet _nativeTypeNamesToStrip;
- private readonly SortedSet _withManualImports;
- private readonly SortedSet _traversalNames;
- private readonly SortedSet _withSetLastErrors;
- private readonly SortedSet _withSuppressGCTransitions;
-
- private readonly SortedDictionary _remappedNames;
- private readonly SortedDictionary _withAccessSpecifiers;
- private readonly SortedDictionary> _withAttributes;
- private readonly SortedDictionary _withCallConvs;
- private readonly SortedDictionary _withClasses;
- private readonly SortedDictionary _withGuids;
- private readonly SortedDictionary _withLengths;
- private readonly SortedDictionary _withLibraryPaths;
- private readonly SortedDictionary _withNamespaces;
- private readonly SortedDictionary _withTransparentStructs;
- private readonly SortedDictionary _withTypes;
- private readonly SortedDictionary> _withUsings;
- private readonly SortedDictionary _withPackings;
+ internal readonly HashSet _excludedNames;
+ private readonly HashSet _forceRemappedNames;
+ private readonly HashSet _includedNames;
+ private readonly HashSet _nativeTypeNamesToStrip;
+ private readonly HashSet _withManualImports;
+ private readonly HashSet _traversalNames;
+ internal readonly HashSet _withReadonlys;
+ internal readonly HashSet _withSetLastErrors;
+ internal readonly HashSet _withSuppressGCTransitions;
+
+ internal readonly Dictionary _remappedNames;
+ internal readonly Dictionary _withAccessSpecifiers;
+ internal readonly Dictionary> _withAttributes;
+ internal readonly Dictionary _withCallConvs;
+ internal readonly Dictionary _withClasses;
+ internal readonly Dictionary _withGuids;
+ internal readonly Dictionary _withLengths;
+ private readonly Dictionary _withLibraryPaths;
+ internal readonly Dictionary _withNamespaces;
+ private readonly Dictionary _withTransparentStructs;
+ internal readonly Dictionary _withTypes;
+ internal readonly Dictionary> _withUsings;
+ internal readonly Dictionary _withPackings;
private PInvokeGeneratorConfigurationOptions _options;
@@ -81,28 +82,29 @@ public PInvokeGeneratorConfiguration(string language, string languageStandard, s
_methodPrefixToStrip = DefaultMethodPrefixToStripValue;
_testOutputLocation = DefaultTestOutputLocationValue;
- _excludedNames = [];
- _forceRemappedNames = [];
- _includedNames = [];
- _nativeTypeNamesToStrip = [];
- _withManualImports = [];
- _traversalNames = [];
- _withSetLastErrors = [];
- _withSuppressGCTransitions = [];
-
- _remappedNames = [];
- _withAccessSpecifiers = [];
- _withAttributes = [];
- _withCallConvs = [];
- _withClasses = [];
- _withGuids = [];
- _withLengths = [];
- _withLibraryPaths = [];
- _withNamespaces = [];
- _withTransparentStructs = [];
- _withTypes = [];
- _withUsings = [];
- _withPackings = [];
+ _excludedNames = new HashSet(QualifiedNameComparer.Default);
+ _forceRemappedNames = new HashSet(QualifiedNameComparer.Default);
+ _includedNames = new HashSet(QualifiedNameComparer.Default);
+ _nativeTypeNamesToStrip = new HashSet(StringComparer.Ordinal);
+ _withManualImports = new HashSet(StringComparer.Ordinal);
+ _traversalNames = new HashSet(StringComparer.Ordinal);
+ _withReadonlys = new HashSet(QualifiedNameComparer.Default);
+ _withSetLastErrors = new HashSet(QualifiedNameComparer.Default);
+ _withSuppressGCTransitions = new HashSet(QualifiedNameComparer.Default);
+
+ _remappedNames = new Dictionary(QualifiedNameComparer.Default);
+ _withAccessSpecifiers = new Dictionary(QualifiedNameComparer.Default);
+ _withAttributes = new Dictionary>(QualifiedNameComparer.Default);
+ _withCallConvs = new Dictionary(QualifiedNameComparer.Default);
+ _withClasses = new Dictionary(StringComparer.Ordinal);
+ _withGuids = new Dictionary(QualifiedNameComparer.Default);
+ _withLengths = new Dictionary(QualifiedNameComparer.Default);
+ _withLibraryPaths = new Dictionary(StringComparer.Ordinal);
+ _withNamespaces = new Dictionary(StringComparer.Ordinal);
+ _withTransparentStructs = new Dictionary(StringComparer.Ordinal);
+ _withTypes = new Dictionary(QualifiedNameComparer.Default);
+ _withUsings = new Dictionary>(QualifiedNameComparer.Default);
+ _withPackings = new Dictionary(QualifiedNameComparer.Default);
if ((outputMode == PInvokeGeneratorOutputMode.Xml) && !options.HasFlag(PInvokeGeneratorConfigurationOptions.GenerateMultipleFiles) && (options.HasFlag(PInvokeGeneratorConfigurationOptions.GenerateTestsNUnit) || options.HasFlag(PInvokeGeneratorConfigurationOptions.GenerateTestsXUnit)))
{
@@ -267,6 +269,8 @@ public IReadOnlyCollection ExcludedNames
public bool StripEnumMemberTypeName => _options.HasFlag(PInvokeGeneratorConfigurationOptions.StripEnumMemberTypeName);
+ public bool DontUseUsingStaticsForGuidMember => _options.HasFlag(PInvokeGeneratorConfigurationOptions.DontUseUsingStaticsForGuidMember);
+
public string HeaderText => _headerText;
[AllowNull]
@@ -514,6 +518,20 @@ public IReadOnlyDictionary WithNamespaces
}
}
+ [AllowNull]
+ public IReadOnlyCollection WithReadonlys
+ {
+ get
+ {
+ return _withReadonlys;
+ }
+
+ init
+ {
+ AddRange(_withReadonlys, value);
+ }
+ }
+
[AllowNull]
public IReadOnlyCollection WithSetLastErrors
{
@@ -610,7 +628,7 @@ public static AccessSpecifier ConvertStringToAccessSpecifier(string input)
: input.Equals("public", StringComparison.OrdinalIgnoreCase) ? AccessSpecifier.Public : AccessSpecifier.None;
}
- private static void AddRange(SortedDictionary dictionary, IEnumerable>? keyValuePairs)
+ private static void AddRange(Dictionary dictionary, IEnumerable>? keyValuePairs)
{
if (keyValuePairs != null)
{
@@ -623,7 +641,7 @@ private static void AddRange(SortedDictionary dictionary
}
}
- private static void AddRange(SortedDictionary dictionary, IEnumerable>? keyValuePairs, Func convert)
+ private static void AddRange(Dictionary dictionary, IEnumerable>? keyValuePairs, Func convert)
{
if (keyValuePairs != null)
{
@@ -636,7 +654,7 @@ private static void AddRange(SortedDictionary di
}
}
- private static void AddRange(SortedSet hashSet, IEnumerable? keys)
+ private static void AddRange(HashSet hashSet, IEnumerable? keys)
{
if (keys != null)
{
@@ -647,7 +665,7 @@ private static void AddRange(SortedSet hashSet, IEnumerable(SortedSet hashSet, IEnumerable? keys, Func convert)
+ private static void AddRange(HashSet hashSet, IEnumerable? keys, Func convert)
{
if (keys != null)
{
@@ -658,7 +676,7 @@ private static void AddRange(SortedSet hashSet, IEnumera
}
}
- private static void AddRange(SortedSet hashSet, IEnumerable>? keyValuePairs, Func shouldAdd)
+ private static void AddRange(HashSet hashSet, IEnumerable>? keyValuePairs, Func shouldAdd)
{
if (keyValuePairs != null)
{
diff --git a/sources/ClangSharp.PInvokeGenerator/PInvokeGeneratorConfigurationOptions.cs b/sources/ClangSharp.PInvokeGenerator/PInvokeGeneratorConfigurationOptions.cs
index c2a34293..cd77e71c 100644
--- a/sources/ClangSharp.PInvokeGenerator/PInvokeGeneratorConfigurationOptions.cs
+++ b/sources/ClangSharp.PInvokeGenerator/PInvokeGeneratorConfigurationOptions.cs
@@ -88,4 +88,6 @@ public enum PInvokeGeneratorConfigurationOptions : long
GenerateGenericPointerWrapper = 1L << 38,
StripEnumMemberTypeName = 1L << 39,
+
+ DontUseUsingStaticsForGuidMember = 1L << 40,
}
diff --git a/sources/ClangSharp.PInvokeGenerator/QualifiedNameComparer.cs b/sources/ClangSharp.PInvokeGenerator/QualifiedNameComparer.cs
new file mode 100644
index 00000000..820522ac
--- /dev/null
+++ b/sources/ClangSharp.PInvokeGenerator/QualifiedNameComparer.cs
@@ -0,0 +1,105 @@
+// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
+
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.Diagnostics.CodeAnalysis;
+
+namespace ClangSharp;
+
+internal class QualifiedNameComparer : IEqualityComparer, IAlternateEqualityComparer, string>
+{
+ public static readonly QualifiedNameComparer Default = new QualifiedNameComparer();
+
+ public string Create(ReadOnlySpan alternate) => alternate.ToString();
+
+ public bool Equals(ReadOnlySpan alternate, string other) => Equals(alternate, other.AsSpan());
+
+ public static bool Equals(ReadOnlySpan alternate, ReadOnlySpan other)
+ {
+ while ((alternate.Length != 0) && (other.Length != 0))
+ {
+ if (alternate.StartsWith("::", StringComparison.Ordinal))
+ {
+ if (other.StartsWith('.'))
+ {
+ alternate = alternate[2..];
+ other = other[1..];
+ }
+ else
+ {
+ return false;
+ }
+ }
+ else if (alternate.StartsWith('.'))
+ {
+ if (other.StartsWith("::", StringComparison.Ordinal))
+ {
+ alternate = alternate[1..];
+ other = other[2..];
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ var prefixLength = alternate.CommonPrefixLength(other);
+
+ if (prefixLength == 0)
+ {
+ break;
+ }
+
+ alternate = alternate[prefixLength..];
+ other = other[prefixLength..];
+ }
+
+ return (alternate.Length == 0) && (other.Length == 0);
+ }
+
+ public bool Equals(string? x, string? y) => Equals(x.AsSpan(), y.AsSpan());
+
+ public int GetHashCode(ReadOnlySpan alternate)
+ {
+ var hashCode = new HashCode();
+
+ while (alternate.Length != 0)
+ {
+ var part = alternate;
+ var separatorLength = 0;
+
+ var colonSeparatorIndex = part.IndexOf("::", StringComparison.Ordinal);
+
+ if (colonSeparatorIndex != -1)
+ {
+ part = part[..colonSeparatorIndex];
+ separatorLength = 2;
+ }
+
+ var dotSeparatorIndex = part.IndexOf('.');
+
+ if (dotSeparatorIndex != -1)
+ {
+ part = part[..dotSeparatorIndex];
+ separatorLength = 1;
+ }
+
+ hashCode.Add(string.GetHashCode(part, StringComparison.Ordinal));
+
+ if (separatorLength != 0)
+ {
+ hashCode.Add('.');
+ alternate = alternate[(part.Length + separatorLength)..];
+ }
+ else
+ {
+ alternate = alternate[part.Length..];
+ }
+ }
+
+ return hashCode.ToHashCode();
+ }
+
+ public int GetHashCode([DisallowNull] string obj) => GetHashCode(obj.AsSpan());
+}
diff --git a/sources/ClangSharp.PInvokeGenerator/XML/XmlOutputBuilder.VisitDecl.cs b/sources/ClangSharp.PInvokeGenerator/XML/XmlOutputBuilder.VisitDecl.cs
index 4b9ca7a2..6a4a6f4a 100644
--- a/sources/ClangSharp.PInvokeGenerator/XML/XmlOutputBuilder.VisitDecl.cs
+++ b/sources/ClangSharp.PInvokeGenerator/XML/XmlOutputBuilder.VisitDecl.cs
@@ -142,6 +142,11 @@ public void BeginFunctionOrDelegate(in FunctionOrDelegateDesc desc, ref bool isM
_ = _sb.Append(" static=\"true\"");
}
+ if (desc.IsReadOnly)
+ {
+ _ = _sb.Append(" readonly=\"true\"");
+ }
+
if (desc.IsUnsafe)
{
_ = _sb.Append(" unsafe=\"true\"");
diff --git a/sources/ClangSharp/ClangSharp.csproj b/sources/ClangSharp/ClangSharp.csproj
index d5fee39f..919628d5 100644
--- a/sources/ClangSharp/ClangSharp.csproj
+++ b/sources/ClangSharp/ClangSharp.csproj
@@ -2,14 +2,15 @@
- net8.0
+ net10.0
- $(NoWarn);CA1034;CA1040;CA1720
+
+ $(NoWarn);CA1034;CA1040;CA1720;IDE0130
diff --git a/sources/ClangSharp/Cursors/Attrs/Attr.cs b/sources/ClangSharp/Cursors/Attrs/Attr.cs
index 435f3832..95d1bcfb 100644
--- a/sources/ClangSharp/Cursors/Attrs/Attr.cs
+++ b/sources/ClangSharp/Cursors/Attrs/Attr.cs
@@ -18,371 +18,406 @@ private protected Attr(CXCursor handle) : base(handle, handle.Kind)
internal static new Attr Create(CXCursor handle) => handle.AttrKind switch {
CX_AttrKind_Invalid => new Attr(handle),
- CX_AttrKind_AddressSpace => new TypeAttr(handle),
- CX_AttrKind_AnnotateType => new TypeAttr(handle),
- CX_AttrKind_ArmIn => new TypeAttr(handle),
- CX_AttrKind_ArmInOut => new TypeAttr(handle),
- CX_AttrKind_ArmMveStrictPolymorphism => new TypeAttr(handle),
- CX_AttrKind_ArmOut => new TypeAttr(handle),
- CX_AttrKind_ArmPreserves => new TypeAttr(handle),
- CX_AttrKind_ArmStreaming => new TypeAttr(handle),
- CX_AttrKind_ArmStreamingCompatible => new TypeAttr(handle),
- CX_AttrKind_BTFTypeTag => new TypeAttr(handle),
- CX_AttrKind_CmseNSCall => new TypeAttr(handle),
- CX_AttrKind_HLSLGroupSharedAddressSpace => new TypeAttr(handle),
- CX_AttrKind_HLSLParamModifier => new TypeAttr(handle),
- CX_AttrKind_NoDeref => new TypeAttr(handle),
- CX_AttrKind_ObjCGC => new TypeAttr(handle),
- CX_AttrKind_ObjCInertUnsafeUnretained => new TypeAttr(handle),
- CX_AttrKind_ObjCKindOf => new TypeAttr(handle),
- CX_AttrKind_OpenCLConstantAddressSpace => new TypeAttr(handle),
- CX_AttrKind_OpenCLGenericAddressSpace => new TypeAttr(handle),
- CX_AttrKind_OpenCLGlobalAddressSpace => new TypeAttr(handle),
- CX_AttrKind_OpenCLGlobalDeviceAddressSpace => new TypeAttr(handle),
- CX_AttrKind_OpenCLGlobalHostAddressSpace => new TypeAttr(handle),
- CX_AttrKind_OpenCLLocalAddressSpace => new TypeAttr(handle),
- CX_AttrKind_OpenCLPrivateAddressSpace => new TypeAttr(handle),
- CX_AttrKind_Ptr32 => new TypeAttr(handle),
- CX_AttrKind_Ptr64 => new TypeAttr(handle),
- CX_AttrKind_SPtr => new TypeAttr(handle),
- CX_AttrKind_TypeNonNull => new TypeAttr(handle),
- CX_AttrKind_TypeNullUnspecified => new TypeAttr(handle),
- CX_AttrKind_TypeNullable => new TypeAttr(handle),
- CX_AttrKind_TypeNullableResult => new TypeAttr(handle),
- CX_AttrKind_UPtr => new TypeAttr(handle),
- CX_AttrKind_WebAssemblyFuncref => new TypeAttr(handle),
- CX_AttrKind_CodeAlign => new StmtAttr(handle),
- CX_AttrKind_FallThrough => new StmtAttr(handle),
- CX_AttrKind_Likely => new StmtAttr(handle),
- CX_AttrKind_MustTail => new StmtAttr(handle),
- CX_AttrKind_OpenCLUnrollHint => new StmtAttr(handle),
- CX_AttrKind_Unlikely => new StmtAttr(handle),
- CX_AttrKind_AlwaysInline => new DeclOrStmtAttr(handle),
- CX_AttrKind_NoInline => new DeclOrStmtAttr(handle),
- CX_AttrKind_NoMerge => new DeclOrStmtAttr(handle),
- CX_AttrKind_Suppress => new DeclOrStmtAttr(handle),
- CX_AttrKind_AArch64SVEPcs => new InheritableAttr(handle),
- CX_AttrKind_AArch64VectorPcs => new InheritableAttr(handle),
- CX_AttrKind_AMDGPUKernelCall => new InheritableAttr(handle),
- CX_AttrKind_AcquireHandle => new InheritableAttr(handle),
- CX_AttrKind_AnyX86NoCfCheck => new InheritableAttr(handle),
- CX_AttrKind_CDecl => new InheritableAttr(handle),
- CX_AttrKind_FastCall => new InheritableAttr(handle),
- CX_AttrKind_IntelOclBicc => new InheritableAttr(handle),
- CX_AttrKind_LifetimeBound => new InheritableAttr(handle),
- CX_AttrKind_M68kRTD => new InheritableAttr(handle),
- CX_AttrKind_MSABI => new InheritableAttr(handle),
- CX_AttrKind_NSReturnsRetained => new InheritableAttr(handle),
- CX_AttrKind_ObjCOwnership => new InheritableAttr(handle),
- CX_AttrKind_Pascal => new InheritableAttr(handle),
- CX_AttrKind_Pcs => new InheritableAttr(handle),
- CX_AttrKind_PreserveAll => new InheritableAttr(handle),
- CX_AttrKind_PreserveMost => new InheritableAttr(handle),
- CX_AttrKind_RegCall => new InheritableAttr(handle),
- CX_AttrKind_StdCall => new InheritableAttr(handle),
- CX_AttrKind_SwiftAsyncCall => new InheritableAttr(handle),
- CX_AttrKind_SwiftCall => new InheritableAttr(handle),
- CX_AttrKind_SysVABI => new InheritableAttr(handle),
- CX_AttrKind_ThisCall => new InheritableAttr(handle),
- CX_AttrKind_VectorCall => new InheritableAttr(handle),
- CX_AttrKind_SwiftAsyncContext => new ParameterABIAttr(handle),
- CX_AttrKind_SwiftContext => new ParameterABIAttr(handle),
- CX_AttrKind_SwiftErrorResult => new ParameterABIAttr(handle),
- CX_AttrKind_SwiftIndirectResult => new ParameterABIAttr(handle),
- CX_AttrKind_Annotate => new InheritableParamAttr(handle),
- CX_AttrKind_CFConsumed => new InheritableParamAttr(handle),
- CX_AttrKind_CarriesDependency => new InheritableParamAttr(handle),
- CX_AttrKind_NSConsumed => new InheritableParamAttr(handle),
- CX_AttrKind_NonNull => new InheritableParamAttr(handle),
- CX_AttrKind_OSConsumed => new InheritableParamAttr(handle),
- CX_AttrKind_PassObjectSize => new InheritableParamAttr(handle),
- CX_AttrKind_ReleaseHandle => new InheritableParamAttr(handle),
- CX_AttrKind_UseHandle => new InheritableParamAttr(handle),
- CX_AttrKind_HLSLSV_DispatchThreadID => new HLSLAnnotationAttr(handle),
- CX_AttrKind_HLSLSV_GroupIndex => new HLSLAnnotationAttr(handle),
- CX_AttrKind_AMDGPUFlatWorkGroupSize => new InheritableAttr(handle),
- CX_AttrKind_AMDGPUNumSGPR => new InheritableAttr(handle),
- CX_AttrKind_AMDGPUNumVGPR => new InheritableAttr(handle),
- CX_AttrKind_AMDGPUWavesPerEU => new InheritableAttr(handle),
- CX_AttrKind_ARMInterrupt => new InheritableAttr(handle),
- CX_AttrKind_AVRInterrupt => new InheritableAttr(handle),
- CX_AttrKind_AVRSignal => new InheritableAttr(handle),
- CX_AttrKind_AcquireCapability => new InheritableAttr(handle),
- CX_AttrKind_AcquiredAfter => new InheritableAttr(handle),
- CX_AttrKind_AcquiredBefore => new InheritableAttr(handle),
- CX_AttrKind_AlignMac68k => new InheritableAttr(handle),
- CX_AttrKind_AlignNatural => new InheritableAttr(handle),
- CX_AttrKind_Aligned => new InheritableAttr(handle),
- CX_AttrKind_AllocAlign => new InheritableAttr(handle),
- CX_AttrKind_AllocSize => new InheritableAttr(handle),
- CX_AttrKind_AlwaysDestroy => new InheritableAttr(handle),
- CX_AttrKind_AnalyzerNoReturn => new InheritableAttr(handle),
- CX_AttrKind_AnyX86Interrupt => new InheritableAttr(handle),
- CX_AttrKind_AnyX86NoCallerSavedRegisters => new InheritableAttr(handle),
- CX_AttrKind_ArcWeakrefUnavailable => new InheritableAttr(handle),
- CX_AttrKind_ArgumentWithTypeTag => new InheritableAttr(handle),
- CX_AttrKind_ArmBuiltinAlias => new InheritableAttr(handle),
- CX_AttrKind_ArmLocallyStreaming => new InheritableAttr(handle),
- CX_AttrKind_ArmNew => new InheritableAttr(handle),
- CX_AttrKind_Artificial => new InheritableAttr(handle),
- CX_AttrKind_AsmLabel => new InheritableAttr(handle),
- CX_AttrKind_AssertCapability => new InheritableAttr(handle),
- CX_AttrKind_AssertExclusiveLock => new InheritableAttr(handle),
- CX_AttrKind_AssertSharedLock => new InheritableAttr(handle),
- CX_AttrKind_AssumeAligned => new InheritableAttr(handle),
- CX_AttrKind_Assumption => new InheritableAttr(handle),
- CX_AttrKind_Availability => new InheritableAttr(handle),
- CX_AttrKind_AvailableOnlyInDefaultEvalMethod => new InheritableAttr(handle),
- CX_AttrKind_BPFPreserveAccessIndex => new InheritableAttr(handle),
- CX_AttrKind_BPFPreserveStaticOffset => new InheritableAttr(handle),
- CX_AttrKind_BTFDeclTag => new InheritableAttr(handle),
- CX_AttrKind_Blocks => new InheritableAttr(handle),
- CX_AttrKind_Builtin => new InheritableAttr(handle),
- CX_AttrKind_C11NoReturn => new InheritableAttr(handle),
- CX_AttrKind_CFAuditedTransfer => new InheritableAttr(handle),
- CX_AttrKind_CFGuard => new InheritableAttr(handle),
- CX_AttrKind_CFICanonicalJumpTable => new InheritableAttr(handle),
- CX_AttrKind_CFReturnsNotRetained => new InheritableAttr(handle),
- CX_AttrKind_CFReturnsRetained => new InheritableAttr(handle),
- CX_AttrKind_CFUnknownTransfer => new InheritableAttr(handle),
- CX_AttrKind_CPUDispatch => new InheritableAttr(handle),
- CX_AttrKind_CPUSpecific => new InheritableAttr(handle),
- CX_AttrKind_CUDAConstant => new InheritableAttr(handle),
- CX_AttrKind_CUDADevice => new InheritableAttr(handle),
- CX_AttrKind_CUDADeviceBuiltinSurfaceType => new InheritableAttr(handle),
- CX_AttrKind_CUDADeviceBuiltinTextureType => new InheritableAttr(handle),
- CX_AttrKind_CUDAGlobal => new InheritableAttr(handle),
- CX_AttrKind_CUDAHost => new InheritableAttr(handle),
- CX_AttrKind_CUDAInvalidTarget => new InheritableAttr(handle),
- CX_AttrKind_CUDALaunchBounds => new InheritableAttr(handle),
- CX_AttrKind_CUDAShared => new InheritableAttr(handle),
- CX_AttrKind_CXX11NoReturn => new InheritableAttr(handle),
- CX_AttrKind_CallableWhen => new InheritableAttr(handle),
- CX_AttrKind_Callback => new InheritableAttr(handle),
- CX_AttrKind_Capability => new InheritableAttr(handle),
- CX_AttrKind_CapturedRecord => new InheritableAttr(handle),
- CX_AttrKind_Cleanup => new InheritableAttr(handle),
- CX_AttrKind_CmseNSEntry => new InheritableAttr(handle),
- CX_AttrKind_CodeModel => new InheritableAttr(handle),
- CX_AttrKind_CodeSeg => new InheritableAttr(handle),
- CX_AttrKind_Cold => new InheritableAttr(handle),
- CX_AttrKind_Common => new InheritableAttr(handle),
- CX_AttrKind_Const => new InheritableAttr(handle),
- CX_AttrKind_ConstInit => new InheritableAttr(handle),
- CX_AttrKind_Constructor => new InheritableAttr(handle),
- CX_AttrKind_Consumable => new InheritableAttr(handle),
- CX_AttrKind_ConsumableAutoCast => new InheritableAttr(handle),
- CX_AttrKind_ConsumableSetOnRead => new InheritableAttr(handle),
- CX_AttrKind_Convergent => new InheritableAttr(handle),
- CX_AttrKind_CoroDisableLifetimeBound => new InheritableAttr(handle),
- CX_AttrKind_CoroLifetimeBound => new InheritableAttr(handle),
- CX_AttrKind_CoroOnlyDestroyWhenComplete => new InheritableAttr(handle),
- CX_AttrKind_CoroReturnType => new InheritableAttr(handle),
- CX_AttrKind_CoroWrapper => new InheritableAttr(handle),
- CX_AttrKind_CountedBy => new InheritableAttr(handle),
- CX_AttrKind_DLLExport => new InheritableAttr(handle),
- CX_AttrKind_DLLExportStaticLocal => new InheritableAttr(handle),
- CX_AttrKind_DLLImport => new InheritableAttr(handle),
- CX_AttrKind_DLLImportStaticLocal => new InheritableAttr(handle),
- CX_AttrKind_Deprecated => new InheritableAttr(handle),
- CX_AttrKind_Destructor => new InheritableAttr(handle),
- CX_AttrKind_DiagnoseAsBuiltin => new InheritableAttr(handle),
- CX_AttrKind_DiagnoseIf => new InheritableAttr(handle),
- CX_AttrKind_DisableSanitizerInstrumentation => new InheritableAttr(handle),
- CX_AttrKind_DisableTailCalls => new InheritableAttr(handle),
- CX_AttrKind_EmptyBases => new InheritableAttr(handle),
- CX_AttrKind_EnableIf => new InheritableAttr(handle),
- CX_AttrKind_EnforceTCB => new InheritableAttr(handle),
- CX_AttrKind_EnforceTCBLeaf => new InheritableAttr(handle),
- CX_AttrKind_EnumExtensibility => new InheritableAttr(handle),
- CX_AttrKind_Error => new InheritableAttr(handle),
- CX_AttrKind_ExcludeFromExplicitInstantiation => new InheritableAttr(handle),
- CX_AttrKind_ExclusiveTrylockFunction => new InheritableAttr(handle),
- CX_AttrKind_ExternalSourceSymbol => new InheritableAttr(handle),
- CX_AttrKind_Final => new InheritableAttr(handle),
- CX_AttrKind_FlagEnum => new InheritableAttr(handle),
- CX_AttrKind_Flatten => new InheritableAttr(handle),
- CX_AttrKind_Format => new InheritableAttr(handle),
- CX_AttrKind_FormatArg => new InheritableAttr(handle),
- CX_AttrKind_FunctionReturnThunks => new InheritableAttr(handle),
- CX_AttrKind_GNUInline => new InheritableAttr(handle),
- CX_AttrKind_GuardedBy => new InheritableAttr(handle),
- CX_AttrKind_GuardedVar => new InheritableAttr(handle),
- CX_AttrKind_HIPManaged => new InheritableAttr(handle),
- CX_AttrKind_HLSLNumThreads => new InheritableAttr(handle),
- CX_AttrKind_HLSLResource => new InheritableAttr(handle),
- CX_AttrKind_HLSLResourceBinding => new InheritableAttr(handle),
- CX_AttrKind_HLSLShader => new InheritableAttr(handle),
- CX_AttrKind_Hot => new InheritableAttr(handle),
- CX_AttrKind_IBAction => new InheritableAttr(handle),
- CX_AttrKind_IBOutlet => new InheritableAttr(handle),
- CX_AttrKind_IBOutletCollection => new InheritableAttr(handle),
- CX_AttrKind_InitPriority => new InheritableAttr(handle),
- CX_AttrKind_InternalLinkage => new InheritableAttr(handle),
- CX_AttrKind_LTOVisibilityPublic => new InheritableAttr(handle),
- CX_AttrKind_LayoutVersion => new InheritableAttr(handle),
- CX_AttrKind_Leaf => new InheritableAttr(handle),
- CX_AttrKind_LockReturned => new InheritableAttr(handle),
- CX_AttrKind_LocksExcluded => new InheritableAttr(handle),
- CX_AttrKind_M68kInterrupt => new InheritableAttr(handle),
- CX_AttrKind_MIGServerRoutine => new InheritableAttr(handle),
- CX_AttrKind_MSAllocator => new InheritableAttr(handle),
- CX_AttrKind_MSConstexpr => new InheritableAttr(handle),
- CX_AttrKind_MSInheritance => new InheritableAttr(handle),
- CX_AttrKind_MSNoVTable => new InheritableAttr(handle),
- CX_AttrKind_MSP430Interrupt => new InheritableAttr(handle),
- CX_AttrKind_MSStruct => new InheritableAttr(handle),
- CX_AttrKind_MSVtorDisp => new InheritableAttr(handle),
- CX_AttrKind_MaxFieldAlignment => new InheritableAttr(handle),
- CX_AttrKind_MayAlias => new InheritableAttr(handle),
- CX_AttrKind_MaybeUndef => new InheritableAttr(handle),
- CX_AttrKind_MicroMips => new InheritableAttr(handle),
- CX_AttrKind_MinSize => new InheritableAttr(handle),
- CX_AttrKind_MinVectorWidth => new InheritableAttr(handle),
- CX_AttrKind_Mips16 => new InheritableAttr(handle),
- CX_AttrKind_MipsInterrupt => new InheritableAttr(handle),
- CX_AttrKind_MipsLongCall => new InheritableAttr(handle),
- CX_AttrKind_MipsShortCall => new InheritableAttr(handle),
- CX_AttrKind_NSConsumesSelf => new InheritableAttr(handle),
- CX_AttrKind_NSErrorDomain => new InheritableAttr(handle),
- CX_AttrKind_NSReturnsAutoreleased => new InheritableAttr(handle),
- CX_AttrKind_NSReturnsNotRetained => new InheritableAttr(handle),
- CX_AttrKind_NVPTXKernel => new InheritableAttr(handle),
- CX_AttrKind_Naked => new InheritableAttr(handle),
- CX_AttrKind_NoAlias => new InheritableAttr(handle),
- CX_AttrKind_NoCommon => new InheritableAttr(handle),
- CX_AttrKind_NoDebug => new InheritableAttr(handle),
- CX_AttrKind_NoDestroy => new InheritableAttr(handle),
- CX_AttrKind_NoDuplicate => new InheritableAttr(handle),
- CX_AttrKind_NoInstrumentFunction => new InheritableAttr(handle),
- CX_AttrKind_NoMicroMips => new InheritableAttr(handle),
- CX_AttrKind_NoMips16 => new InheritableAttr(handle),
- CX_AttrKind_NoProfileFunction => new InheritableAttr(handle),
- CX_AttrKind_NoRandomizeLayout => new InheritableAttr(handle),
- CX_AttrKind_NoReturn => new InheritableAttr(handle),
- CX_AttrKind_NoSanitize => new InheritableAttr(handle),
- CX_AttrKind_NoSpeculativeLoadHardening => new InheritableAttr(handle),
- CX_AttrKind_NoSplitStack => new InheritableAttr(handle),
- CX_AttrKind_NoStackProtector => new InheritableAttr(handle),
- CX_AttrKind_NoThreadSafetyAnalysis => new InheritableAttr(handle),
- CX_AttrKind_NoThrow => new InheritableAttr(handle),
- CX_AttrKind_NoUniqueAddress => new InheritableAttr(handle),
- CX_AttrKind_NoUwtable => new InheritableAttr(handle),
- CX_AttrKind_NotTailCalled => new InheritableAttr(handle),
- CX_AttrKind_OMPAllocateDecl => new InheritableAttr(handle),
- CX_AttrKind_OMPCaptureNoInit => new InheritableAttr(handle),
- CX_AttrKind_OMPDeclareTargetDecl => new InheritableAttr(handle),
- CX_AttrKind_OMPDeclareVariant => new InheritableAttr(handle),
- CX_AttrKind_OMPThreadPrivateDecl => new InheritableAttr(handle),
- CX_AttrKind_OSConsumesThis => new InheritableAttr(handle),
- CX_AttrKind_OSReturnsNotRetained => new InheritableAttr(handle),
- CX_AttrKind_OSReturnsRetained => new InheritableAttr(handle),
- CX_AttrKind_OSReturnsRetainedOnNonZero => new InheritableAttr(handle),
- CX_AttrKind_OSReturnsRetainedOnZero => new InheritableAttr(handle),
- CX_AttrKind_ObjCBridge => new InheritableAttr(handle),
- CX_AttrKind_ObjCBridgeMutable => new InheritableAttr(handle),
- CX_AttrKind_ObjCBridgeRelated => new InheritableAttr(handle),
- CX_AttrKind_ObjCException => new InheritableAttr(handle),
- CX_AttrKind_ObjCExplicitProtocolImpl => new InheritableAttr(handle),
- CX_AttrKind_ObjCExternallyRetained => new InheritableAttr(handle),
- CX_AttrKind_ObjCIndependentClass => new InheritableAttr(handle),
- CX_AttrKind_ObjCMethodFamily => new InheritableAttr(handle),
- CX_AttrKind_ObjCNSObject => new InheritableAttr(handle),
- CX_AttrKind_ObjCPreciseLifetime => new InheritableAttr(handle),
- CX_AttrKind_ObjCRequiresPropertyDefs => new InheritableAttr(handle),
- CX_AttrKind_ObjCRequiresSuper => new InheritableAttr(handle),
- CX_AttrKind_ObjCReturnsInnerPointer => new InheritableAttr(handle),
- CX_AttrKind_ObjCRootClass => new InheritableAttr(handle),
- CX_AttrKind_ObjCSubclassingRestricted => new InheritableAttr(handle),
- CX_AttrKind_OpenCLIntelReqdSubGroupSize => new InheritableAttr(handle),
- CX_AttrKind_OpenCLKernel => new InheritableAttr(handle),
- CX_AttrKind_OptimizeNone => new InheritableAttr(handle),
- CX_AttrKind_Override => new InheritableAttr(handle),
- CX_AttrKind_Owner => new InheritableAttr(handle),
- CX_AttrKind_Ownership => new InheritableAttr(handle),
- CX_AttrKind_Packed => new InheritableAttr(handle),
- CX_AttrKind_ParamTypestate => new InheritableAttr(handle),
- CX_AttrKind_PatchableFunctionEntry => new InheritableAttr(handle),
- CX_AttrKind_Pointer => new InheritableAttr(handle),
- CX_AttrKind_PragmaClangBSSSection => new InheritableAttr(handle),
- CX_AttrKind_PragmaClangDataSection => new InheritableAttr(handle),
- CX_AttrKind_PragmaClangRelroSection => new InheritableAttr(handle),
- CX_AttrKind_PragmaClangRodataSection => new InheritableAttr(handle),
- CX_AttrKind_PragmaClangTextSection => new InheritableAttr(handle),
- CX_AttrKind_PreferredName => new InheritableAttr(handle),
- CX_AttrKind_PreferredType => new InheritableAttr(handle),
- CX_AttrKind_PtGuardedBy => new InheritableAttr(handle),
- CX_AttrKind_PtGuardedVar => new InheritableAttr(handle),
- CX_AttrKind_Pure => new InheritableAttr(handle),
- CX_AttrKind_RISCVInterrupt => new InheritableAttr(handle),
- CX_AttrKind_RandomizeLayout => new InheritableAttr(handle),
- CX_AttrKind_ReadOnlyPlacement => new InheritableAttr(handle),
- CX_AttrKind_Reinitializes => new InheritableAttr(handle),
- CX_AttrKind_ReleaseCapability => new InheritableAttr(handle),
- CX_AttrKind_ReqdWorkGroupSize => new InheritableAttr(handle),
- CX_AttrKind_RequiresCapability => new InheritableAttr(handle),
- CX_AttrKind_Restrict => new InheritableAttr(handle),
- CX_AttrKind_Retain => new InheritableAttr(handle),
- CX_AttrKind_ReturnTypestate => new InheritableAttr(handle),
- CX_AttrKind_ReturnsNonNull => new InheritableAttr(handle),
- CX_AttrKind_ReturnsTwice => new InheritableAttr(handle),
- CX_AttrKind_SYCLKernel => new InheritableAttr(handle),
- CX_AttrKind_SYCLSpecialClass => new InheritableAttr(handle),
- CX_AttrKind_ScopedLockable => new InheritableAttr(handle),
- CX_AttrKind_Section => new InheritableAttr(handle),
- CX_AttrKind_SelectAny => new InheritableAttr(handle),
- CX_AttrKind_Sentinel => new InheritableAttr(handle),
- CX_AttrKind_SetTypestate => new InheritableAttr(handle),
- CX_AttrKind_SharedTrylockFunction => new InheritableAttr(handle),
- CX_AttrKind_SpeculativeLoadHardening => new InheritableAttr(handle),
- CX_AttrKind_StandaloneDebug => new InheritableAttr(handle),
- CX_AttrKind_StrictFP => new InheritableAttr(handle),
- CX_AttrKind_StrictGuardStackCheck => new InheritableAttr(handle),
- CX_AttrKind_SwiftAsync => new InheritableAttr(handle),
- CX_AttrKind_SwiftAsyncError => new InheritableAttr(handle),
- CX_AttrKind_SwiftAsyncName => new InheritableAttr(handle),
- CX_AttrKind_SwiftAttr => new InheritableAttr(handle),
- CX_AttrKind_SwiftBridge => new InheritableAttr(handle),
- CX_AttrKind_SwiftBridgedTypedef => new InheritableAttr(handle),
- CX_AttrKind_SwiftError => new InheritableAttr(handle),
- CX_AttrKind_SwiftImportAsNonGeneric => new InheritableAttr(handle),
- CX_AttrKind_SwiftImportPropertyAsAccessors => new InheritableAttr(handle),
- CX_AttrKind_SwiftName => new InheritableAttr(handle),
- CX_AttrKind_SwiftNewType => new InheritableAttr(handle),
- CX_AttrKind_SwiftPrivate => new InheritableAttr(handle),
- CX_AttrKind_TLSModel => new InheritableAttr(handle),
- CX_AttrKind_Target => new InheritableAttr(handle),
- CX_AttrKind_TargetClones => new InheritableAttr(handle),
- CX_AttrKind_TargetVersion => new InheritableAttr(handle),
- CX_AttrKind_TestTypestate => new InheritableAttr(handle),
- CX_AttrKind_TransparentUnion => new InheritableAttr(handle),
- CX_AttrKind_TrivialABI => new InheritableAttr(handle),
- CX_AttrKind_TryAcquireCapability => new InheritableAttr(handle),
- CX_AttrKind_TypeTagForDatatype => new InheritableAttr(handle),
- CX_AttrKind_TypeVisibility => new InheritableAttr(handle),
- CX_AttrKind_Unavailable => new InheritableAttr(handle),
- CX_AttrKind_Uninitialized => new InheritableAttr(handle),
- CX_AttrKind_UnsafeBufferUsage => new InheritableAttr(handle),
- CX_AttrKind_Unused => new InheritableAttr(handle),
- CX_AttrKind_Used => new InheritableAttr(handle),
- CX_AttrKind_UsingIfExists => new InheritableAttr(handle),
- CX_AttrKind_Uuid => new InheritableAttr(handle),
- CX_AttrKind_VecReturn => new InheritableAttr(handle),
- CX_AttrKind_VecTypeHint => new InheritableAttr(handle),
- CX_AttrKind_Visibility => new InheritableAttr(handle),
- CX_AttrKind_WarnUnused => new InheritableAttr(handle),
- CX_AttrKind_WarnUnusedResult => new InheritableAttr(handle),
- CX_AttrKind_Weak => new InheritableAttr(handle),
- CX_AttrKind_WeakImport => new InheritableAttr(handle),
- CX_AttrKind_WeakRef => new InheritableAttr(handle),
- CX_AttrKind_WebAssemblyExportName => new InheritableAttr(handle),
- CX_AttrKind_WebAssemblyImportModule => new InheritableAttr(handle),
- CX_AttrKind_WebAssemblyImportName => new InheritableAttr(handle),
- CX_AttrKind_WorkGroupSizeHint => new InheritableAttr(handle),
- CX_AttrKind_X86ForceAlignArgPointer => new InheritableAttr(handle),
- CX_AttrKind_XRayInstrument => new InheritableAttr(handle),
- CX_AttrKind_XRayLogArgs => new InheritableAttr(handle),
- CX_AttrKind_ZeroCallUsedRegs => new InheritableAttr(handle),
+ CX_AttrKind_AddressSpace => new Attr(handle),
+ CX_AttrKind_Allocating => new Attr(handle),
+ CX_AttrKind_AnnotateType => new Attr(handle),
+ CX_AttrKind_ArmAgnostic => new Attr(handle),
+ CX_AttrKind_ArmIn => new Attr(handle),
+ CX_AttrKind_ArmInOut => new Attr(handle),
+ CX_AttrKind_ArmMveStrictPolymorphism => new Attr(handle),
+ CX_AttrKind_ArmOut => new Attr(handle),
+ CX_AttrKind_ArmPreserves => new Attr(handle),
+ CX_AttrKind_ArmStreaming => new Attr(handle),
+ CX_AttrKind_ArmStreamingCompatible => new Attr(handle),
+ CX_AttrKind_BTFTypeTag => new Attr(handle),
+ CX_AttrKind_Blocking => new Attr(handle),
+ CX_AttrKind_CmseNSCall => new Attr(handle),
+ CX_AttrKind_HLSLContainedType => new Attr(handle),
+ CX_AttrKind_HLSLGroupSharedAddressSpace => new Attr(handle),
+ CX_AttrKind_HLSLROV => new Attr(handle),
+ CX_AttrKind_HLSLRawBuffer => new Attr(handle),
+ CX_AttrKind_HLSLResourceClass => new Attr(handle),
+ CX_AttrKind_NoDeref => new Attr(handle),
+ CX_AttrKind_NonAllocating => new Attr(handle),
+ CX_AttrKind_NonBlocking => new Attr(handle),
+ CX_AttrKind_ObjCGC => new Attr(handle),
+ CX_AttrKind_ObjCInertUnsafeUnretained => new Attr(handle),
+ CX_AttrKind_ObjCKindOf => new Attr(handle),
+ CX_AttrKind_OpenCLConstantAddressSpace => new Attr(handle),
+ CX_AttrKind_OpenCLGenericAddressSpace => new Attr(handle),
+ CX_AttrKind_OpenCLGlobalAddressSpace => new Attr(handle),
+ CX_AttrKind_OpenCLGlobalDeviceAddressSpace => new Attr(handle),
+ CX_AttrKind_OpenCLGlobalHostAddressSpace => new Attr(handle),
+ CX_AttrKind_OpenCLLocalAddressSpace => new Attr(handle),
+ CX_AttrKind_OpenCLPrivateAddressSpace => new Attr(handle),
+ CX_AttrKind_Ptr32 => new Attr(handle),
+ CX_AttrKind_Ptr64 => new Attr(handle),
+ CX_AttrKind_SPtr => new Attr(handle),
+ CX_AttrKind_TypeNonNull => new Attr(handle),
+ CX_AttrKind_TypeNullUnspecified => new Attr(handle),
+ CX_AttrKind_TypeNullableResult => new Attr(handle),
+ CX_AttrKind_UPtr => new Attr(handle),
+ CX_AttrKind_WebAssemblyFuncref => new Attr(handle),
+ CX_AttrKind_CXXAssume => new Attr(handle),
+ CX_AttrKind_CodeAlign => new Attr(handle),
+ CX_AttrKind_FallThrough => new Attr(handle),
+ CX_AttrKind_HLSLControlFlowHint => new Attr(handle),
+ CX_AttrKind_HLSLLoopHint => new Attr(handle),
+ CX_AttrKind_Likely => new Attr(handle),
+ CX_AttrKind_MustTail => new Attr(handle),
+ CX_AttrKind_OpenCLUnrollHint => new Attr(handle),
+ CX_AttrKind_Unlikely => new Attr(handle),
+ CX_AttrKind_AlwaysInline => new Attr(handle),
+ CX_AttrKind_NoInline => new Attr(handle),
+ CX_AttrKind_NoMerge => new Attr(handle),
+ CX_AttrKind_Suppress => new Attr(handle),
+ CX_AttrKind_AArch64SVEPcs => new Attr(handle),
+ CX_AttrKind_AArch64VectorPcs => new Attr(handle),
+ CX_AttrKind_AMDGPUKernelCall => new Attr(handle),
+ CX_AttrKind_AcquireHandle => new Attr(handle),
+ CX_AttrKind_AnyX86NoCfCheck => new Attr(handle),
+ CX_AttrKind_CDecl => new Attr(handle),
+ CX_AttrKind_CountedBy => new Attr(handle),
+ CX_AttrKind_CountedByOrNull => new Attr(handle),
+ CX_AttrKind_FastCall => new Attr(handle),
+ CX_AttrKind_IntelOclBicc => new Attr(handle),
+ CX_AttrKind_LifetimeBound => new Attr(handle),
+ CX_AttrKind_LifetimeCaptureBy => new Attr(handle),
+ CX_AttrKind_M68kRTD => new Attr(handle),
+ CX_AttrKind_MSABI => new Attr(handle),
+ CX_AttrKind_NSReturnsRetained => new Attr(handle),
+ CX_AttrKind_ObjCOwnership => new Attr(handle),
+ CX_AttrKind_Pascal => new Attr(handle),
+ CX_AttrKind_Pcs => new Attr(handle),
+ CX_AttrKind_PreserveAll => new Attr(handle),
+ CX_AttrKind_PreserveMost => new Attr(handle),
+ CX_AttrKind_PreserveNone => new Attr(handle),
+ CX_AttrKind_RISCVVectorCC => new Attr(handle),
+ CX_AttrKind_RegCall => new Attr(handle),
+ CX_AttrKind_SizedBy => new Attr(handle),
+ CX_AttrKind_SizedByOrNull => new Attr(handle),
+ CX_AttrKind_StdCall => new Attr(handle),
+ CX_AttrKind_SwiftAsyncCall => new Attr(handle),
+ CX_AttrKind_SwiftAttr => new Attr(handle),
+ CX_AttrKind_SwiftCall => new Attr(handle),
+ CX_AttrKind_SysVABI => new Attr(handle),
+ CX_AttrKind_ThisCall => new Attr(handle),
+ CX_AttrKind_TypeNullable => new Attr(handle),
+ CX_AttrKind_VectorCall => new Attr(handle),
+ CX_AttrKind_Annotate => new Attr(handle),
+ CX_AttrKind_HLSLParamModifier => new Attr(handle),
+ CX_AttrKind_SwiftAsyncContext => new Attr(handle),
+ CX_AttrKind_SwiftContext => new Attr(handle),
+ CX_AttrKind_SwiftErrorResult => new Attr(handle),
+ CX_AttrKind_SwiftIndirectResult => new Attr(handle),
+ CX_AttrKind_CFConsumed => new Attr(handle),
+ CX_AttrKind_CarriesDependency => new Attr(handle),
+ CX_AttrKind_NSConsumed => new Attr(handle),
+ CX_AttrKind_NonNull => new Attr(handle),
+ CX_AttrKind_OSConsumed => new Attr(handle),
+ CX_AttrKind_PassObjectSize => new Attr(handle),
+ CX_AttrKind_ReleaseHandle => new Attr(handle),
+ CX_AttrKind_UseHandle => new Attr(handle),
+ CX_AttrKind_HLSLPackOffset => new Attr(handle),
+ CX_AttrKind_HLSLSV_DispatchThreadID => new Attr(handle),
+ CX_AttrKind_HLSLSV_GroupID => new Attr(handle),
+ CX_AttrKind_HLSLSV_GroupIndex => new Attr(handle),
+ CX_AttrKind_HLSLSV_GroupThreadID => new Attr(handle),
+ CX_AttrKind_AMDGPUFlatWorkGroupSize => new Attr(handle),
+ CX_AttrKind_AMDGPUMaxNumWorkGroups => new Attr(handle),
+ CX_AttrKind_AMDGPUNumSGPR => new Attr(handle),
+ CX_AttrKind_AMDGPUNumVGPR => new Attr(handle),
+ CX_AttrKind_AMDGPUWavesPerEU => new Attr(handle),
+ CX_AttrKind_ARMInterrupt => new Attr(handle),
+ CX_AttrKind_AVRInterrupt => new Attr(handle),
+ CX_AttrKind_AVRSignal => new Attr(handle),
+ CX_AttrKind_AcquireCapability => new Attr(handle),
+ CX_AttrKind_AcquiredAfter => new Attr(handle),
+ CX_AttrKind_AcquiredBefore => new Attr(handle),
+ CX_AttrKind_AlignMac68k => new Attr(handle),
+ CX_AttrKind_AlignNatural => new Attr(handle),
+ CX_AttrKind_Aligned => new Attr(handle),
+ CX_AttrKind_AllocAlign => new Attr(handle),
+ CX_AttrKind_AllocSize => new Attr(handle),
+ CX_AttrKind_AlwaysDestroy => new Attr(handle),
+ CX_AttrKind_AnalyzerNoReturn => new Attr(handle),
+ CX_AttrKind_AnyX86Interrupt => new Attr(handle),
+ CX_AttrKind_AnyX86NoCallerSavedRegisters => new Attr(handle),
+ CX_AttrKind_ArcWeakrefUnavailable => new Attr(handle),
+ CX_AttrKind_ArgumentWithTypeTag => new Attr(handle),
+ CX_AttrKind_ArmBuiltinAlias => new Attr(handle),
+ CX_AttrKind_ArmLocallyStreaming => new Attr(handle),
+ CX_AttrKind_ArmNew => new Attr(handle),
+ CX_AttrKind_Artificial => new Attr(handle),
+ CX_AttrKind_AsmLabel => new Attr(handle),
+ CX_AttrKind_AssertCapability => new Attr(handle),
+ CX_AttrKind_AssertExclusiveLock => new Attr(handle),
+ CX_AttrKind_AssertSharedLock => new Attr(handle),
+ CX_AttrKind_AssumeAligned => new Attr(handle),
+ CX_AttrKind_Availability => new Attr(handle),
+ CX_AttrKind_AvailableOnlyInDefaultEvalMethod => new Attr(handle),
+ CX_AttrKind_BPFFastCall => new Attr(handle),
+ CX_AttrKind_BPFPreserveAccessIndex => new Attr(handle),
+ CX_AttrKind_BPFPreserveStaticOffset => new Attr(handle),
+ CX_AttrKind_BTFDeclTag => new Attr(handle),
+ CX_AttrKind_Blocks => new Attr(handle),
+ CX_AttrKind_Builtin => new Attr(handle),
+ CX_AttrKind_C11NoReturn => new Attr(handle),
+ CX_AttrKind_CFAuditedTransfer => new Attr(handle),
+ CX_AttrKind_CFGuard => new Attr(handle),
+ CX_AttrKind_CFICanonicalJumpTable => new Attr(handle),
+ CX_AttrKind_CFReturnsNotRetained => new Attr(handle),
+ CX_AttrKind_CFReturnsRetained => new Attr(handle),
+ CX_AttrKind_CFUnknownTransfer => new Attr(handle),
+ CX_AttrKind_CPUDispatch => new Attr(handle),
+ CX_AttrKind_CPUSpecific => new Attr(handle),
+ CX_AttrKind_CUDAConstant => new Attr(handle),
+ CX_AttrKind_CUDADevice => new Attr(handle),
+ CX_AttrKind_CUDADeviceBuiltinSurfaceType => new Attr(handle),
+ CX_AttrKind_CUDADeviceBuiltinTextureType => new Attr(handle),
+ CX_AttrKind_CUDAGlobal => new Attr(handle),
+ CX_AttrKind_CUDAGridConstant => new Attr(handle),
+ CX_AttrKind_CUDAHost => new Attr(handle),
+ CX_AttrKind_CUDAInvalidTarget => new Attr(handle),
+ CX_AttrKind_CUDALaunchBounds => new Attr(handle),
+ CX_AttrKind_CUDAShared => new Attr(handle),
+ CX_AttrKind_CXX11NoReturn => new Attr(handle),
+ CX_AttrKind_CallableWhen => new Attr(handle),
+ CX_AttrKind_Callback => new Attr(handle),
+ CX_AttrKind_Capability => new Attr(handle),
+ CX_AttrKind_CapturedRecord => new Attr(handle),
+ CX_AttrKind_Cleanup => new Attr(handle),
+ CX_AttrKind_ClspvLibclcBuiltin => new Attr(handle),
+ CX_AttrKind_CmseNSEntry => new Attr(handle),
+ CX_AttrKind_CodeModel => new Attr(handle),
+ CX_AttrKind_CodeSeg => new Attr(handle),
+ CX_AttrKind_Cold => new Attr(handle),
+ CX_AttrKind_Common => new Attr(handle),
+ CX_AttrKind_Const => new Attr(handle),
+ CX_AttrKind_ConstInit => new Attr(handle),
+ CX_AttrKind_Constructor => new Attr(handle),
+ CX_AttrKind_Consumable => new Attr(handle),
+ CX_AttrKind_ConsumableAutoCast => new Attr(handle),
+ CX_AttrKind_ConsumableSetOnRead => new Attr(handle),
+ CX_AttrKind_Convergent => new Attr(handle),
+ CX_AttrKind_CoroAwaitElidable => new Attr(handle),
+ CX_AttrKind_CoroAwaitElidableArgument => new Attr(handle),
+ CX_AttrKind_CoroDisableLifetimeBound => new Attr(handle),
+ CX_AttrKind_CoroLifetimeBound => new Attr(handle),
+ CX_AttrKind_CoroOnlyDestroyWhenComplete => new Attr(handle),
+ CX_AttrKind_CoroReturnType => new Attr(handle),
+ CX_AttrKind_CoroWrapper => new Attr(handle),
+ CX_AttrKind_DLLExport => new Attr(handle),
+ CX_AttrKind_DLLExportStaticLocal => new Attr(handle),
+ CX_AttrKind_DLLImport => new Attr(handle),
+ CX_AttrKind_DLLImportStaticLocal => new Attr(handle),
+ CX_AttrKind_Deprecated => new Attr(handle),
+ CX_AttrKind_Destructor => new Attr(handle),
+ CX_AttrKind_DiagnoseAsBuiltin => new Attr(handle),
+ CX_AttrKind_DiagnoseIf => new Attr(handle),
+ CX_AttrKind_DisableSanitizerInstrumentation => new Attr(handle),
+ CX_AttrKind_DisableTailCalls => new Attr(handle),
+ CX_AttrKind_EmptyBases => new Attr(handle),
+ CX_AttrKind_EnableIf => new Attr(handle),
+ CX_AttrKind_EnforceTCB => new Attr(handle),
+ CX_AttrKind_EnforceTCBLeaf => new Attr(handle),
+ CX_AttrKind_EnumExtensibility => new Attr(handle),
+ CX_AttrKind_Error => new Attr(handle),
+ CX_AttrKind_ExcludeFromExplicitInstantiation => new Attr(handle),
+ CX_AttrKind_ExclusiveTrylockFunction => new Attr(handle),
+ CX_AttrKind_ExplicitInit => new Attr(handle),
+ CX_AttrKind_ExternalSourceSymbol => new Attr(handle),
+ CX_AttrKind_Final => new Attr(handle),
+ CX_AttrKind_FlagEnum => new Attr(handle),
+ CX_AttrKind_Flatten => new Attr(handle),
+ CX_AttrKind_Format => new Attr(handle),
+ CX_AttrKind_FormatArg => new Attr(handle),
+ CX_AttrKind_FunctionReturnThunks => new Attr(handle),
+ CX_AttrKind_GNUInline => new Attr(handle),
+ CX_AttrKind_GuardedBy => new Attr(handle),
+ CX_AttrKind_GuardedVar => new Attr(handle),
+ CX_AttrKind_HIPManaged => new Attr(handle),
+ CX_AttrKind_HLSLNumThreads => new Attr(handle),
+ CX_AttrKind_HLSLResource => new Attr(handle),
+ CX_AttrKind_HLSLResourceBinding => new Attr(handle),
+ CX_AttrKind_HLSLShader => new Attr(handle),
+ CX_AttrKind_HLSLWaveSize => new Attr(handle),
+ CX_AttrKind_Hot => new Attr(handle),
+ CX_AttrKind_HybridPatchable => new Attr(handle),
+ CX_AttrKind_IBAction => new Attr(handle),
+ CX_AttrKind_IBOutlet => new Attr(handle),
+ CX_AttrKind_IBOutletCollection => new Attr(handle),
+ CX_AttrKind_InitPriority => new Attr(handle),
+ CX_AttrKind_InternalLinkage => new Attr(handle),
+ CX_AttrKind_LTOVisibilityPublic => new Attr(handle),
+ CX_AttrKind_LayoutVersion => new Attr(handle),
+ CX_AttrKind_Leaf => new Attr(handle),
+ CX_AttrKind_LockReturned => new Attr(handle),
+ CX_AttrKind_LocksExcluded => new Attr(handle),
+ CX_AttrKind_M68kInterrupt => new Attr(handle),
+ CX_AttrKind_MIGServerRoutine => new Attr(handle),
+ CX_AttrKind_MSAllocator => new Attr(handle),
+ CX_AttrKind_MSConstexpr => new Attr(handle),
+ CX_AttrKind_MSInheritance => new Attr(handle),
+ CX_AttrKind_MSNoVTable => new Attr(handle),
+ CX_AttrKind_MSP430Interrupt => new Attr(handle),
+ CX_AttrKind_MSStruct => new Attr(handle),
+ CX_AttrKind_MSVtorDisp => new Attr(handle),
+ CX_AttrKind_MaxFieldAlignment => new Attr(handle),
+ CX_AttrKind_MayAlias => new Attr(handle),
+ CX_AttrKind_MaybeUndef => new Attr(handle),
+ CX_AttrKind_MicroMips => new Attr(handle),
+ CX_AttrKind_MinSize => new Attr(handle),
+ CX_AttrKind_MinVectorWidth => new Attr(handle),
+ CX_AttrKind_Mips16 => new Attr(handle),
+ CX_AttrKind_MipsInterrupt => new Attr(handle),
+ CX_AttrKind_MipsLongCall => new Attr(handle),
+ CX_AttrKind_MipsShortCall => new Attr(handle),
+ CX_AttrKind_NSConsumesSelf => new Attr(handle),
+ CX_AttrKind_NSErrorDomain => new Attr(handle),
+ CX_AttrKind_NSReturnsAutoreleased => new Attr(handle),
+ CX_AttrKind_NSReturnsNotRetained => new Attr(handle),
+ CX_AttrKind_NVPTXKernel => new Attr(handle),
+ CX_AttrKind_Naked => new Attr(handle),
+ CX_AttrKind_NoAlias => new Attr(handle),
+ CX_AttrKind_NoCommon => new Attr(handle),
+ CX_AttrKind_NoConvergent => new Attr(handle),
+ CX_AttrKind_NoDebug => new Attr(handle),
+ CX_AttrKind_NoDestroy => new Attr(handle),
+ CX_AttrKind_NoDuplicate => new Attr(handle),
+ CX_AttrKind_NoInstrumentFunction => new Attr(handle),
+ CX_AttrKind_NoMicroMips => new Attr(handle),
+ CX_AttrKind_NoMips16 => new Attr(handle),
+ CX_AttrKind_NoProfileFunction => new Attr(handle),
+ CX_AttrKind_NoRandomizeLayout => new Attr(handle),
+ CX_AttrKind_NoReturn => new Attr(handle),
+ CX_AttrKind_NoSanitize => new Attr(handle),
+ CX_AttrKind_NoSpecializations => new Attr(handle),
+ CX_AttrKind_NoSpeculativeLoadHardening => new Attr(handle),
+ CX_AttrKind_NoSplitStack => new Attr(handle),
+ CX_AttrKind_NoStackProtector => new Attr(handle),
+ CX_AttrKind_NoThreadSafetyAnalysis => new Attr(handle),
+ CX_AttrKind_NoThrow => new Attr(handle),
+ CX_AttrKind_NoTrivialAutoVarInit => new Attr(handle),
+ CX_AttrKind_NoUniqueAddress => new Attr(handle),
+ CX_AttrKind_NoUwtable => new Attr(handle),
+ CX_AttrKind_NotTailCalled => new Attr(handle),
+ CX_AttrKind_OMPAllocateDecl => new Attr(handle),
+ CX_AttrKind_OMPAssume => new Attr(handle),
+ CX_AttrKind_OMPCaptureNoInit => new Attr(handle),
+ CX_AttrKind_OMPDeclareTargetDecl => new Attr(handle),
+ CX_AttrKind_OMPDeclareVariant => new Attr(handle),
+ CX_AttrKind_OMPThreadPrivateDecl => new Attr(handle),
+ CX_AttrKind_OSConsumesThis => new Attr(handle),
+ CX_AttrKind_OSReturnsNotRetained => new Attr(handle),
+ CX_AttrKind_OSReturnsRetained => new Attr(handle),
+ CX_AttrKind_OSReturnsRetainedOnNonZero => new Attr(handle),
+ CX_AttrKind_OSReturnsRetainedOnZero => new Attr(handle),
+ CX_AttrKind_ObjCBridge => new Attr(handle),
+ CX_AttrKind_ObjCBridgeMutable => new Attr(handle),
+ CX_AttrKind_ObjCBridgeRelated => new Attr(handle),
+ CX_AttrKind_ObjCException => new Attr(handle),
+ CX_AttrKind_ObjCExplicitProtocolImpl => new Attr(handle),
+ CX_AttrKind_ObjCExternallyRetained => new Attr(handle),
+ CX_AttrKind_ObjCIndependentClass => new Attr(handle),
+ CX_AttrKind_ObjCMethodFamily => new Attr(handle),
+ CX_AttrKind_ObjCNSObject => new Attr(handle),
+ CX_AttrKind_ObjCPreciseLifetime => new Attr(handle),
+ CX_AttrKind_ObjCRequiresPropertyDefs => new Attr(handle),
+ CX_AttrKind_ObjCRequiresSuper => new Attr(handle),
+ CX_AttrKind_ObjCReturnsInnerPointer => new Attr(handle),
+ CX_AttrKind_ObjCRootClass => new Attr(handle),
+ CX_AttrKind_ObjCSubclassingRestricted => new Attr(handle),
+ CX_AttrKind_OpenCLIntelReqdSubGroupSize => new Attr(handle),
+ CX_AttrKind_OpenCLKernel => new Attr(handle),
+ CX_AttrKind_OptimizeNone => new Attr(handle),
+ CX_AttrKind_Override => new Attr(handle),
+ CX_AttrKind_Owner => new Attr(handle),
+ CX_AttrKind_Ownership => new Attr(handle),
+ CX_AttrKind_Packed => new Attr(handle),
+ CX_AttrKind_ParamTypestate => new Attr(handle),
+ CX_AttrKind_PatchableFunctionEntry => new Attr(handle),
+ CX_AttrKind_Pointer => new Attr(handle),
+ CX_AttrKind_PragmaClangBSSSection => new Attr(handle),
+ CX_AttrKind_PragmaClangDataSection => new Attr(handle),
+ CX_AttrKind_PragmaClangRelroSection => new Attr(handle),
+ CX_AttrKind_PragmaClangRodataSection => new Attr(handle),
+ CX_AttrKind_PragmaClangTextSection => new Attr(handle),
+ CX_AttrKind_PreferredName => new Attr(handle),
+ CX_AttrKind_PreferredType => new Attr(handle),
+ CX_AttrKind_PtGuardedBy => new Attr(handle),
+ CX_AttrKind_PtGuardedVar => new Attr(handle),
+ CX_AttrKind_Pure => new Attr(handle),
+ CX_AttrKind_RISCVInterrupt => new Attr(handle),
+ CX_AttrKind_RandomizeLayout => new Attr(handle),
+ CX_AttrKind_ReadOnlyPlacement => new Attr(handle),
+ CX_AttrKind_Reinitializes => new Attr(handle),
+ CX_AttrKind_ReleaseCapability => new Attr(handle),
+ CX_AttrKind_ReqdWorkGroupSize => new Attr(handle),
+ CX_AttrKind_RequiresCapability => new Attr(handle),
+ CX_AttrKind_Restrict => new Attr(handle),
+ CX_AttrKind_Retain => new Attr(handle),
+ CX_AttrKind_ReturnTypestate => new Attr(handle),
+ CX_AttrKind_ReturnsNonNull => new Attr(handle),
+ CX_AttrKind_ReturnsTwice => new Attr(handle),
+ CX_AttrKind_SYCLKernel => new Attr(handle),
+ CX_AttrKind_SYCLKernelEntryPoint => new Attr(handle),
+ CX_AttrKind_SYCLSpecialClass => new Attr(handle),
+ CX_AttrKind_ScopedLockable => new Attr(handle),
+ CX_AttrKind_Section => new Attr(handle),
+ CX_AttrKind_SelectAny => new Attr(handle),
+ CX_AttrKind_Sentinel => new Attr(handle),
+ CX_AttrKind_SetTypestate => new Attr(handle),
+ CX_AttrKind_SharedTrylockFunction => new Attr(handle),
+ CX_AttrKind_SpeculativeLoadHardening => new Attr(handle),
+ CX_AttrKind_StandaloneDebug => new Attr(handle),
+ CX_AttrKind_StrictFP => new Attr(handle),
+ CX_AttrKind_StrictGuardStackCheck => new Attr(handle),
+ CX_AttrKind_SwiftAsync => new Attr(handle),
+ CX_AttrKind_SwiftAsyncError => new Attr(handle),
+ CX_AttrKind_SwiftAsyncName => new Attr(handle),
+ CX_AttrKind_SwiftBridge => new Attr(handle),
+ CX_AttrKind_SwiftBridgedTypedef => new Attr(handle),
+ CX_AttrKind_SwiftError => new Attr(handle),
+ CX_AttrKind_SwiftImportAsNonGeneric => new Attr(handle),
+ CX_AttrKind_SwiftImportPropertyAsAccessors => new Attr(handle),
+ CX_AttrKind_SwiftName => new Attr(handle),
+ CX_AttrKind_SwiftNewType => new Attr(handle),
+ CX_AttrKind_SwiftPrivate => new Attr(handle),
+ CX_AttrKind_TLSModel => new Attr(handle),
+ CX_AttrKind_Target => new Attr(handle),
+ CX_AttrKind_TargetClones => new Attr(handle),
+ CX_AttrKind_TargetVersion => new Attr(handle),
+ CX_AttrKind_TestTypestate => new Attr(handle),
+ CX_AttrKind_TransparentUnion => new Attr(handle),
+ CX_AttrKind_TrivialABI => new Attr(handle),
+ CX_AttrKind_TryAcquireCapability => new Attr(handle),
+ CX_AttrKind_TypeTagForDatatype => new Attr(handle),
+ CX_AttrKind_TypeVisibility => new Attr(handle),
+ CX_AttrKind_Unavailable => new Attr(handle),
+ CX_AttrKind_Uninitialized => new Attr(handle),
+ CX_AttrKind_UnsafeBufferUsage => new Attr(handle),
+ CX_AttrKind_Unused => new Attr(handle),
+ CX_AttrKind_Used => new Attr(handle),
+ CX_AttrKind_UsingIfExists => new Attr(handle),
+ CX_AttrKind_Uuid => new Attr(handle),
+ CX_AttrKind_VTablePointerAuthentication => new Attr(handle),
+ CX_AttrKind_VecReturn => new Attr(handle),
+ CX_AttrKind_VecTypeHint => new Attr(handle),
+ CX_AttrKind_Visibility => new Attr(handle),
+ CX_AttrKind_WarnUnused => new Attr(handle),
+ CX_AttrKind_WarnUnusedResult => new Attr(handle),
+ CX_AttrKind_Weak => new Attr(handle),
+ CX_AttrKind_WeakImport => new Attr(handle),
+ CX_AttrKind_WeakRef => new Attr(handle),
+ CX_AttrKind_WebAssemblyExportName => new Attr(handle),
+ CX_AttrKind_WebAssemblyImportModule => new Attr(handle),
+ CX_AttrKind_WebAssemblyImportName => new Attr(handle),
+ CX_AttrKind_WorkGroupSizeHint => new Attr(handle),
+ CX_AttrKind_X86ForceAlignArgPointer => new Attr(handle),
+ CX_AttrKind_XRayInstrument => new Attr(handle),
+ CX_AttrKind_XRayLogArgs => new Attr(handle),
+ CX_AttrKind_ZeroCallUsedRegs => new Attr(handle),
CX_AttrKind_AbiTag => new Attr(handle),
CX_AttrKind_Alias => new Attr(handle),
CX_AttrKind_AlignValue => new Attr(handle),
@@ -409,7 +444,6 @@ private protected Attr(CXCursor handle) : base(handle, handle.Kind)
CX_AttrKind_ObjCRuntimeVisible => new Attr(handle),
CX_AttrKind_OpenCLAccess => new Attr(handle),
CX_AttrKind_Overloadable => new Attr(handle),
- CX_AttrKind_RenderScriptKernel => new Attr(handle),
CX_AttrKind_SwiftObjCMembers => new Attr(handle),
CX_AttrKind_SwiftVersionedAddition => new Attr(handle),
CX_AttrKind_SwiftVersionedRemoval => new Attr(handle),
diff --git a/sources/ClangSharp/Cursors/Cursor.cs b/sources/ClangSharp/Cursors/Cursor.cs
index 95783bcb..4a60a899 100644
--- a/sources/ClangSharp/Cursors/Cursor.cs
+++ b/sources/ClangSharp/Cursors/Cursor.cs
@@ -13,11 +13,11 @@ namespace ClangSharp;
[DebuggerDisplay("{Handle.DebuggerDisplayString,nq}")]
public unsafe class Cursor : IEquatable
{
- private readonly Lazy _kindSpelling;
- private readonly Lazy _lexicalParentCursor;
- private readonly Lazy _semanticParentCursor;
- private readonly Lazy _spelling;
- private readonly Lazy _translationUnit;
+ private readonly ValueLazy _kindSpelling;
+ private readonly ValueLazy _lexicalParentCursor;
+ private readonly ValueLazy _semanticParentCursor;
+ private readonly ValueLazy _spelling;
+ private readonly ValueLazy _translationUnit;
private List? _cursorChildren;
private protected Cursor(CXCursor handle, CXCursorKind expectedCursorKind)
@@ -28,11 +28,11 @@ private protected Cursor(CXCursor handle, CXCursorKind expectedCursorKind)
}
Handle = handle;
- _kindSpelling = new Lazy(Handle.KindSpelling.ToString);
- _lexicalParentCursor = new Lazy(() => !Handle.LexicalParent.IsNull ? TranslationUnit.GetOrCreate(Handle.LexicalParent) : null);
- _semanticParentCursor = new Lazy(() => !Handle.SemanticParent.IsNull ? TranslationUnit.GetOrCreate(Handle.SemanticParent) : null);
- _spelling = new Lazy(Handle.Spelling.ToString);
- _translationUnit = new Lazy(() => TranslationUnit.GetOrCreate(Handle.TranslationUnit));
+ _kindSpelling = new ValueLazy(Handle.KindSpelling.ToString);
+ _lexicalParentCursor = new ValueLazy(() => !Handle.LexicalParent.IsNull ? TranslationUnit.GetOrCreate(Handle.LexicalParent) : null);
+ _semanticParentCursor = new ValueLazy(() => !Handle.SemanticParent.IsNull ? TranslationUnit.GetOrCreate(Handle.SemanticParent) : null);
+ _spelling = new ValueLazy(Handle.Spelling.ToString);
+ _translationUnit = new ValueLazy(() => TranslationUnit.GetOrCreate(Handle.TranslationUnit));
}
public IReadOnlyList CursorChildren
diff --git a/sources/ClangSharp/Cursors/Decls/BindingDecl.cs b/sources/ClangSharp/Cursors/Decls/BindingDecl.cs
index 512aacbd..21c7a630 100644
--- a/sources/ClangSharp/Cursors/Decls/BindingDecl.cs
+++ b/sources/ClangSharp/Cursors/Decls/BindingDecl.cs
@@ -9,15 +9,15 @@ namespace ClangSharp;
public sealed class BindingDecl : ValueDecl
{
- private readonly Lazy _binding;
- private readonly Lazy _decomposedDecl;
- private readonly Lazy _holdingVar;
+ private readonly ValueLazy _binding;
+ private readonly ValueLazy _decomposedDecl;
+ private readonly ValueLazy _holdingVar;
internal BindingDecl(CXCursor handle) : base(handle, CXCursor_UnexposedDecl, CX_DeclKind_Binding)
{
- _binding = new Lazy(() => TranslationUnit.GetOrCreate(Handle.BindingExpr));
- _decomposedDecl = new Lazy(() => TranslationUnit.GetOrCreate(Handle.DecomposedDecl));
- _holdingVar = new Lazy(() => TranslationUnit.GetOrCreate(Handle.GetSubDecl(0)));
+ _binding = new ValueLazy(() => TranslationUnit.GetOrCreate(Handle.BindingExpr));
+ _decomposedDecl = new ValueLazy(() => TranslationUnit.GetOrCreate(Handle.DecomposedDecl));
+ _holdingVar = new ValueLazy(() => TranslationUnit.GetOrCreate(Handle.GetSubDecl(0)));
}
public Expr Binding => _binding.Value;
diff --git a/sources/ClangSharp/Cursors/Decls/BlockDecl.Capture.cs b/sources/ClangSharp/Cursors/Decls/BlockDecl.Capture.cs
index 6394f7ee..d56eb53f 100644
--- a/sources/ClangSharp/Cursors/Decls/BlockDecl.Capture.cs
+++ b/sources/ClangSharp/Cursors/Decls/BlockDecl.Capture.cs
@@ -10,16 +10,16 @@ public sealed class Capture
{
private readonly Decl _parentDecl;
private readonly uint _index;
- private readonly Lazy _copyExpr;
- private readonly Lazy