diff --git a/.editorconfig b/.editorconfig
index 3467ebf9..1909f880 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -21,6 +21,9 @@ end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 4
+spelling_error_severity = information
+spelling_exclusion_path = exclusion.dic
+spelling_languages = en-us
tab_width = 4
trim_trailing_whitespace = true
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 879ec8fe..42c3c0bb 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -28,26 +28,6 @@ jobs:
./artifacts/pkg/**/*
./artifacts/tst/**/*
if-no-files-found: error
- windows-x86:
- runs-on: ${{ matrix.os }}-latest
- strategy:
- matrix:
- architecture: [ x86 ]
- configuration: [ debug, release ]
- os: [ windows ]
- steps:
- - uses: actions/checkout@v3
- - run: ./scripts/cibuild.cmd -configuration ${{ matrix.configuration }} -architecture ${{ matrix.architecture }} /p:PlatformTarget=${{ matrix.architecture }}
- shell: cmd
- - uses: actions/upload-artifact@v3
- with:
- name: ${{ matrix.os }}_${{ matrix.configuration }}_${{ matrix.architecture }}
- path: |
- ./artifacts/bin/**/*
- ./artifacts/log/**/*
- ./artifacts/pkg/**/*
- ./artifacts/tst/**/*
- if-no-files-found: error
linux-x64:
runs-on: ${{ matrix.os }}-latest
strategy:
@@ -120,8 +100,8 @@ jobs:
path: ./artifacts
- uses: actions/setup-dotnet@v3
with:
- dotnet-version: '6.0.x'
- - run: dotnet tool install --tool-path ./artifacts/tools sign --version 0.9.0-beta.23063.3
+ 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 "LLVMSharp" --description-url "https://github.com/dotnet/llvmsharp" --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@v3
with:
@@ -161,8 +141,8 @@ jobs:
path: ./artifacts
- uses: actions/setup-dotnet@v3
with:
- dotnet-version: '6.0.x'
- - run: dotnet tool install --tool-path ./artifacts/tools sign --version 0.9.0-beta.23063.3
+ 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 "LLVMSharp" --description-url "https://github.com/dotnet/llvmsharp" --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@v3
with:
@@ -173,15 +153,15 @@ jobs:
publish-nightlies-azure:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'push' }}
- needs: [ windows-x64, windows-x86, linux-x64, macos-x64, sign-nuget-preview, sign-nuget-release ]
+ needs: [ windows-x64, linux-x64, macos-x64, sign-nuget-preview, sign-nuget-release ]
steps:
- uses: actions/download-artifact@v3
with:
name: windows_release_x64
path: ./artifacts
- - uses: actions/setup-dotnet@v2
+ - uses: actions/setup-dotnet@v3
with:
- dotnet-version: '6.0.x'
+ dotnet-version: '8.0.x'
source-url: https://pkgs.clangsharp.dev/index.json
env:
NUGET_AUTH_TOKEN: ${{ secrets.AZURE_DEVOPS_PAT }}
@@ -189,13 +169,13 @@ jobs:
publish-nightlies-github:
runs-on: ubuntu-latest
if: false
- needs: [ windows-x64, windows-x86, linux-x64, macos-x64, sign-nuget-preview, sign-nuget-release ]
+ needs: [ windows-x64, linux-x64, macos-x64, sign-nuget-preview, sign-nuget-release ]
steps:
- uses: actions/download-artifact@v3
with:
name: windows_release_x64
path: ./artifacts
- - uses: actions/setup-dotnet@v2
+ - uses: actions/setup-dotnet@v3
with:
- dotnet-version: '6.0.x'
+ dotnet-version: '8.0.x'
- run: dotnet nuget push "./artifacts/pkg/Release/*.nupkg" --source https://nuget.pkg.github.com/dotnet/index.json --api-key ${{ secrets.GITHUB_TOKEN }} --skip-duplicate
diff --git a/Directory.Build.props b/Directory.Build.props
index 2ed113b7..cf22ba2a 100644
--- a/Directory.Build.props
+++ b/Directory.Build.props
@@ -20,7 +20,7 @@
true
- preview
+ latest-all
$(BaseArtifactsPath)obj/$(BaseArtifactsPathSuffix)/
embedded
false
@@ -42,7 +42,9 @@
$(BaseArtifactsPath)bin/$(BaseArtifactsPathSuffix)/
.NET Foundation
true
+ true
$(BaseArtifactsPath)pkg/$(Configuration)/
+ 16.0.0
LLVMSharp
LLVMSharp
16.0.0
diff --git a/Directory.Build.targets b/Directory.Build.targets
index ee04b707..db24925f 100644
--- a/Directory.Build.targets
+++ b/Directory.Build.targets
@@ -12,7 +12,7 @@
- $(NoWarn);AD0001
+ $(NoWarn)
@@ -26,7 +26,7 @@
-
+
true
true
diff --git a/LLVMSharp.sln b/LLVMSharp.sln
index dd175a68..e0d4fe14 100644
--- a/LLVMSharp.sln
+++ b/LLVMSharp.sln
@@ -14,6 +14,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
Directory.Build.props = Directory.Build.props
Directory.Build.targets = Directory.Build.targets
Directory.Packages.props = Directory.Packages.props
+ exclusion.dic = exclusion.dic
+ global.json = global.json
LICENSE.md = LICENSE.md
NOTICE.md = NOTICE.md
NuGet.config = NuGet.config
diff --git a/exclusion.dic b/exclusion.dic
new file mode 100644
index 00000000..29aceb68
--- /dev/null
+++ b/exclusion.dic
@@ -0,0 +1,15 @@
+addr
+aliasee
+alloca
+attrs
+bitcode
+dest
+funclet
+greaterthan
+instr
+interp
+lshift
+netscripten
+trunc
+vals
+xchg
diff --git a/global.json b/global.json
new file mode 100644
index 00000000..61d88a71
--- /dev/null
+++ b/global.json
@@ -0,0 +1,7 @@
+{
+ "sdk": {
+ "version": "8.0.100",
+ "allowPrerelease": true,
+ "rollForward": "latestFeature"
+ }
+}
diff --git a/samples/KaleidoscopeTutorial/Chapter3/Kaleidoscope/Kaleidoscope.csproj b/samples/KaleidoscopeTutorial/Chapter3/Kaleidoscope/Kaleidoscope.csproj
index 725b5d7c..0c3ad700 100644
--- a/samples/KaleidoscopeTutorial/Chapter3/Kaleidoscope/Kaleidoscope.csproj
+++ b/samples/KaleidoscopeTutorial/Chapter3/Kaleidoscope/Kaleidoscope.csproj
@@ -1,6 +1,6 @@
- net6.0;net7.0
+ net8.0
diff --git a/samples/KaleidoscopeTutorial/Chapter3/KaleidoscopeLLVM/KaleidoscopeLLVM.csproj b/samples/KaleidoscopeTutorial/Chapter3/KaleidoscopeLLVM/KaleidoscopeLLVM.csproj
index f4f4e34a..3bf1f997 100644
--- a/samples/KaleidoscopeTutorial/Chapter3/KaleidoscopeLLVM/KaleidoscopeLLVM.csproj
+++ b/samples/KaleidoscopeTutorial/Chapter3/KaleidoscopeLLVM/KaleidoscopeLLVM.csproj
@@ -1,7 +1,7 @@
- net6.0;net7.0
+ net8.0
diff --git a/samples/KaleidoscopeTutorial/Chapter4/Kaleidoscope/Kaleidoscope.csproj b/samples/KaleidoscopeTutorial/Chapter4/Kaleidoscope/Kaleidoscope.csproj
index 725b5d7c..0c3ad700 100644
--- a/samples/KaleidoscopeTutorial/Chapter4/Kaleidoscope/Kaleidoscope.csproj
+++ b/samples/KaleidoscopeTutorial/Chapter4/Kaleidoscope/Kaleidoscope.csproj
@@ -1,6 +1,6 @@
- net6.0;net7.0
+ net8.0
diff --git a/samples/KaleidoscopeTutorial/Chapter4/KaleidoscopeLLVM/KaleidoscopeLLVM.csproj b/samples/KaleidoscopeTutorial/Chapter4/KaleidoscopeLLVM/KaleidoscopeLLVM.csproj
index f4f4e34a..3bf1f997 100644
--- a/samples/KaleidoscopeTutorial/Chapter4/KaleidoscopeLLVM/KaleidoscopeLLVM.csproj
+++ b/samples/KaleidoscopeTutorial/Chapter4/KaleidoscopeLLVM/KaleidoscopeLLVM.csproj
@@ -1,7 +1,7 @@
- net6.0;net7.0
+ net8.0
diff --git a/samples/KaleidoscopeTutorial/Chapter5/Kaleidoscope/Kaleidoscope.csproj b/samples/KaleidoscopeTutorial/Chapter5/Kaleidoscope/Kaleidoscope.csproj
index 725b5d7c..0c3ad700 100644
--- a/samples/KaleidoscopeTutorial/Chapter5/Kaleidoscope/Kaleidoscope.csproj
+++ b/samples/KaleidoscopeTutorial/Chapter5/Kaleidoscope/Kaleidoscope.csproj
@@ -1,6 +1,6 @@
- net6.0;net7.0
+ net8.0
diff --git a/samples/KaleidoscopeTutorial/Chapter5/KaleidoscopeLLVM/KaleidoscopeLLVM.csproj b/samples/KaleidoscopeTutorial/Chapter5/KaleidoscopeLLVM/KaleidoscopeLLVM.csproj
index f4f4e34a..3bf1f997 100644
--- a/samples/KaleidoscopeTutorial/Chapter5/KaleidoscopeLLVM/KaleidoscopeLLVM.csproj
+++ b/samples/KaleidoscopeTutorial/Chapter5/KaleidoscopeLLVM/KaleidoscopeLLVM.csproj
@@ -1,7 +1,7 @@
- net6.0;net7.0
+ net8.0
diff --git a/scripts/build.ps1 b/scripts/build.ps1
index 28b21532..09ce84b3 100644
--- a/scripts/build.ps1
+++ b/scripts/build.ps1
@@ -123,8 +123,7 @@ try {
$DotNetInstallDirectory = Join-Path -Path $ArtifactsDir -ChildPath "dotnet"
Create-Directory -Path $DotNetInstallDirectory
- & $DotNetInstallScript -Channel 6.0 -Version latest -InstallDir $DotNetInstallDirectory -Architecture $architecture
- & $DotNetInstallScript -Channel 7.0 -Version latest -InstallDir $DotNetInstallDirectory -Architecture $architecture
+ & $DotNetInstallScript -Channel 8.0 -Version latest -InstallDir $DotNetInstallDirectory -Architecture $architecture
$env:PATH="$DotNetInstallDirectory;$env:PATH"
}
diff --git a/scripts/build.sh b/scripts/build.sh
index f59e51a0..9c2e6648 100755
--- a/scripts/build.sh
+++ b/scripts/build.sh
@@ -204,8 +204,7 @@ if [[ ! -z "$architecture" ]]; then
DotNetInstallDirectory="$ArtifactsDir/dotnet"
CreateDirectory "$DotNetInstallDirectory"
- . "$DotNetInstallScript" --channel 6.0 --version latest --install-dir "$DotNetInstallDirectory" --architecture "$architecture"
- . "$DotNetInstallScript" --channel 7.0 --version latest --install-dir "$DotNetInstallDirectory" --architecture "$architecture"
+ . "$DotNetInstallScript" --channel 8.0 --version latest --install-dir "$DotNetInstallDirectory" --architecture "$architecture"
PATH="$DotNetInstallDirectory:$PATH:"
fi
diff --git a/sources/Directory.Build.props b/sources/Directory.Build.props
index 41533283..785d282c 100644
--- a/sources/Directory.Build.props
+++ b/sources/Directory.Build.props
@@ -12,6 +12,7 @@
true
+ false
sources
@@ -21,8 +22,4 @@
-
-
-
-
diff --git a/sources/LLVMSharp.Interop/Configuration.cs b/sources/LLVMSharp.Interop/Configuration.cs
new file mode 100644
index 00000000..541700a7
--- /dev/null
+++ b/sources/LLVMSharp.Interop/Configuration.cs
@@ -0,0 +1,33 @@
+// 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.
+
+using System;
+using System.Runtime.InteropServices;
+
+[assembly: DefaultDllImportSearchPaths(DllImportSearchPath.SafeDirectories)]
+
+namespace LLVMSharp.Interop;
+
+internal static class Configuration
+{
+ private static readonly bool s_disableResolveLibraryHook = GetAppContextData("LLVMSharp.Interop.DisableResolveLibraryHook", defaultValue: false);
+
+ public static bool DisableResolveLibraryHook => s_disableResolveLibraryHook;
+
+ private static bool GetAppContextData(string name, bool defaultValue)
+ {
+ object? data = AppContext.GetData(name);
+
+ if (data is bool value)
+ {
+ return value;
+ }
+ else if ((data is string s) && bool.TryParse(s, out bool result))
+ {
+ return result;
+ }
+ else
+ {
+ return defaultValue;
+ }
+ }
+}
diff --git a/sources/LLVMSharp.Interop/Extensions/LLVM.ResolveLibrary.cs b/sources/LLVMSharp.Interop/Extensions/LLVM.ResolveLibrary.cs
index 3f5ad660..a4901b6f 100644
--- a/sources/LLVMSharp.Interop/Extensions/LLVM.ResolveLibrary.cs
+++ b/sources/LLVMSharp.Interop/Extensions/LLVM.ResolveLibrary.cs
@@ -3,8 +3,11 @@
using System;
using System.Linq;
using System.Reflection;
+using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
+[assembly: DisableRuntimeMarshalling]
+
namespace LLVMSharp.Interop;
public static unsafe partial class LLVM
@@ -13,36 +16,53 @@ public static unsafe partial class LLVM
static LLVM()
{
- NativeLibrary.SetDllImportResolver(Assembly.GetExecutingAssembly(), OnDllImport);
+ if (!Configuration.DisableResolveLibraryHook)
+ {
+ NativeLibrary.SetDllImportResolver(Assembly.GetExecutingAssembly(), OnDllImport);
+ }
}
private static IntPtr OnDllImport(string libraryName, Assembly assembly, DllImportSearchPath? searchPath)
{
- return TryResolveLibrary(libraryName, assembly, searchPath, out var nativeLibrary)
- ? nativeLibrary
- : libraryName.Equals("libLLVM") && TryResolveLLVM(assembly, searchPath, out nativeLibrary)
- ? nativeLibrary
- : IntPtr.Zero;
+ if (TryResolveLibrary(libraryName, assembly, searchPath, out var nativeLibrary))
+ {
+ return nativeLibrary;
+ }
+
+ if (libraryName.Equals("libLLVM", StringComparison.Ordinal) && TryResolveLLVM(assembly, searchPath, out nativeLibrary))
+ {
+ return nativeLibrary;
+ }
+
+ return IntPtr.Zero;
}
private static bool TryResolveLLVM(Assembly assembly, DllImportSearchPath? searchPath, out IntPtr nativeLibrary)
{
- return (RuntimeInformation.IsOSPlatform(OSPlatform.Linux) && NativeLibrary.TryLoad("libLLVM.so.14", assembly, searchPath, out nativeLibrary))
- || (RuntimeInformation.IsOSPlatform(OSPlatform.Linux) && NativeLibrary.TryLoad("libLLVM-14", assembly, searchPath, out nativeLibrary))
- || (RuntimeInformation.IsOSPlatform(OSPlatform.Linux) && NativeLibrary.TryLoad("libLLVM.so.1", assembly, searchPath, out nativeLibrary))
- || (RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && NativeLibrary.TryLoad("LLVM-C.dll", assembly, searchPath, out nativeLibrary))
- || NativeLibrary.TryLoad("libLLVM", assembly, searchPath, out nativeLibrary);
+ if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
+ {
+ return NativeLibrary.TryLoad("libLLVM.so.16", assembly, searchPath, out nativeLibrary)
+ || NativeLibrary.TryLoad("libLLVM-16", assembly, searchPath, out nativeLibrary)
+ || NativeLibrary.TryLoad("libLLVM.so.1", assembly, searchPath, out nativeLibrary);
+ }
+ else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
+ {
+ return NativeLibrary.TryLoad("LLVM-C.dll", assembly, searchPath, out nativeLibrary);
+ }
+
+ nativeLibrary = IntPtr.Zero;
+ return false;
}
private static bool TryResolveLibrary(string libraryName, Assembly assembly, DllImportSearchPath? searchPath, out IntPtr nativeLibrary)
{
var resolveLibrary = ResolveLibrary;
- if (resolveLibrary != null)
+ if (resolveLibrary is not null)
{
- var resolvers = resolveLibrary.GetInvocationList();
+ var resolvers = resolveLibrary.GetInvocationList().Cast();
- foreach (DllImportResolver resolver in resolvers.Cast())
+ foreach (DllImportResolver resolver in resolvers)
{
nativeLibrary = resolver(libraryName, assembly, searchPath);
diff --git a/sources/LLVMSharp.Interop/Extensions/LLVMAttributeRef.cs b/sources/LLVMSharp.Interop/Extensions/LLVMAttributeRef.cs
index 07d167e3..08154b3c 100644
--- a/sources/LLVMSharp.Interop/Extensions/LLVMAttributeRef.cs
+++ b/sources/LLVMSharp.Interop/Extensions/LLVMAttributeRef.cs
@@ -4,14 +4,9 @@
namespace LLVMSharp.Interop;
-public unsafe partial struct LLVMAttributeRef : IEquatable
+public unsafe partial struct LLVMAttributeRef(IntPtr handle) : IEquatable
{
- public IntPtr Handle;
-
- public LLVMAttributeRef(IntPtr handle)
- {
- Handle = handle;
- }
+ public IntPtr Handle = handle;
public readonly uint Kind => LLVM.GetEnumAttributeKind(this);
@@ -25,11 +20,11 @@ public LLVMAttributeRef(IntPtr handle)
public static bool operator !=(LLVMAttributeRef left, LLVMAttributeRef right) => !(left == right);
- public override bool Equals(object? obj) => (obj is LLVMAttributeRef other) && Equals(other);
+ public override readonly bool Equals(object? obj) => (obj is LLVMAttributeRef other) && Equals(other);
- public bool Equals(LLVMAttributeRef other) => this == other;
+ public readonly bool Equals(LLVMAttributeRef other) => this == other;
- public override int GetHashCode() => Handle.GetHashCode();
+ public override readonly int GetHashCode() => Handle.GetHashCode();
- public override string ToString() => $"{nameof(LLVMAttributeRef)}: {Handle:X}";
+ public override readonly string ToString() => $"{nameof(LLVMAttributeRef)}: {Handle:X}";
}
diff --git a/sources/LLVMSharp.Interop/Extensions/LLVMBasicBlockRef.cs b/sources/LLVMSharp.Interop/Extensions/LLVMBasicBlockRef.cs
index 5367ee84..d6bd9a9a 100644
--- a/sources/LLVMSharp.Interop/Extensions/LLVMBasicBlockRef.cs
+++ b/sources/LLVMSharp.Interop/Extensions/LLVMBasicBlockRef.cs
@@ -4,26 +4,21 @@
namespace LLVMSharp.Interop;
-public unsafe partial struct LLVMBasicBlockRef : IEquatable
+public unsafe partial struct LLVMBasicBlockRef(IntPtr handle) : IEquatable
{
- public IntPtr Handle;
+ public IntPtr Handle = handle;
- public LLVMBasicBlockRef(IntPtr handle)
- {
- Handle = handle;
- }
-
- public LLVMValueRef FirstInstruction => (Handle != IntPtr.Zero) ? LLVM.GetFirstInstruction(this) : default;
+ public readonly LLVMValueRef FirstInstruction => (Handle != IntPtr.Zero) ? LLVM.GetFirstInstruction(this) : default;
- public LLVMValueRef LastInstruction => (Handle != IntPtr.Zero) ? LLVM.GetLastInstruction(this) : default;
+ public readonly LLVMValueRef LastInstruction => (Handle != IntPtr.Zero) ? LLVM.GetLastInstruction(this) : default;
- public LLVMBasicBlockRef Next => (Handle != IntPtr.Zero) ? LLVM.GetNextBasicBlock(this) : default;
+ public readonly LLVMBasicBlockRef Next => (Handle != IntPtr.Zero) ? LLVM.GetNextBasicBlock(this) : default;
- public LLVMValueRef Parent => (Handle != IntPtr.Zero) ? LLVM.GetBasicBlockParent(this) : default;
+ public readonly LLVMValueRef Parent => (Handle != IntPtr.Zero) ? LLVM.GetBasicBlockParent(this) : default;
- public LLVMBasicBlockRef Previous => (Handle != IntPtr.Zero) ? LLVM.GetPreviousBasicBlock(this) : default;
+ public readonly LLVMBasicBlockRef Previous => (Handle != IntPtr.Zero) ? LLVM.GetPreviousBasicBlock(this) : default;
- public LLVMValueRef Terminator => (Handle != IntPtr.Zero) ? LLVM.GetBasicBlockTerminator(this) : default;
+ public readonly LLVMValueRef Terminator => (Handle != IntPtr.Zero) ? LLVM.GetBasicBlockTerminator(this) : default;
public static explicit operator LLVMBasicBlockRef(LLVMOpaqueValue* value) => new LLVMBasicBlockRef((IntPtr)value);
@@ -61,31 +56,31 @@ public static LLVMBasicBlockRef InsertInContext(LLVMContextRef C, LLVMBasicBlock
return LLVM.InsertBasicBlockInContext(C, BB, marshaledName);
}
- public LLVMValueRef AsValue() => LLVM.BasicBlockAsValue(this);
+ public readonly LLVMValueRef AsValue() => LLVM.BasicBlockAsValue(this);
- public void Delete() => LLVM.DeleteBasicBlock(this);
+ public readonly void Delete() => LLVM.DeleteBasicBlock(this);
- public void Dump() => LLVM.DumpValue(this);
+ public readonly void Dump() => LLVM.DumpValue(this);
- public override bool Equals(object? obj) => (obj is LLVMBasicBlockRef other) && Equals(other);
+ public override readonly bool Equals(object? obj) => (obj is LLVMBasicBlockRef other) && Equals(other);
- public bool Equals(LLVMBasicBlockRef other) => this == other;
+ public readonly bool Equals(LLVMBasicBlockRef other) => this == other;
- public override int GetHashCode() => Handle.GetHashCode();
+ public override readonly int GetHashCode() => Handle.GetHashCode();
- public LLVMBasicBlockRef InsertBasicBlock(string Name) => InsertBasicBlock(Name.AsSpan());
+ public readonly LLVMBasicBlockRef InsertBasicBlock(string Name) => InsertBasicBlock(Name.AsSpan());
- public LLVMBasicBlockRef InsertBasicBlock(ReadOnlySpan Name)
+ public readonly LLVMBasicBlockRef InsertBasicBlock(ReadOnlySpan Name)
{
using var marshaledName = new MarshaledString(Name);
return LLVM.InsertBasicBlock(this, marshaledName);
}
- public void MoveAfter(LLVMBasicBlockRef MovePos) => LLVM.MoveBasicBlockAfter(this, MovePos);
+ public readonly void MoveAfter(LLVMBasicBlockRef MovePos) => LLVM.MoveBasicBlockAfter(this, MovePos);
- public void MoveBefore(LLVMBasicBlockRef MovePos) => LLVM.MoveBasicBlockBefore(this, MovePos);
+ public readonly void MoveBefore(LLVMBasicBlockRef MovePos) => LLVM.MoveBasicBlockBefore(this, MovePos);
- public string PrintToString()
+ public readonly string PrintToString()
{
var pStr = LLVM.PrintValueToString(this);
@@ -99,7 +94,7 @@ public string PrintToString()
return result;
}
- public void RemoveFromParent() => LLVM.RemoveBasicBlockFromParent(this);
+ public readonly void RemoveFromParent() => LLVM.RemoveBasicBlockFromParent(this);
- public override string ToString() => (Handle != IntPtr.Zero) ? PrintToString() : string.Empty;
+ public override readonly string ToString() => (Handle != IntPtr.Zero) ? PrintToString() : string.Empty;
}
diff --git a/sources/LLVMSharp.Interop/Extensions/LLVMBinaryRef.cs b/sources/LLVMSharp.Interop/Extensions/LLVMBinaryRef.cs
index ae7b7729..7e2a3209 100644
--- a/sources/LLVMSharp.Interop/Extensions/LLVMBinaryRef.cs
+++ b/sources/LLVMSharp.Interop/Extensions/LLVMBinaryRef.cs
@@ -4,14 +4,9 @@
namespace LLVMSharp.Interop;
-public unsafe partial struct LLVMBinaryRef : IEquatable
+public unsafe partial struct LLVMBinaryRef(IntPtr handle) : IEquatable
{
- public IntPtr Handle;
-
- public LLVMBinaryRef(IntPtr handle)
- {
- Handle = handle;
- }
+ public IntPtr Handle = handle;
public static implicit operator LLVMBinaryRef(LLVMOpaqueBinary* Comdat) => new LLVMBinaryRef((IntPtr)Comdat);
@@ -21,11 +16,11 @@ public LLVMBinaryRef(IntPtr handle)
public static bool operator !=(LLVMBinaryRef left, LLVMBinaryRef right) => !(left == right);
- public override bool Equals(object? obj) => (obj is LLVMBinaryRef other) && Equals(other);
+ public override readonly bool Equals(object? obj) => (obj is LLVMBinaryRef other) && Equals(other);
- public bool Equals(LLVMBinaryRef other) => this == other;
+ public readonly bool Equals(LLVMBinaryRef other) => this == other;
- public override int GetHashCode() => Handle.GetHashCode();
+ public override readonly int GetHashCode() => Handle.GetHashCode();
- public override string ToString() => $"{nameof(LLVMBinaryRef)}: {Handle:X}";
+ public override readonly string ToString() => $"{nameof(LLVMBinaryRef)}: {Handle:X}";
}
diff --git a/sources/LLVMSharp.Interop/Extensions/LLVMBuilderRef.cs b/sources/LLVMSharp.Interop/Extensions/LLVMBuilderRef.cs
index 7e6647e1..faf26e4e 100644
--- a/sources/LLVMSharp.Interop/Extensions/LLVMBuilderRef.cs
+++ b/sources/LLVMSharp.Interop/Extensions/LLVMBuilderRef.cs
@@ -4,16 +4,11 @@
namespace LLVMSharp.Interop;
-public unsafe partial struct LLVMBuilderRef : IDisposable, IEquatable
+public unsafe partial struct LLVMBuilderRef(IntPtr handle) : IDisposable, IEquatable
{
- public IntPtr Handle;
+ public IntPtr Handle = handle;
- public LLVMBuilderRef(IntPtr handle)
- {
- Handle = handle;
- }
-
- public LLVMValueRef CurrentDebugLocation
+ public readonly LLVMValueRef CurrentDebugLocation
{
get
{
@@ -26,7 +21,7 @@ public LLVMValueRef CurrentDebugLocation
}
}
- public LLVMBasicBlockRef InsertBlock => (Handle != IntPtr.Zero) ? LLVM.GetInsertBlock(this) : default;
+ public readonly LLVMBasicBlockRef InsertBlock => (Handle != IntPtr.Zero) ? LLVM.GetInsertBlock(this) : default;
public static implicit operator LLVMBuilderRef(LLVMOpaqueBuilder* Builder) => new LLVMBuilderRef((IntPtr)Builder);
@@ -38,25 +33,25 @@ public LLVMValueRef CurrentDebugLocation
public static LLVMBuilderRef Create(LLVMContextRef C) => LLVM.CreateBuilderInContext(C);
- public LLVMValueRef BuildAdd(LLVMValueRef LHS, LLVMValueRef RHS, string Name = "") => BuildAdd(LHS, RHS, Name.AsSpan());
+ public readonly LLVMValueRef BuildAdd(LLVMValueRef LHS, LLVMValueRef RHS, string Name = "") => BuildAdd(LHS, RHS, Name.AsSpan());
- public LLVMValueRef BuildAdd(LLVMValueRef LHS, LLVMValueRef RHS, ReadOnlySpan Name)
+ public readonly LLVMValueRef BuildAdd(LLVMValueRef LHS, LLVMValueRef RHS, ReadOnlySpan Name)
{
using var marshaledName = new MarshaledString(Name);
return LLVM.BuildAdd(this, LHS, RHS, marshaledName);
}
- public LLVMValueRef BuildAddrSpaceCast(LLVMValueRef Val, LLVMTypeRef DestTy, string Name = "") => BuildAddrSpaceCast(Val, DestTy, Name.AsSpan());
+ public readonly LLVMValueRef BuildAddrSpaceCast(LLVMValueRef Val, LLVMTypeRef DestTy, string Name = "") => BuildAddrSpaceCast(Val, DestTy, Name.AsSpan());
- public LLVMValueRef BuildAddrSpaceCast(LLVMValueRef Val, LLVMTypeRef DestTy, ReadOnlySpan Name)
+ public readonly LLVMValueRef BuildAddrSpaceCast(LLVMValueRef Val, LLVMTypeRef DestTy, ReadOnlySpan Name)
{
using var marshaledName = new MarshaledString(Name);
return LLVM.BuildAddrSpaceCast(this, Val, DestTy, marshaledName);
}
- public LLVMValueRef BuildAggregateRet(LLVMValueRef[] RetVals) => BuildAggregateRet(RetVals.AsSpan());
+ public readonly LLVMValueRef BuildAggregateRet(LLVMValueRef[] RetVals) => BuildAggregateRet(RetVals.AsSpan());
- public LLVMValueRef BuildAggregateRet(ReadOnlySpan RetVals)
+ public readonly LLVMValueRef BuildAggregateRet(ReadOnlySpan RetVals)
{
fixed (LLVMValueRef* pRetVals = RetVals)
{
@@ -64,69 +59,69 @@ public LLVMValueRef BuildAggregateRet(ReadOnlySpan RetVals)
}
}
- public LLVMValueRef BuildAlloca(LLVMTypeRef Ty, string Name = "") => BuildAlloca(Ty, Name.AsSpan());
+ public readonly LLVMValueRef BuildAlloca(LLVMTypeRef Ty, string Name = "") => BuildAlloca(Ty, Name.AsSpan());
- public LLVMValueRef BuildAlloca(LLVMTypeRef Ty, ReadOnlySpan Name)
+ public readonly LLVMValueRef BuildAlloca(LLVMTypeRef Ty, ReadOnlySpan Name)
{
using var marshaledName = new MarshaledString(Name);
return LLVM.BuildAlloca(this, Ty, marshaledName);
}
- public LLVMValueRef BuildAnd(LLVMValueRef LHS, LLVMValueRef RHS, string Name = "") => BuildAnd(LHS, RHS, Name.AsSpan());
+ public readonly LLVMValueRef BuildAnd(LLVMValueRef LHS, LLVMValueRef RHS, string Name = "") => BuildAnd(LHS, RHS, Name.AsSpan());
- public LLVMValueRef BuildAnd(LLVMValueRef LHS, LLVMValueRef RHS, ReadOnlySpan Name)
+ public readonly LLVMValueRef BuildAnd(LLVMValueRef LHS, LLVMValueRef RHS, ReadOnlySpan Name)
{
using var marshaledName = new MarshaledString(Name);
return LLVM.BuildAnd(this, LHS, RHS, marshaledName);
}
- public LLVMValueRef BuildArrayAlloca(LLVMTypeRef Ty, LLVMValueRef Val, string Name = "") => BuildArrayAlloca(Ty, Val, Name.AsSpan());
+ public readonly LLVMValueRef BuildArrayAlloca(LLVMTypeRef Ty, LLVMValueRef Val, string Name = "") => BuildArrayAlloca(Ty, Val, Name.AsSpan());
- public LLVMValueRef BuildArrayAlloca(LLVMTypeRef Ty, LLVMValueRef Val, ReadOnlySpan Name)
+ public readonly LLVMValueRef BuildArrayAlloca(LLVMTypeRef Ty, LLVMValueRef Val, ReadOnlySpan Name)
{
using var marshaledName = new MarshaledString(Name);
return LLVM.BuildArrayAlloca(this, Ty, Val, marshaledName);
}
- public LLVMValueRef BuildArrayMalloc(LLVMTypeRef Ty, LLVMValueRef Val, string Name = "") => BuildArrayMalloc(Ty, Val, Name.AsSpan());
+ public readonly LLVMValueRef BuildArrayMalloc(LLVMTypeRef Ty, LLVMValueRef Val, string Name = "") => BuildArrayMalloc(Ty, Val, Name.AsSpan());
- public LLVMValueRef BuildArrayMalloc(LLVMTypeRef Ty, LLVMValueRef Val, ReadOnlySpan Name)
+ public readonly LLVMValueRef BuildArrayMalloc(LLVMTypeRef Ty, LLVMValueRef Val, ReadOnlySpan Name)
{
using var marshaledName = new MarshaledString(Name);
return LLVM.BuildArrayMalloc(this, Ty, Val, marshaledName);
}
- public LLVMValueRef BuildAShr(LLVMValueRef LHS, LLVMValueRef RHS, string Name = "") => BuildAShr(LHS, RHS, Name.AsSpan());
+ public readonly LLVMValueRef BuildAShr(LLVMValueRef LHS, LLVMValueRef RHS, string Name = "") => BuildAShr(LHS, RHS, Name.AsSpan());
- public LLVMValueRef BuildAShr(LLVMValueRef LHS, LLVMValueRef RHS, ReadOnlySpan Name)
+ public readonly LLVMValueRef BuildAShr(LLVMValueRef LHS, LLVMValueRef RHS, ReadOnlySpan Name)
{
using var marshaledName = new MarshaledString(Name);
return LLVM.BuildAShr(this, LHS, RHS, marshaledName);
}
- public LLVMValueRef BuildAtomicRMW(LLVMAtomicRMWBinOp op, LLVMValueRef PTR, LLVMValueRef Val, LLVMAtomicOrdering ordering, bool singleThread) => LLVM.BuildAtomicRMW(this, op, PTR, Val, ordering, singleThread ? 1 : 0);
+ public readonly LLVMValueRef BuildAtomicRMW(LLVMAtomicRMWBinOp op, LLVMValueRef PTR, LLVMValueRef Val, LLVMAtomicOrdering ordering, bool singleThread) => LLVM.BuildAtomicRMW(this, op, PTR, Val, ordering, singleThread ? 1 : 0);
- public LLVMValueRef BuildBinOp(LLVMOpcode Op, LLVMValueRef LHS, LLVMValueRef RHS, string Name = "") => BuildBinOp(Op, LHS, RHS, Name.AsSpan());
+ public readonly LLVMValueRef BuildBinOp(LLVMOpcode Op, LLVMValueRef LHS, LLVMValueRef RHS, string Name = "") => BuildBinOp(Op, LHS, RHS, Name.AsSpan());
- public LLVMValueRef BuildBinOp(LLVMOpcode Op, LLVMValueRef LHS, LLVMValueRef RHS, ReadOnlySpan Name)
+ public readonly LLVMValueRef BuildBinOp(LLVMOpcode Op, LLVMValueRef LHS, LLVMValueRef RHS, ReadOnlySpan Name)
{
using var marshaledName = new MarshaledString(Name);
return LLVM.BuildBinOp(this, Op, LHS, RHS, marshaledName);
}
- public LLVMValueRef BuildBitCast(LLVMValueRef Val, LLVMTypeRef DestTy, string Name = "") => BuildBitCast(Val, DestTy, Name.AsSpan());
+ public readonly LLVMValueRef BuildBitCast(LLVMValueRef Val, LLVMTypeRef DestTy, string Name = "") => BuildBitCast(Val, DestTy, Name.AsSpan());
- public LLVMValueRef BuildBitCast(LLVMValueRef Val, LLVMTypeRef DestTy, ReadOnlySpan Name)
+ public readonly LLVMValueRef BuildBitCast(LLVMValueRef Val, LLVMTypeRef DestTy, ReadOnlySpan Name)
{
using var marshaledName = new MarshaledString(Name);
return LLVM.BuildBitCast(this, Val, DestTy, marshaledName);
}
- public LLVMValueRef BuildBr(LLVMBasicBlockRef Dest) => LLVM.BuildBr(this, Dest);
+ public readonly LLVMValueRef BuildBr(LLVMBasicBlockRef Dest) => LLVM.BuildBr(this, Dest);
- public LLVMValueRef BuildCall2(LLVMTypeRef Ty, LLVMValueRef Fn, LLVMValueRef[] Args, string Name = "") => BuildCall2(Ty, Fn, Args.AsSpan(), Name.AsSpan());
+ public readonly LLVMValueRef BuildCall2(LLVMTypeRef Ty, LLVMValueRef Fn, LLVMValueRef[] Args, string Name = "") => BuildCall2(Ty, Fn, Args.AsSpan(), Name.AsSpan());
- public LLVMValueRef BuildCall2(LLVMTypeRef Ty, LLVMValueRef Fn, ReadOnlySpan Args, ReadOnlySpan Name)
+ public readonly LLVMValueRef BuildCall2(LLVMTypeRef Ty, LLVMValueRef Fn, ReadOnlySpan Args, ReadOnlySpan Name)
{
fixed (LLVMValueRef* pArgs = Args)
{
@@ -135,157 +130,157 @@ public LLVMValueRef BuildCall2(LLVMTypeRef Ty, LLVMValueRef Fn, ReadOnlySpan BuildCast(Op, Val, DestTy, Name.AsSpan());
+ public readonly LLVMValueRef BuildCast(LLVMOpcode Op, LLVMValueRef Val, LLVMTypeRef DestTy, string Name = "") => BuildCast(Op, Val, DestTy, Name.AsSpan());
- public LLVMValueRef BuildCast(LLVMOpcode Op, LLVMValueRef Val, LLVMTypeRef DestTy, ReadOnlySpan Name)
+ public readonly LLVMValueRef BuildCast(LLVMOpcode Op, LLVMValueRef Val, LLVMTypeRef DestTy, ReadOnlySpan Name)
{
using var marshaledName = new MarshaledString(Name);
return LLVM.BuildCast(this, Op, Val, DestTy, marshaledName);
}
- public LLVMValueRef BuildCondBr(LLVMValueRef If, LLVMBasicBlockRef Then, LLVMBasicBlockRef Else) => LLVM.BuildCondBr(this, If, Then, Else);
+ public readonly LLVMValueRef BuildCondBr(LLVMValueRef If, LLVMBasicBlockRef Then, LLVMBasicBlockRef Else) => LLVM.BuildCondBr(this, If, Then, Else);
- public LLVMValueRef BuildExactSDiv(LLVMValueRef LHS, LLVMValueRef RHS, string Name = "") => BuildExactSDiv(LHS, RHS, Name.AsSpan());
+ public readonly LLVMValueRef BuildExactSDiv(LLVMValueRef LHS, LLVMValueRef RHS, string Name = "") => BuildExactSDiv(LHS, RHS, Name.AsSpan());
- public LLVMValueRef BuildExactSDiv(LLVMValueRef LHS, LLVMValueRef RHS, ReadOnlySpan Name)
+ public readonly LLVMValueRef BuildExactSDiv(LLVMValueRef LHS, LLVMValueRef RHS, ReadOnlySpan Name)
{
using var marshaledName = new MarshaledString(Name);
return LLVM.BuildExactSDiv(this, LHS, RHS, marshaledName);
}
- public LLVMValueRef BuildExtractElement(LLVMValueRef VecVal, LLVMValueRef Index, string Name = "") => BuildExtractElement(VecVal, Index, Name.AsSpan());
+ public readonly LLVMValueRef BuildExtractElement(LLVMValueRef VecVal, LLVMValueRef Index, string Name = "") => BuildExtractElement(VecVal, Index, Name.AsSpan());
- public LLVMValueRef BuildExtractElement(LLVMValueRef VecVal, LLVMValueRef Index, ReadOnlySpan Name)
+ public readonly LLVMValueRef BuildExtractElement(LLVMValueRef VecVal, LLVMValueRef Index, ReadOnlySpan Name)
{
using var marshaledName = new MarshaledString(Name);
return LLVM.BuildExtractElement(this, VecVal, Index, marshaledName);
}
- public LLVMValueRef BuildExtractValue(LLVMValueRef AggVal, uint Index, string Name = "") => BuildExtractValue(AggVal, Index, Name.AsSpan());
+ public readonly LLVMValueRef BuildExtractValue(LLVMValueRef AggVal, uint Index, string Name = "") => BuildExtractValue(AggVal, Index, Name.AsSpan());
- public LLVMValueRef BuildExtractValue(LLVMValueRef AggVal, uint Index, ReadOnlySpan Name)
+ public readonly LLVMValueRef BuildExtractValue(LLVMValueRef AggVal, uint Index, ReadOnlySpan Name)
{
using var marshaledName = new MarshaledString(Name);
return LLVM.BuildExtractValue(this, AggVal, Index, marshaledName);
}
- public LLVMValueRef BuildFAdd(LLVMValueRef LHS, LLVMValueRef RHS, string Name = "") => BuildFAdd(LHS, RHS, Name.AsSpan());
+ public readonly LLVMValueRef BuildFAdd(LLVMValueRef LHS, LLVMValueRef RHS, string Name = "") => BuildFAdd(LHS, RHS, Name.AsSpan());
- public LLVMValueRef BuildFAdd(LLVMValueRef LHS, LLVMValueRef RHS, ReadOnlySpan Name)
+ public readonly LLVMValueRef BuildFAdd(LLVMValueRef LHS, LLVMValueRef RHS, ReadOnlySpan Name)
{
using var marshaledName = new MarshaledString(Name);
return LLVM.BuildFAdd(this, LHS, RHS, marshaledName);
}
- public LLVMValueRef BuildFCmp(LLVMRealPredicate Op, LLVMValueRef LHS, LLVMValueRef RHS, string Name = "") => BuildFCmp(Op, LHS, RHS, Name.AsSpan());
+ public readonly LLVMValueRef BuildFCmp(LLVMRealPredicate Op, LLVMValueRef LHS, LLVMValueRef RHS, string Name = "") => BuildFCmp(Op, LHS, RHS, Name.AsSpan());
- public LLVMValueRef BuildFCmp(LLVMRealPredicate Op, LLVMValueRef LHS, LLVMValueRef RHS, ReadOnlySpan Name)
+ public readonly LLVMValueRef BuildFCmp(LLVMRealPredicate Op, LLVMValueRef LHS, LLVMValueRef RHS, ReadOnlySpan Name)
{
using var marshaledName = new MarshaledString(Name);
return LLVM.BuildFCmp(this, Op, LHS, RHS, marshaledName);
}
- public LLVMValueRef BuildFDiv(LLVMValueRef LHS, LLVMValueRef RHS, string Name = "") => BuildFDiv(LHS, RHS, Name.AsSpan());
+ public readonly LLVMValueRef BuildFDiv(LLVMValueRef LHS, LLVMValueRef RHS, string Name = "") => BuildFDiv(LHS, RHS, Name.AsSpan());
- public LLVMValueRef BuildFDiv(LLVMValueRef LHS, LLVMValueRef RHS, ReadOnlySpan Name)
+ public readonly LLVMValueRef BuildFDiv(LLVMValueRef LHS, LLVMValueRef RHS, ReadOnlySpan Name)
{
using var marshaledName = new MarshaledString(Name);
return LLVM.BuildFDiv(this, LHS, RHS, marshaledName);
}
- public LLVMValueRef BuildFence(LLVMAtomicOrdering ordering, bool singleThread, string Name = "") => BuildFence(ordering, singleThread, Name.AsSpan());
+ public readonly LLVMValueRef BuildFence(LLVMAtomicOrdering ordering, bool singleThread, string Name = "") => BuildFence(ordering, singleThread, Name.AsSpan());
- public LLVMValueRef BuildFence(LLVMAtomicOrdering ordering, bool singleThread, ReadOnlySpan Name)
+ public readonly LLVMValueRef BuildFence(LLVMAtomicOrdering ordering, bool singleThread, ReadOnlySpan Name)
{
using var marshaledName = new MarshaledString(Name);
return LLVM.BuildFence(this, ordering, singleThread ? 1 : 0, marshaledName);
}
- public LLVMValueRef BuildFMul(LLVMValueRef LHS, LLVMValueRef RHS, string Name = "") => BuildFMul(LHS, RHS, Name.AsSpan());
+ public readonly LLVMValueRef BuildFMul(LLVMValueRef LHS, LLVMValueRef RHS, string Name = "") => BuildFMul(LHS, RHS, Name.AsSpan());
- public LLVMValueRef BuildFMul(LLVMValueRef LHS, LLVMValueRef RHS, ReadOnlySpan Name)
+ public readonly LLVMValueRef BuildFMul(LLVMValueRef LHS, LLVMValueRef RHS, ReadOnlySpan Name)
{
using var marshaledName = new MarshaledString(Name);
return LLVM.BuildFMul(this, LHS, RHS, marshaledName);
}
- public LLVMValueRef BuildFNeg(LLVMValueRef V, string Name = "") => BuildFNeg(V, Name.AsSpan());
+ public readonly LLVMValueRef BuildFNeg(LLVMValueRef V, string Name = "") => BuildFNeg(V, Name.AsSpan());
- public LLVMValueRef BuildFNeg(LLVMValueRef V, ReadOnlySpan Name)
+ public readonly LLVMValueRef BuildFNeg(LLVMValueRef V, ReadOnlySpan Name)
{
using var marshaledName = new MarshaledString(Name);
return LLVM.BuildFNeg(this, V, marshaledName);
}
- public LLVMValueRef BuildFPCast(LLVMValueRef Val, LLVMTypeRef DestTy, string Name = "") => BuildFPCast(Val, DestTy, Name.AsSpan());
+ public readonly LLVMValueRef BuildFPCast(LLVMValueRef Val, LLVMTypeRef DestTy, string Name = "") => BuildFPCast(Val, DestTy, Name.AsSpan());
- public LLVMValueRef BuildFPCast(LLVMValueRef Val, LLVMTypeRef DestTy, ReadOnlySpan Name)
+ public readonly LLVMValueRef BuildFPCast(LLVMValueRef Val, LLVMTypeRef DestTy, ReadOnlySpan Name)
{
using var marshaledName = new MarshaledString(Name);
return LLVM.BuildFPCast(this, Val, DestTy, marshaledName);
}
- public LLVMValueRef BuildFPExt(LLVMValueRef Val, LLVMTypeRef DestTy, string Name = "") => BuildFPCast(Val, DestTy, Name.AsSpan());
+ public readonly LLVMValueRef BuildFPExt(LLVMValueRef Val, LLVMTypeRef DestTy, string Name = "") => BuildFPCast(Val, DestTy, Name.AsSpan());
- public LLVMValueRef BuildFPExt(LLVMValueRef Val, LLVMTypeRef DestTy, ReadOnlySpan Name)
+ public readonly LLVMValueRef BuildFPExt(LLVMValueRef Val, LLVMTypeRef DestTy, ReadOnlySpan Name)
{
using var marshaledName = new MarshaledString(Name);
return LLVM.BuildFPExt(this, Val, DestTy, marshaledName);
}
- public LLVMValueRef BuildFPToSI(LLVMValueRef Val, LLVMTypeRef DestTy, string Name = "") => BuildFPToSI(Val, DestTy, Name.AsSpan());
+ public readonly LLVMValueRef BuildFPToSI(LLVMValueRef Val, LLVMTypeRef DestTy, string Name = "") => BuildFPToSI(Val, DestTy, Name.AsSpan());
- public LLVMValueRef BuildFPToSI(LLVMValueRef Val, LLVMTypeRef DestTy, ReadOnlySpan Name)
+ public readonly LLVMValueRef BuildFPToSI(LLVMValueRef Val, LLVMTypeRef DestTy, ReadOnlySpan Name)
{
using var marshaledName = new MarshaledString(Name);
return LLVM.BuildFPToSI(this, Val, DestTy, marshaledName);
}
- public LLVMValueRef BuildFPToUI(LLVMValueRef Val, LLVMTypeRef DestTy, string Name = "") => BuildFPToUI(Val, DestTy, Name.AsSpan());
+ public readonly LLVMValueRef BuildFPToUI(LLVMValueRef Val, LLVMTypeRef DestTy, string Name = "") => BuildFPToUI(Val, DestTy, Name.AsSpan());
- public LLVMValueRef BuildFPToUI(LLVMValueRef Val, LLVMTypeRef DestTy, ReadOnlySpan Name)
+ public readonly LLVMValueRef BuildFPToUI(LLVMValueRef Val, LLVMTypeRef DestTy, ReadOnlySpan Name)
{
using var marshaledName = new MarshaledString(Name);
return LLVM.BuildFPToUI(this, Val, DestTy, marshaledName);
}
- public LLVMValueRef BuildFPTrunc(LLVMValueRef Val, LLVMTypeRef DestTy, string Name = "") => BuildFPTrunc(Val, DestTy, Name.AsSpan());
+ public readonly LLVMValueRef BuildFPTrunc(LLVMValueRef Val, LLVMTypeRef DestTy, string Name = "") => BuildFPTrunc(Val, DestTy, Name.AsSpan());
- public LLVMValueRef BuildFPTrunc(LLVMValueRef Val, LLVMTypeRef DestTy, ReadOnlySpan Name)
+ public readonly LLVMValueRef BuildFPTrunc(LLVMValueRef Val, LLVMTypeRef DestTy, ReadOnlySpan Name)
{
using var marshaledName = new MarshaledString(Name);
return LLVM.BuildFPTrunc(this, Val, DestTy, marshaledName);
}
- public LLVMValueRef BuildFree(LLVMValueRef PointerVal) => LLVM.BuildFree(this, PointerVal);
+ public readonly LLVMValueRef BuildFree(LLVMValueRef PointerVal) => LLVM.BuildFree(this, PointerVal);
- public LLVMValueRef BuildFreeze(LLVMValueRef Val, string Name = "") => BuildFreeze(Val, Name.AsSpan());
+ public readonly LLVMValueRef BuildFreeze(LLVMValueRef Val, string Name = "") => BuildFreeze(Val, Name.AsSpan());
- public LLVMValueRef BuildFreeze(LLVMValueRef Val, ReadOnlySpan Name)
+ public readonly LLVMValueRef BuildFreeze(LLVMValueRef Val, ReadOnlySpan Name)
{
using var marshaledName = new MarshaledString(Name);
return LLVM.BuildFreeze(this, Val, marshaledName);
}
- public LLVMValueRef BuildFRem(LLVMValueRef LHS, LLVMValueRef RHS, string Name = "") => BuildFRem(LHS, RHS, Name.AsSpan());
+ public readonly LLVMValueRef BuildFRem(LLVMValueRef LHS, LLVMValueRef RHS, string Name = "") => BuildFRem(LHS, RHS, Name.AsSpan());
- public LLVMValueRef BuildFRem(LLVMValueRef LHS, LLVMValueRef RHS, ReadOnlySpan Name)
+ public readonly LLVMValueRef BuildFRem(LLVMValueRef LHS, LLVMValueRef RHS, ReadOnlySpan Name)
{
using var marshaledName = new MarshaledString(Name);
return LLVM.BuildFRem(this, LHS, RHS, marshaledName);
}
- public LLVMValueRef BuildFSub(LLVMValueRef LHS, LLVMValueRef RHS, string Name = "") => BuildFSub(LHS, RHS, Name.AsSpan());
+ public readonly LLVMValueRef BuildFSub(LLVMValueRef LHS, LLVMValueRef RHS, string Name = "") => BuildFSub(LHS, RHS, Name.AsSpan());
- public LLVMValueRef BuildFSub(LLVMValueRef LHS, LLVMValueRef RHS, ReadOnlySpan Name)
+ public readonly LLVMValueRef BuildFSub(LLVMValueRef LHS, LLVMValueRef RHS, ReadOnlySpan Name)
{
using var marshaledName = new MarshaledString(Name);
return LLVM.BuildFSub(this, LHS, RHS, marshaledName);
}
- public LLVMValueRef BuildGEP2(LLVMTypeRef Ty, LLVMValueRef Pointer, LLVMValueRef[] Indices, string Name = "") => BuildGEP2(Ty, Pointer, Indices.AsSpan(), Name.AsSpan());
+ public readonly LLVMValueRef BuildGEP2(LLVMTypeRef Ty, LLVMValueRef Pointer, LLVMValueRef[] Indices, string Name = "") => BuildGEP2(Ty, Pointer, Indices.AsSpan(), Name.AsSpan());
- public LLVMValueRef BuildGEP2(LLVMTypeRef Ty, LLVMValueRef Pointer, ReadOnlySpan Indices, ReadOnlySpan Name)
+ public readonly LLVMValueRef BuildGEP2(LLVMTypeRef Ty, LLVMValueRef Pointer, ReadOnlySpan Indices, ReadOnlySpan Name)
{
fixed (LLVMValueRef* pIndices = Indices)
{
@@ -294,35 +289,35 @@ public LLVMValueRef BuildGEP2(LLVMTypeRef Ty, LLVMValueRef Pointer, ReadOnlySpan
}
}
- public LLVMValueRef BuildGlobalString(string Str, string Name = "") => BuildGlobalString(Str.AsSpan(), Name.AsSpan());
+ public readonly LLVMValueRef BuildGlobalString(string Str, string Name = "") => BuildGlobalString(Str.AsSpan(), Name.AsSpan());
- public LLVMValueRef BuildGlobalString(ReadOnlySpan Str, ReadOnlySpan Name)
+ public readonly LLVMValueRef BuildGlobalString(ReadOnlySpan Str, ReadOnlySpan Name)
{
using var marshaledStr = new MarshaledString(Str);
using var marshaledName = new MarshaledString(Name);
return LLVM.BuildGlobalString(this, marshaledStr, marshaledName);
}
- public LLVMValueRef BuildGlobalStringPtr(string Str, string Name = "") => BuildGlobalStringPtr(Str.AsSpan(), Name.AsSpan());
+ public readonly LLVMValueRef BuildGlobalStringPtr(string Str, string Name = "") => BuildGlobalStringPtr(Str.AsSpan(), Name.AsSpan());
- public LLVMValueRef BuildGlobalStringPtr(ReadOnlySpan Str, ReadOnlySpan Name)
+ public readonly LLVMValueRef BuildGlobalStringPtr(ReadOnlySpan Str, ReadOnlySpan Name)
{
using var marshaledStr = new MarshaledString(Str);
using var marshaledName = new MarshaledString(Name);
return LLVM.BuildGlobalStringPtr(this, marshaledStr, marshaledName);
}
- public LLVMValueRef BuildICmp(LLVMIntPredicate Op, LLVMValueRef LHS, LLVMValueRef RHS, string Name = "") => BuildICmp(Op, LHS, RHS, Name.AsSpan());
+ public readonly LLVMValueRef BuildICmp(LLVMIntPredicate Op, LLVMValueRef LHS, LLVMValueRef RHS, string Name = "") => BuildICmp(Op, LHS, RHS, Name.AsSpan());
- public LLVMValueRef BuildICmp(LLVMIntPredicate Op, LLVMValueRef LHS, LLVMValueRef RHS, ReadOnlySpan Name)
+ public readonly LLVMValueRef BuildICmp(LLVMIntPredicate Op, LLVMValueRef LHS, LLVMValueRef RHS, ReadOnlySpan Name)
{
using var marshaledName = new MarshaledString(Name);
return LLVM.BuildICmp(this, Op, LHS, RHS, marshaledName);
}
- public LLVMValueRef BuildInBoundsGEP2(LLVMTypeRef Ty, LLVMValueRef Pointer, LLVMValueRef[] Indices, string Name = "") => BuildInBoundsGEP2(Ty, Pointer, Indices.AsSpan(), Name.AsSpan());
+ public readonly LLVMValueRef BuildInBoundsGEP2(LLVMTypeRef Ty, LLVMValueRef Pointer, LLVMValueRef[] Indices, string Name = "") => BuildInBoundsGEP2(Ty, Pointer, Indices.AsSpan(), Name.AsSpan());
- public LLVMValueRef BuildInBoundsGEP2(LLVMTypeRef Ty, LLVMValueRef Pointer, ReadOnlySpan Indices, ReadOnlySpan Name)
+ public readonly LLVMValueRef BuildInBoundsGEP2(LLVMTypeRef Ty, LLVMValueRef Pointer, ReadOnlySpan Indices, ReadOnlySpan Name)
{
fixed (LLVMValueRef* pIndices = Indices)
{
@@ -331,43 +326,43 @@ public LLVMValueRef BuildInBoundsGEP2(LLVMTypeRef Ty, LLVMValueRef Pointer, Read
}
}
- public LLVMValueRef BuildIndirectBr(LLVMValueRef Addr, uint NumDests) => LLVM.BuildIndirectBr(this, Addr, NumDests);
+ public readonly LLVMValueRef BuildIndirectBr(LLVMValueRef Addr, uint NumDests) => LLVM.BuildIndirectBr(this, Addr, NumDests);
- public LLVMValueRef BuildInsertElement(LLVMValueRef VecVal, LLVMValueRef EltVal, LLVMValueRef Index, string Name = "") => BuildInsertElement(VecVal, EltVal, Index, Name.AsSpan());
+ public readonly LLVMValueRef BuildInsertElement(LLVMValueRef VecVal, LLVMValueRef EltVal, LLVMValueRef Index, string Name = "") => BuildInsertElement(VecVal, EltVal, Index, Name.AsSpan());
- public LLVMValueRef BuildInsertElement(LLVMValueRef VecVal, LLVMValueRef EltVal, LLVMValueRef Index, ReadOnlySpan Name)
+ public readonly LLVMValueRef BuildInsertElement(LLVMValueRef VecVal, LLVMValueRef EltVal, LLVMValueRef Index, ReadOnlySpan Name)
{
using var marshaledName = new MarshaledString(Name);
return LLVM.BuildInsertElement(this, VecVal, EltVal, Index, marshaledName);
}
- public LLVMValueRef BuildInsertValue(LLVMValueRef AggVal, LLVMValueRef EltVal, uint Index, string Name = "") => BuildInsertValue(AggVal, EltVal, Index, Name.AsSpan());
+ public readonly LLVMValueRef BuildInsertValue(LLVMValueRef AggVal, LLVMValueRef EltVal, uint Index, string Name = "") => BuildInsertValue(AggVal, EltVal, Index, Name.AsSpan());
- public LLVMValueRef BuildInsertValue(LLVMValueRef AggVal, LLVMValueRef EltVal, uint Index, ReadOnlySpan Name)
+ public readonly LLVMValueRef BuildInsertValue(LLVMValueRef AggVal, LLVMValueRef EltVal, uint Index, ReadOnlySpan Name)
{
using var marshaledName = new MarshaledString(Name);
return LLVM.BuildInsertValue(this, AggVal, EltVal, Index, marshaledName);
}
- public LLVMValueRef BuildIntCast(LLVMValueRef Val, LLVMTypeRef DestTy, string Name = "") => BuildIntCast(Val, DestTy, Name.AsSpan());
+ public readonly LLVMValueRef BuildIntCast(LLVMValueRef Val, LLVMTypeRef DestTy, string Name = "") => BuildIntCast(Val, DestTy, Name.AsSpan());
- public LLVMValueRef BuildIntCast(LLVMValueRef Val, LLVMTypeRef DestTy, ReadOnlySpan Name)
+ public readonly LLVMValueRef BuildIntCast(LLVMValueRef Val, LLVMTypeRef DestTy, ReadOnlySpan Name)
{
using var marshaledName = new MarshaledString(Name);
return LLVM.BuildIntCast(this, Val, DestTy, marshaledName);
}
- public LLVMValueRef BuildIntToPtr(LLVMValueRef Val, LLVMTypeRef DestTy, string Name = "") => BuildIntToPtr(Val, DestTy, Name.AsSpan());
+ public readonly LLVMValueRef BuildIntToPtr(LLVMValueRef Val, LLVMTypeRef DestTy, string Name = "") => BuildIntToPtr(Val, DestTy, Name.AsSpan());
- public LLVMValueRef BuildIntToPtr(LLVMValueRef Val, LLVMTypeRef DestTy, ReadOnlySpan Name)
+ public readonly LLVMValueRef BuildIntToPtr(LLVMValueRef Val, LLVMTypeRef DestTy, ReadOnlySpan Name)
{
using var marshaledName = new MarshaledString(Name);
return LLVM.BuildIntToPtr(this, Val, DestTy, marshaledName);
}
- public LLVMValueRef BuildInvoke2(LLVMTypeRef Ty, LLVMValueRef Fn, LLVMValueRef[] Args, LLVMBasicBlockRef Then, LLVMBasicBlockRef Catch, string Name = "") => BuildInvoke2(Ty, Fn, Args.AsSpan(), Then, Catch, Name.AsSpan());
+ public readonly LLVMValueRef BuildInvoke2(LLVMTypeRef Ty, LLVMValueRef Fn, LLVMValueRef[] Args, LLVMBasicBlockRef Then, LLVMBasicBlockRef Catch, string Name = "") => BuildInvoke2(Ty, Fn, Args.AsSpan(), Then, Catch, Name.AsSpan());
- public LLVMValueRef BuildInvoke2(LLVMTypeRef Ty, LLVMValueRef Fn, ReadOnlySpan Args, LLVMBasicBlockRef Then, LLVMBasicBlockRef Catch, ReadOnlySpan Name)
+ public readonly LLVMValueRef BuildInvoke2(LLVMTypeRef Ty, LLVMValueRef Fn, ReadOnlySpan Args, LLVMBasicBlockRef Then, LLVMBasicBlockRef Catch, ReadOnlySpan Name)
{
fixed (LLVMValueRef* pArgs = Args)
{
@@ -376,346 +371,346 @@ public LLVMValueRef BuildInvoke2(LLVMTypeRef Ty, LLVMValueRef Fn, ReadOnlySpan BuildIsNotNull(Val, Name.AsSpan());
+ public readonly LLVMValueRef BuildIsNotNull(LLVMValueRef Val, string Name = "") => BuildIsNotNull(Val, Name.AsSpan());
- public LLVMValueRef BuildIsNotNull(LLVMValueRef Val, ReadOnlySpan Name)
+ public readonly LLVMValueRef BuildIsNotNull(LLVMValueRef Val, ReadOnlySpan Name)
{
using var marshaledName = new MarshaledString(Name);
return LLVM.BuildIsNotNull(this, Val, marshaledName);
}
- public LLVMValueRef BuildIsNull(LLVMValueRef Val, string Name = "") => BuildIsNull(Val, Name.AsSpan());
+ public readonly LLVMValueRef BuildIsNull(LLVMValueRef Val, string Name = "") => BuildIsNull(Val, Name.AsSpan());
- public LLVMValueRef BuildIsNull(LLVMValueRef Val, ReadOnlySpan Name)
+ public readonly LLVMValueRef BuildIsNull(LLVMValueRef Val, ReadOnlySpan Name)
{
using var marshaledName = new MarshaledString(Name);
return LLVM.BuildIsNull(this, Val, marshaledName);
}
- public LLVMValueRef BuildLandingPad(LLVMTypeRef Ty, LLVMValueRef PersFn, uint NumClauses, string Name = "") => BuildLandingPad(Ty, PersFn, NumClauses, Name.AsSpan());
+ public readonly LLVMValueRef BuildLandingPad(LLVMTypeRef Ty, LLVMValueRef PersFn, uint NumClauses, string Name = "") => BuildLandingPad(Ty, PersFn, NumClauses, Name.AsSpan());
- public LLVMValueRef BuildLandingPad(LLVMTypeRef Ty, LLVMValueRef PersFn, uint NumClauses, ReadOnlySpan Name)
+ public readonly LLVMValueRef BuildLandingPad(LLVMTypeRef Ty, LLVMValueRef PersFn, uint NumClauses, ReadOnlySpan Name)
{
using var marshaledName = new MarshaledString(Name);
return LLVM.BuildLandingPad(this, Ty, PersFn, NumClauses, marshaledName);
}
- public LLVMValueRef BuildLoad2(LLVMTypeRef Ty, LLVMValueRef PointerVal, string Name = "") => BuildLoad2(Ty, PointerVal, Name.AsSpan());
+ public readonly LLVMValueRef BuildLoad2(LLVMTypeRef Ty, LLVMValueRef PointerVal, string Name = "") => BuildLoad2(Ty, PointerVal, Name.AsSpan());
- public LLVMValueRef BuildLoad2(LLVMTypeRef Ty, LLVMValueRef PointerVal, ReadOnlySpan Name)
+ public readonly LLVMValueRef BuildLoad2(LLVMTypeRef Ty, LLVMValueRef PointerVal, ReadOnlySpan Name)
{
using var marshaledName = new MarshaledString(Name);
return LLVM.BuildLoad2(this, Ty, PointerVal, marshaledName);
}
- public LLVMValueRef BuildLShr(LLVMValueRef LHS, LLVMValueRef RHS, string Name = "") => BuildLShr(LHS, RHS, Name.AsSpan());
+ public readonly LLVMValueRef BuildLShr(LLVMValueRef LHS, LLVMValueRef RHS, string Name = "") => BuildLShr(LHS, RHS, Name.AsSpan());
- public LLVMValueRef BuildLShr(LLVMValueRef LHS, LLVMValueRef RHS, ReadOnlySpan Name)
+ public readonly LLVMValueRef BuildLShr(LLVMValueRef LHS, LLVMValueRef RHS, ReadOnlySpan Name)
{
using var marshaledName = new MarshaledString(Name);
return LLVM.BuildLShr(this, LHS, RHS, marshaledName);
}
- public LLVMValueRef BuildMalloc(LLVMTypeRef Ty, string Name = "") => BuildMalloc(Ty, Name.AsSpan());
+ public readonly LLVMValueRef BuildMalloc(LLVMTypeRef Ty, string Name = "") => BuildMalloc(Ty, Name.AsSpan());
- public LLVMValueRef BuildMalloc(LLVMTypeRef Ty, ReadOnlySpan Name)
+ public readonly LLVMValueRef BuildMalloc(LLVMTypeRef Ty, ReadOnlySpan Name)
{
using var marshaledName = new MarshaledString(Name);
return LLVM.BuildMalloc(this, Ty, marshaledName);
}
- public LLVMValueRef BuildMul(LLVMValueRef LHS, LLVMValueRef RHS, string Name = "") => BuildMul(LHS, RHS, Name.AsSpan());
+ public readonly LLVMValueRef BuildMul(LLVMValueRef LHS, LLVMValueRef RHS, string Name = "") => BuildMul(LHS, RHS, Name.AsSpan());
- public LLVMValueRef BuildMul(LLVMValueRef LHS, LLVMValueRef RHS, ReadOnlySpan Name)
+ public readonly LLVMValueRef BuildMul(LLVMValueRef LHS, LLVMValueRef RHS, ReadOnlySpan Name)
{
using var marshaledName = new MarshaledString(Name);
return LLVM.BuildMul(this, LHS, RHS, marshaledName);
}
- public LLVMValueRef BuildNeg(LLVMValueRef V, string Name = "") => BuildNeg(V, Name.AsSpan());
+ public readonly LLVMValueRef BuildNeg(LLVMValueRef V, string Name = "") => BuildNeg(V, Name.AsSpan());
- public LLVMValueRef BuildNeg(LLVMValueRef V, ReadOnlySpan Name)
+ public readonly LLVMValueRef BuildNeg(LLVMValueRef V, ReadOnlySpan Name)
{
using var marshaledName = new MarshaledString(Name);
return LLVM.BuildNeg(this, V, marshaledName);
}
- public LLVMValueRef BuildNot(LLVMValueRef V, string Name = "") => BuildNot(V, Name.AsSpan());
+ public readonly LLVMValueRef BuildNot(LLVMValueRef V, string Name = "") => BuildNot(V, Name.AsSpan());
- public LLVMValueRef BuildNot(LLVMValueRef V, ReadOnlySpan Name)
+ public readonly LLVMValueRef BuildNot(LLVMValueRef V, ReadOnlySpan Name)
{
using var marshaledName = new MarshaledString(Name);
return LLVM.BuildNot(this, V, marshaledName);
}
- public LLVMValueRef BuildNSWAdd(LLVMValueRef LHS, LLVMValueRef RHS, string Name = "") => BuildNSWAdd(LHS, RHS, Name.AsSpan());
+ public readonly LLVMValueRef BuildNSWAdd(LLVMValueRef LHS, LLVMValueRef RHS, string Name = "") => BuildNSWAdd(LHS, RHS, Name.AsSpan());
- public LLVMValueRef BuildNSWAdd(LLVMValueRef LHS, LLVMValueRef RHS, ReadOnlySpan Name)
+ public readonly LLVMValueRef BuildNSWAdd(LLVMValueRef LHS, LLVMValueRef RHS, ReadOnlySpan Name)
{
using var marshaledName = new MarshaledString(Name);
return LLVM.BuildNSWAdd(this, LHS, RHS, marshaledName);
}
- public LLVMValueRef BuildNSWMul(LLVMValueRef LHS, LLVMValueRef RHS, string Name = "") => BuildNSWMul(LHS, RHS, Name.AsSpan());
+ public readonly LLVMValueRef BuildNSWMul(LLVMValueRef LHS, LLVMValueRef RHS, string Name = "") => BuildNSWMul(LHS, RHS, Name.AsSpan());
- public LLVMValueRef BuildNSWMul(LLVMValueRef LHS, LLVMValueRef RHS, ReadOnlySpan Name)
+ public readonly LLVMValueRef BuildNSWMul(LLVMValueRef LHS, LLVMValueRef RHS, ReadOnlySpan Name)
{
using var marshaledName = new MarshaledString(Name);
return LLVM.BuildNSWMul(this, LHS, RHS, marshaledName);
}
- public LLVMValueRef BuildNSWNeg(LLVMValueRef V, string Name = "") => BuildNSWNeg(V, Name.AsSpan());
+ public readonly LLVMValueRef BuildNSWNeg(LLVMValueRef V, string Name = "") => BuildNSWNeg(V, Name.AsSpan());
- public LLVMValueRef BuildNSWNeg(LLVMValueRef V, ReadOnlySpan Name)
+ public readonly LLVMValueRef BuildNSWNeg(LLVMValueRef V, ReadOnlySpan Name)
{
using var marshaledName = new MarshaledString(Name);
return LLVM.BuildNSWNeg(this, V, marshaledName);
}
- public LLVMValueRef BuildNSWSub(LLVMValueRef LHS, LLVMValueRef RHS, string Name = "") => BuildNSWSub(LHS, RHS, Name.AsSpan());
+ public readonly LLVMValueRef BuildNSWSub(LLVMValueRef LHS, LLVMValueRef RHS, string Name = "") => BuildNSWSub(LHS, RHS, Name.AsSpan());
- public LLVMValueRef BuildNSWSub(LLVMValueRef LHS, LLVMValueRef RHS, ReadOnlySpan Name)
+ public readonly LLVMValueRef BuildNSWSub(LLVMValueRef LHS, LLVMValueRef RHS, ReadOnlySpan Name)
{
using var marshaledName = new MarshaledString(Name);
return LLVM.BuildNSWSub(this, LHS, RHS, marshaledName);
}
- public LLVMValueRef BuildNUWAdd(LLVMValueRef LHS, LLVMValueRef RHS, string Name = "") => BuildNUWAdd(LHS, RHS, Name.AsSpan());
+ public readonly LLVMValueRef BuildNUWAdd(LLVMValueRef LHS, LLVMValueRef RHS, string Name = "") => BuildNUWAdd(LHS, RHS, Name.AsSpan());
- public LLVMValueRef BuildNUWAdd(LLVMValueRef LHS, LLVMValueRef RHS, ReadOnlySpan Name)
+ public readonly LLVMValueRef BuildNUWAdd(LLVMValueRef LHS, LLVMValueRef RHS, ReadOnlySpan Name)
{
using var marshaledName = new MarshaledString(Name);
return LLVM.BuildNUWAdd(this, LHS, RHS, marshaledName);
}
- public LLVMValueRef BuildNUWMul(LLVMValueRef LHS, LLVMValueRef RHS, string Name = "") => BuildNUWMul(LHS, RHS, Name.AsSpan());
+ public readonly LLVMValueRef BuildNUWMul(LLVMValueRef LHS, LLVMValueRef RHS, string Name = "") => BuildNUWMul(LHS, RHS, Name.AsSpan());
- public LLVMValueRef BuildNUWMul(LLVMValueRef LHS, LLVMValueRef RHS, ReadOnlySpan Name)
+ public readonly LLVMValueRef BuildNUWMul(LLVMValueRef LHS, LLVMValueRef RHS, ReadOnlySpan Name)
{
using var marshaledName = new MarshaledString(Name);
return LLVM.BuildNUWMul(this, LHS, RHS, marshaledName);
}
- public LLVMValueRef BuildNUWNeg(LLVMValueRef V, string Name = "") => BuildNUWNeg(V, Name.AsSpan());
+ public readonly LLVMValueRef BuildNUWNeg(LLVMValueRef V, string Name = "") => BuildNUWNeg(V, Name.AsSpan());
- public LLVMValueRef BuildNUWNeg(LLVMValueRef V, ReadOnlySpan Name)
+ public readonly LLVMValueRef BuildNUWNeg(LLVMValueRef V, ReadOnlySpan Name)
{
using var marshaledName = new MarshaledString(Name);
return LLVM.BuildNUWNeg(this, V, marshaledName);
}
- public LLVMValueRef BuildNUWSub(LLVMValueRef LHS, LLVMValueRef RHS, string Name = "") => BuildNUWSub(LHS, RHS, Name.AsSpan());
+ public readonly LLVMValueRef BuildNUWSub(LLVMValueRef LHS, LLVMValueRef RHS, string Name = "") => BuildNUWSub(LHS, RHS, Name.AsSpan());
- public LLVMValueRef BuildNUWSub(LLVMValueRef LHS, LLVMValueRef RHS, ReadOnlySpan Name)
+ public readonly LLVMValueRef BuildNUWSub(LLVMValueRef LHS, LLVMValueRef RHS, ReadOnlySpan Name)
{
using var marshaledName = new MarshaledString(Name);
return LLVM.BuildNUWSub(this, LHS, RHS, marshaledName);
}
- public LLVMValueRef BuildOr(LLVMValueRef LHS, LLVMValueRef RHS, string Name = "") => BuildOr(LHS, RHS, Name.AsSpan());
+ public readonly LLVMValueRef BuildOr(LLVMValueRef LHS, LLVMValueRef RHS, string Name = "") => BuildOr(LHS, RHS, Name.AsSpan());
- public LLVMValueRef BuildOr(LLVMValueRef LHS, LLVMValueRef RHS, ReadOnlySpan Name)
+ public readonly LLVMValueRef BuildOr(LLVMValueRef LHS, LLVMValueRef RHS, ReadOnlySpan Name)
{
using var marshaledName = new MarshaledString(Name);
return LLVM.BuildOr(this, LHS, RHS, marshaledName);
}
- public LLVMValueRef BuildPhi(LLVMTypeRef Ty, string Name = "") => BuildPhi(Ty, Name.AsSpan());
+ public readonly LLVMValueRef BuildPhi(LLVMTypeRef Ty, string Name = "") => BuildPhi(Ty, Name.AsSpan());
- public LLVMValueRef BuildPhi(LLVMTypeRef Ty, ReadOnlySpan Name)
+ public readonly LLVMValueRef BuildPhi(LLVMTypeRef Ty, ReadOnlySpan Name)
{
using var marshaledName = new MarshaledString(Name);
return LLVM.BuildPhi(this, Ty, marshaledName);
}
- public LLVMValueRef BuildPointerCast(LLVMValueRef Val, LLVMTypeRef DestTy, string Name = "") => BuildPointerCast(Val, DestTy, Name.AsSpan());
+ public readonly LLVMValueRef BuildPointerCast(LLVMValueRef Val, LLVMTypeRef DestTy, string Name = "") => BuildPointerCast(Val, DestTy, Name.AsSpan());
- public LLVMValueRef BuildPointerCast(LLVMValueRef Val, LLVMTypeRef DestTy, ReadOnlySpan Name)
+ public readonly LLVMValueRef BuildPointerCast(LLVMValueRef Val, LLVMTypeRef DestTy, ReadOnlySpan Name)
{
using var marshaledName = new MarshaledString(Name);
return LLVM.BuildPointerCast(this, Val, DestTy, marshaledName);
}
- public LLVMValueRef BuildPtrDiff2(LLVMTypeRef ElemTy, LLVMValueRef LHS, LLVMValueRef RHS, string Name = "") => BuildPtrDiff2(ElemTy, LHS, RHS, Name.AsSpan());
+ public readonly LLVMValueRef BuildPtrDiff2(LLVMTypeRef ElemTy, LLVMValueRef LHS, LLVMValueRef RHS, string Name = "") => BuildPtrDiff2(ElemTy, LHS, RHS, Name.AsSpan());
- public LLVMValueRef BuildPtrDiff2(LLVMTypeRef ElemTy, LLVMValueRef LHS, LLVMValueRef RHS, ReadOnlySpan Name)
+ public readonly LLVMValueRef BuildPtrDiff2(LLVMTypeRef ElemTy, LLVMValueRef LHS, LLVMValueRef RHS, ReadOnlySpan Name)
{
using var marshaledName = new MarshaledString(Name);
return LLVM.BuildPtrDiff2(this, ElemTy, LHS, RHS, marshaledName);
}
- public LLVMValueRef BuildPtrToInt(LLVMValueRef Val, LLVMTypeRef DestTy, string Name = "") => BuildPtrToInt(Val, DestTy, Name.AsSpan());
+ public readonly LLVMValueRef BuildPtrToInt(LLVMValueRef Val, LLVMTypeRef DestTy, string Name = "") => BuildPtrToInt(Val, DestTy, Name.AsSpan());
- public LLVMValueRef BuildPtrToInt(LLVMValueRef Val, LLVMTypeRef DestTy, ReadOnlySpan Name)
+ public readonly LLVMValueRef BuildPtrToInt(LLVMValueRef Val, LLVMTypeRef DestTy, ReadOnlySpan Name)
{
using var marshaledName = new MarshaledString(Name);
return LLVM.BuildPtrToInt(this, Val, DestTy, marshaledName);
}
- public LLVMValueRef BuildResume(LLVMValueRef Exn) => LLVM.BuildResume(this, Exn);
+ public readonly LLVMValueRef BuildResume(LLVMValueRef Exn) => LLVM.BuildResume(this, Exn);
- public LLVMValueRef BuildRet(LLVMValueRef V) => LLVM.BuildRet(this, V);
+ public readonly LLVMValueRef BuildRet(LLVMValueRef V) => LLVM.BuildRet(this, V);
- public LLVMValueRef BuildRetVoid() => LLVM.BuildRetVoid(this);
+ public readonly LLVMValueRef BuildRetVoid() => LLVM.BuildRetVoid(this);
- public LLVMValueRef BuildSDiv(LLVMValueRef LHS, LLVMValueRef RHS, string Name = "") => BuildSDiv(LHS, RHS, Name.AsSpan());
+ public readonly LLVMValueRef BuildSDiv(LLVMValueRef LHS, LLVMValueRef RHS, string Name = "") => BuildSDiv(LHS, RHS, Name.AsSpan());
- public LLVMValueRef BuildSDiv(LLVMValueRef LHS, LLVMValueRef RHS, ReadOnlySpan Name)
+ public readonly LLVMValueRef BuildSDiv(LLVMValueRef LHS, LLVMValueRef RHS, ReadOnlySpan Name)
{
using var marshaledName = new MarshaledString(Name);
return LLVM.BuildSDiv(this, LHS, RHS, marshaledName);
}
- public LLVMValueRef BuildSelect(LLVMValueRef If, LLVMValueRef Then, LLVMValueRef Else, string Name = "") => BuildSelect(If, Then, Else, Name.AsSpan());
+ public readonly LLVMValueRef BuildSelect(LLVMValueRef If, LLVMValueRef Then, LLVMValueRef Else, string Name = "") => BuildSelect(If, Then, Else, Name.AsSpan());
- public LLVMValueRef BuildSelect(LLVMValueRef If, LLVMValueRef Then, LLVMValueRef Else, ReadOnlySpan Name)
+ public readonly LLVMValueRef BuildSelect(LLVMValueRef If, LLVMValueRef Then, LLVMValueRef Else, ReadOnlySpan Name)
{
using var marshaledName = new MarshaledString(Name);
return LLVM.BuildSelect(this, If, Then, Else, marshaledName);
}
- public LLVMValueRef BuildSExt(LLVMValueRef Val, LLVMTypeRef DestTy, string Name = "") => BuildSExt(Val, DestTy, Name.AsSpan());
+ public readonly LLVMValueRef BuildSExt(LLVMValueRef Val, LLVMTypeRef DestTy, string Name = "") => BuildSExt(Val, DestTy, Name.AsSpan());
- public LLVMValueRef BuildSExt(LLVMValueRef Val, LLVMTypeRef DestTy, ReadOnlySpan Name)
+ public readonly LLVMValueRef BuildSExt(LLVMValueRef Val, LLVMTypeRef DestTy, ReadOnlySpan Name)
{
using var marshaledName = new MarshaledString(Name);
return LLVM.BuildSExt(this, Val, DestTy, marshaledName);
}
- public LLVMValueRef BuildSExtOrBitCast(LLVMValueRef Val, LLVMTypeRef DestTy, string Name = "") => BuildSExtOrBitCast(Val, DestTy, Name.AsSpan());
+ public readonly LLVMValueRef BuildSExtOrBitCast(LLVMValueRef Val, LLVMTypeRef DestTy, string Name = "") => BuildSExtOrBitCast(Val, DestTy, Name.AsSpan());
- public LLVMValueRef BuildSExtOrBitCast(LLVMValueRef Val, LLVMTypeRef DestTy, ReadOnlySpan Name)
+ public readonly LLVMValueRef BuildSExtOrBitCast(LLVMValueRef Val, LLVMTypeRef DestTy, ReadOnlySpan Name)
{
using var marshaledName = new MarshaledString(Name);
return LLVM.BuildSExtOrBitCast(this, Val, DestTy, marshaledName);
}
- public LLVMValueRef BuildShl(LLVMValueRef LHS, LLVMValueRef RHS, string Name = "") => BuildShl(LHS, RHS, Name.AsSpan());
+ public readonly LLVMValueRef BuildShl(LLVMValueRef LHS, LLVMValueRef RHS, string Name = "") => BuildShl(LHS, RHS, Name.AsSpan());
- public LLVMValueRef BuildShl(LLVMValueRef LHS, LLVMValueRef RHS, ReadOnlySpan Name)
+ public readonly LLVMValueRef BuildShl(LLVMValueRef LHS, LLVMValueRef RHS, ReadOnlySpan Name)
{
using var marshaledName = new MarshaledString(Name);
return LLVM.BuildShl(this, LHS, RHS, marshaledName);
}
- public LLVMValueRef BuildShuffleVector(LLVMValueRef V1, LLVMValueRef V2, LLVMValueRef Mask, string Name = "") => BuildShuffleVector(V1, V2, Mask, Name.AsSpan());
+ public readonly LLVMValueRef BuildShuffleVector(LLVMValueRef V1, LLVMValueRef V2, LLVMValueRef Mask, string Name = "") => BuildShuffleVector(V1, V2, Mask, Name.AsSpan());
- public LLVMValueRef BuildShuffleVector(LLVMValueRef V1, LLVMValueRef V2, LLVMValueRef Mask, ReadOnlySpan Name)
+ public readonly LLVMValueRef BuildShuffleVector(LLVMValueRef V1, LLVMValueRef V2, LLVMValueRef Mask, ReadOnlySpan Name)
{
using var marshaledName = new MarshaledString(Name);
return LLVM.BuildShuffleVector(this, V1, V2, Mask, marshaledName);
}
- public LLVMValueRef BuildSIToFP(LLVMValueRef Val, LLVMTypeRef DestTy, string Name = "") => BuildSIToFP(Val, DestTy, Name.AsSpan());
+ public readonly LLVMValueRef BuildSIToFP(LLVMValueRef Val, LLVMTypeRef DestTy, string Name = "") => BuildSIToFP(Val, DestTy, Name.AsSpan());
- public LLVMValueRef BuildSIToFP(LLVMValueRef Val, LLVMTypeRef DestTy, ReadOnlySpan Name)
+ public readonly LLVMValueRef BuildSIToFP(LLVMValueRef Val, LLVMTypeRef DestTy, ReadOnlySpan Name)
{
using var marshaledName = new MarshaledString(Name);
return LLVM.BuildSIToFP(this, Val, DestTy, marshaledName);
}
- public LLVMValueRef BuildSRem(LLVMValueRef LHS, LLVMValueRef RHS, string Name = "") => BuildSRem(LHS, RHS, Name.AsSpan());
+ public readonly LLVMValueRef BuildSRem(LLVMValueRef LHS, LLVMValueRef RHS, string Name = "") => BuildSRem(LHS, RHS, Name.AsSpan());
- public LLVMValueRef BuildSRem(LLVMValueRef LHS, LLVMValueRef RHS, ReadOnlySpan Name)
+ public readonly LLVMValueRef BuildSRem(LLVMValueRef LHS, LLVMValueRef RHS, ReadOnlySpan Name)
{
using var marshaledName = new MarshaledString(Name);
return LLVM.BuildSRem(this, LHS, RHS, marshaledName);
}
- public LLVMValueRef BuildStore(LLVMValueRef Val, LLVMValueRef Ptr) => LLVM.BuildStore(this, Val, Ptr);
+ public readonly LLVMValueRef BuildStore(LLVMValueRef Val, LLVMValueRef Ptr) => LLVM.BuildStore(this, Val, Ptr);
- public LLVMValueRef BuildStructGEP2(LLVMTypeRef Ty, LLVMValueRef Pointer, uint Idx, string Name = "") => BuildStructGEP2(Ty, Pointer, Idx, Name.AsSpan());
+ public readonly LLVMValueRef BuildStructGEP2(LLVMTypeRef Ty, LLVMValueRef Pointer, uint Idx, string Name = "") => BuildStructGEP2(Ty, Pointer, Idx, Name.AsSpan());
- public LLVMValueRef BuildStructGEP2(LLVMTypeRef Ty, LLVMValueRef Pointer, uint Idx, ReadOnlySpan Name)
+ public readonly LLVMValueRef BuildStructGEP2(LLVMTypeRef Ty, LLVMValueRef Pointer, uint Idx, ReadOnlySpan Name)
{
using var marshaledName = new MarshaledString(Name);
return LLVM.BuildStructGEP2(this, Ty, Pointer, Idx, marshaledName);
}
- public LLVMValueRef BuildSub(LLVMValueRef LHS, LLVMValueRef RHS, string Name = "") => BuildSub(LHS, RHS, Name.AsSpan());
+ public readonly LLVMValueRef BuildSub(LLVMValueRef LHS, LLVMValueRef RHS, string Name = "") => BuildSub(LHS, RHS, Name.AsSpan());
- public LLVMValueRef BuildSub(LLVMValueRef LHS, LLVMValueRef RHS, ReadOnlySpan Name)
+ public readonly LLVMValueRef BuildSub(LLVMValueRef LHS, LLVMValueRef RHS, ReadOnlySpan Name)
{
using var marshaledName = new MarshaledString(Name);
return LLVM.BuildSub(this, LHS, RHS, marshaledName);
}
- public LLVMValueRef BuildSwitch(LLVMValueRef V, LLVMBasicBlockRef Else, uint NumCases) => LLVM.BuildSwitch(this, V, Else, NumCases);
+ public readonly LLVMValueRef BuildSwitch(LLVMValueRef V, LLVMBasicBlockRef Else, uint NumCases) => LLVM.BuildSwitch(this, V, Else, NumCases);
- public LLVMValueRef BuildTrunc(LLVMValueRef Val, LLVMTypeRef DestTy, string Name = "") => BuildTrunc(Val, DestTy, Name.AsSpan());
+ public readonly LLVMValueRef BuildTrunc(LLVMValueRef Val, LLVMTypeRef DestTy, string Name = "") => BuildTrunc(Val, DestTy, Name.AsSpan());
- public LLVMValueRef BuildTrunc(LLVMValueRef Val, LLVMTypeRef DestTy, ReadOnlySpan Name)
+ public readonly LLVMValueRef BuildTrunc(LLVMValueRef Val, LLVMTypeRef DestTy, ReadOnlySpan Name)
{
using var marshaledName = new MarshaledString(Name);
return LLVM.BuildTrunc(this, Val, DestTy, marshaledName);
}
- public LLVMValueRef BuildTruncOrBitCast(LLVMValueRef Val, LLVMTypeRef DestTy, string Name = "") => BuildTruncOrBitCast(Val, DestTy, Name.AsSpan());
+ public readonly LLVMValueRef BuildTruncOrBitCast(LLVMValueRef Val, LLVMTypeRef DestTy, string Name = "") => BuildTruncOrBitCast(Val, DestTy, Name.AsSpan());
- public LLVMValueRef BuildTruncOrBitCast(LLVMValueRef Val, LLVMTypeRef DestTy, ReadOnlySpan Name)
+ public readonly LLVMValueRef BuildTruncOrBitCast(LLVMValueRef Val, LLVMTypeRef DestTy, ReadOnlySpan Name)
{
using var marshaledName = new MarshaledString(Name);
return LLVM.BuildTruncOrBitCast(this, Val, DestTy, marshaledName);
}
- public LLVMValueRef BuildUDiv(LLVMValueRef LHS, LLVMValueRef RHS, string Name = "") => BuildUDiv(LHS, RHS, Name.AsSpan());
+ public readonly LLVMValueRef BuildUDiv(LLVMValueRef LHS, LLVMValueRef RHS, string Name = "") => BuildUDiv(LHS, RHS, Name.AsSpan());
- public LLVMValueRef BuildUDiv(LLVMValueRef LHS, LLVMValueRef RHS, ReadOnlySpan Name)
+ public readonly LLVMValueRef BuildUDiv(LLVMValueRef LHS, LLVMValueRef RHS, ReadOnlySpan Name)
{
using var marshaledName = new MarshaledString(Name);
return LLVM.BuildUDiv(this, LHS, RHS, marshaledName);
}
- public LLVMValueRef BuildUIToFP(LLVMValueRef Val, LLVMTypeRef DestTy, string Name = "") => BuildUIToFP(Val, DestTy, Name.AsSpan());
+ public readonly LLVMValueRef BuildUIToFP(LLVMValueRef Val, LLVMTypeRef DestTy, string Name = "") => BuildUIToFP(Val, DestTy, Name.AsSpan());
- public LLVMValueRef BuildUIToFP(LLVMValueRef Val, LLVMTypeRef DestTy, ReadOnlySpan Name)
+ public readonly LLVMValueRef BuildUIToFP(LLVMValueRef Val, LLVMTypeRef DestTy, ReadOnlySpan Name)
{
using var marshaledName = new MarshaledString(Name);
return LLVM.BuildUIToFP(this, Val, DestTy, marshaledName);
}
- public LLVMValueRef BuildUnreachable() => LLVM.BuildUnreachable(this);
+ public readonly LLVMValueRef BuildUnreachable() => LLVM.BuildUnreachable(this);
- public LLVMValueRef BuildURem(LLVMValueRef LHS, LLVMValueRef RHS, string Name = "") => BuildURem(LHS, RHS, Name.AsSpan());
+ public readonly LLVMValueRef BuildURem(LLVMValueRef LHS, LLVMValueRef RHS, string Name = "") => BuildURem(LHS, RHS, Name.AsSpan());
- public LLVMValueRef BuildURem(LLVMValueRef LHS, LLVMValueRef RHS, ReadOnlySpan Name)
+ public readonly LLVMValueRef BuildURem(LLVMValueRef LHS, LLVMValueRef RHS, ReadOnlySpan Name)
{
using var marshaledName = new MarshaledString(Name);
return LLVM.BuildURem(this, LHS, RHS, marshaledName);
}
- public LLVMValueRef BuildVAArg(LLVMValueRef List, LLVMTypeRef Ty, string Name = "") => BuildVAArg(List, Ty, Name.AsSpan());
+ public readonly LLVMValueRef BuildVAArg(LLVMValueRef List, LLVMTypeRef Ty, string Name = "") => BuildVAArg(List, Ty, Name.AsSpan());
- public LLVMValueRef BuildVAArg(LLVMValueRef List, LLVMTypeRef Ty, ReadOnlySpan Name)
+ public readonly LLVMValueRef BuildVAArg(LLVMValueRef List, LLVMTypeRef Ty, ReadOnlySpan Name)
{
using var marshaledName = new MarshaledString(Name);
return LLVM.BuildVAArg(this, List, Ty, marshaledName);
}
- public LLVMValueRef BuildXor(LLVMValueRef LHS, LLVMValueRef RHS, string Name = "") => BuildXor(LHS, RHS, Name.AsSpan());
+ public readonly LLVMValueRef BuildXor(LLVMValueRef LHS, LLVMValueRef RHS, string Name = "") => BuildXor(LHS, RHS, Name.AsSpan());
- public LLVMValueRef BuildXor(LLVMValueRef LHS, LLVMValueRef RHS, ReadOnlySpan Name)
+ public readonly LLVMValueRef BuildXor(LLVMValueRef LHS, LLVMValueRef RHS, ReadOnlySpan Name)
{
using var marshaledName = new MarshaledString(Name);
return LLVM.BuildXor(this, LHS, RHS, marshaledName);
}
- public LLVMValueRef BuildZExt(LLVMValueRef Val, LLVMTypeRef DestTy, string Name = "") => BuildZExt(Val, DestTy, Name.AsSpan());
+ public readonly LLVMValueRef BuildZExt(LLVMValueRef Val, LLVMTypeRef DestTy, string Name = "") => BuildZExt(Val, DestTy, Name.AsSpan());
- public LLVMValueRef BuildZExt(LLVMValueRef Val, LLVMTypeRef DestTy, ReadOnlySpan Name)
+ public readonly LLVMValueRef BuildZExt(LLVMValueRef Val, LLVMTypeRef DestTy, ReadOnlySpan Name)
{
using var marshaledName = new MarshaledString(Name);
return LLVM.BuildZExt(this, Val, DestTy, marshaledName);
}
- public LLVMValueRef BuildZExtOrBitCast(LLVMValueRef Val, LLVMTypeRef DestTy, string Name = "") => BuildZExtOrBitCast(Val, DestTy, Name.AsSpan());
+ public readonly LLVMValueRef BuildZExtOrBitCast(LLVMValueRef Val, LLVMTypeRef DestTy, string Name = "") => BuildZExtOrBitCast(Val, DestTy, Name.AsSpan());
- public LLVMValueRef BuildZExtOrBitCast(LLVMValueRef Val, LLVMTypeRef DestTy, ReadOnlySpan Name)
+ public readonly LLVMValueRef BuildZExtOrBitCast(LLVMValueRef Val, LLVMTypeRef DestTy, ReadOnlySpan Name)
{
using var marshaledName = new MarshaledString(Name);
return LLVM.BuildZExtOrBitCast(this, Val, DestTy, marshaledName);
}
- public void ClearInsertionPosition() => LLVM.ClearInsertionPosition(this);
+ public readonly void ClearInsertionPosition() => LLVM.ClearInsertionPosition(this);
public void Dispose()
{
@@ -726,29 +721,29 @@ public void Dispose()
}
}
- public override bool Equals(object? obj) => (obj is LLVMBuilderRef other) && Equals(other);
+ public override readonly bool Equals(object? obj) => (obj is LLVMBuilderRef other) && Equals(other);
- public bool Equals(LLVMBuilderRef other) => this == other;
+ public readonly bool Equals(LLVMBuilderRef other) => this == other;
- public override int GetHashCode() => Handle.GetHashCode();
+ public override readonly int GetHashCode() => Handle.GetHashCode();
- public void Insert(LLVMValueRef Instr) => LLVM.InsertIntoBuilder(this, Instr);
+ public readonly void Insert(LLVMValueRef Instr) => LLVM.InsertIntoBuilder(this, Instr);
- public void InsertWithName(LLVMValueRef Instr, string Name = "") => InsertWithName(Instr, Name.AsSpan());
+ public readonly void InsertWithName(LLVMValueRef Instr, string Name = "") => InsertWithName(Instr, Name.AsSpan());
- public void InsertWithName(LLVMValueRef Instr, ReadOnlySpan Name)
+ public readonly void InsertWithName(LLVMValueRef Instr, ReadOnlySpan Name)
{
using var marshaledName = new MarshaledString(Name);
LLVM.InsertIntoBuilderWithName(this, Instr, marshaledName);
}
- public void Position(LLVMBasicBlockRef Block, LLVMValueRef Instr) => LLVM.PositionBuilder(this, Block, Instr);
+ public readonly void Position(LLVMBasicBlockRef Block, LLVMValueRef Instr) => LLVM.PositionBuilder(this, Block, Instr);
- public void PositionAtEnd(LLVMBasicBlockRef Block) => LLVM.PositionBuilderAtEnd(this, Block);
+ public readonly void PositionAtEnd(LLVMBasicBlockRef Block) => LLVM.PositionBuilderAtEnd(this, Block);
- public void PositionBefore(LLVMValueRef Instr) => LLVM.PositionBuilderBefore(this, Instr);
+ public readonly void PositionBefore(LLVMValueRef Instr) => LLVM.PositionBuilderBefore(this, Instr);
- public void SetInstDebugLocation(LLVMValueRef Inst) => LLVM.SetInstDebugLocation(this, Inst);
+ public readonly void SetInstDebugLocation(LLVMValueRef Inst) => LLVM.SetInstDebugLocation(this, Inst);
- public override string ToString() => $"{nameof(LLVMBuilderRef)}: {Handle:X}";
+ public override readonly string ToString() => $"{nameof(LLVMBuilderRef)}: {Handle:X}";
}
diff --git a/sources/LLVMSharp.Interop/Extensions/LLVMComdatRef.cs b/sources/LLVMSharp.Interop/Extensions/LLVMComdatRef.cs
index f3d40b0c..03ffce21 100644
--- a/sources/LLVMSharp.Interop/Extensions/LLVMComdatRef.cs
+++ b/sources/LLVMSharp.Interop/Extensions/LLVMComdatRef.cs
@@ -4,14 +4,9 @@
namespace LLVMSharp.Interop;
-public unsafe partial struct LLVMComdatRef : IEquatable
+public unsafe partial struct LLVMComdatRef(IntPtr handle) : IEquatable
{
- public IntPtr Handle;
-
- public LLVMComdatRef(IntPtr handle)
- {
- Handle = handle;
- }
+ public IntPtr Handle = handle;
public static implicit operator LLVMComdatRef(LLVMComdat* Comdat) => new LLVMComdatRef((IntPtr)Comdat);
@@ -21,11 +16,11 @@ public LLVMComdatRef(IntPtr handle)
public static bool operator !=(LLVMComdatRef left, LLVMComdatRef right) => !(left == right);
- public override bool Equals(object? obj) => (obj is LLVMComdatRef other) && Equals(other);
+ public override readonly bool Equals(object? obj) => (obj is LLVMComdatRef other) && Equals(other);
- public bool Equals(LLVMComdatRef other) => this == other;
+ public readonly bool Equals(LLVMComdatRef other) => this == other;
- public override int GetHashCode() => Handle.GetHashCode();
+ public override readonly int GetHashCode() => Handle.GetHashCode();
- public override string ToString() => $"{nameof(LLVMComdatRef)}: {Handle:X}";
+ public override readonly string ToString() => $"{nameof(LLVMComdatRef)}: {Handle:X}";
}
diff --git a/sources/LLVMSharp.Interop/Extensions/LLVMContextRef.cs b/sources/LLVMSharp.Interop/Extensions/LLVMContextRef.cs
index a8904bb8..103a7235 100644
--- a/sources/LLVMSharp.Interop/Extensions/LLVMContextRef.cs
+++ b/sources/LLVMSharp.Interop/Extensions/LLVMContextRef.cs
@@ -5,48 +5,43 @@
namespace LLVMSharp.Interop;
-public unsafe partial struct LLVMContextRef : IDisposable, IEquatable
+public unsafe partial struct LLVMContextRef(IntPtr handle) : IDisposable, IEquatable
{
- public IntPtr Handle;
-
- public LLVMContextRef(IntPtr handle)
- {
- Handle = handle;
- }
+ public IntPtr Handle = handle;
public static LLVMContextRef Global => LLVM.GetGlobalContext();
- public LLVMTypeRef BFloatType => (Handle != IntPtr.Zero) ? LLVM.BFloatTypeInContext(this) : default;
+ public readonly LLVMTypeRef BFloatType => (Handle != IntPtr.Zero) ? LLVM.BFloatTypeInContext(this) : default;
- public LLVMTypeRef DoubleType => (Handle != IntPtr.Zero) ? LLVM.DoubleTypeInContext(this) : default;
+ public readonly LLVMTypeRef DoubleType => (Handle != IntPtr.Zero) ? LLVM.DoubleTypeInContext(this) : default;
- public LLVMTypeRef FloatType => (Handle != IntPtr.Zero) ? LLVM.FloatTypeInContext(this) : default;
+ public readonly LLVMTypeRef FloatType => (Handle != IntPtr.Zero) ? LLVM.FloatTypeInContext(this) : default;
- public LLVMTypeRef HalfType => (Handle != IntPtr.Zero) ? LLVM.HalfTypeInContext(this) : default;
+ public readonly LLVMTypeRef HalfType => (Handle != IntPtr.Zero) ? LLVM.HalfTypeInContext(this) : default;
- public LLVMTypeRef Int1Type => (Handle != IntPtr.Zero) ? LLVM.Int1TypeInContext(this) : default;
+ public readonly LLVMTypeRef Int1Type => (Handle != IntPtr.Zero) ? LLVM.Int1TypeInContext(this) : default;
- public LLVMTypeRef Int8Type => (Handle != IntPtr.Zero) ? LLVM.Int8TypeInContext(this) : default;
+ public readonly LLVMTypeRef Int8Type => (Handle != IntPtr.Zero) ? LLVM.Int8TypeInContext(this) : default;
- public LLVMTypeRef Int16Type => (Handle != IntPtr.Zero) ? LLVM.Int16TypeInContext(this) : default;
+ public readonly LLVMTypeRef Int16Type => (Handle != IntPtr.Zero) ? LLVM.Int16TypeInContext(this) : default;
- public LLVMTypeRef Int32Type => (Handle != IntPtr.Zero) ? LLVM.Int32TypeInContext(this) : default;
+ public readonly LLVMTypeRef Int32Type => (Handle != IntPtr.Zero) ? LLVM.Int32TypeInContext(this) : default;
- public LLVMTypeRef Int64Type => (Handle != IntPtr.Zero) ? LLVM.Int64TypeInContext(this) : default;
+ public readonly LLVMTypeRef Int64Type => (Handle != IntPtr.Zero) ? LLVM.Int64TypeInContext(this) : default;
- public LLVMTypeRef FP128Type => (Handle != IntPtr.Zero) ? LLVM.FP128TypeInContext(this) : default;
+ public readonly LLVMTypeRef FP128Type => (Handle != IntPtr.Zero) ? LLVM.FP128TypeInContext(this) : default;
- public LLVMTypeRef LabelType => (Handle != IntPtr.Zero) ? LLVM.LabelTypeInContext(this) : default;
+ public readonly LLVMTypeRef LabelType => (Handle != IntPtr.Zero) ? LLVM.LabelTypeInContext(this) : default;
- public LLVMTypeRef PPCFP128Type => (Handle != IntPtr.Zero) ? LLVM.PPCFP128TypeInContext(this) : default;
+ public readonly LLVMTypeRef PPCFP128Type => (Handle != IntPtr.Zero) ? LLVM.PPCFP128TypeInContext(this) : default;
- public LLVMTypeRef VoidType => (Handle != IntPtr.Zero) ? LLVM.VoidTypeInContext(this) : default;
+ public readonly LLVMTypeRef VoidType => (Handle != IntPtr.Zero) ? LLVM.VoidTypeInContext(this) : default;
- public LLVMTypeRef X86FP80Type => (Handle != IntPtr.Zero) ? LLVM.X86FP80TypeInContext(this) : default;
+ public readonly LLVMTypeRef X86FP80Type => (Handle != IntPtr.Zero) ? LLVM.X86FP80TypeInContext(this) : default;
- public LLVMTypeRef X86MMXType => (Handle != IntPtr.Zero) ? LLVM.X86MMXTypeInContext(this) : default;
+ public readonly LLVMTypeRef X86MMXType => (Handle != IntPtr.Zero) ? LLVM.X86MMXTypeInContext(this) : default;
- public LLVMTypeRef X86AMXType => (Handle != IntPtr.Zero) ? LLVM.X86AMXTypeInContext(this) : default;
+ public readonly LLVMTypeRef X86AMXType => (Handle != IntPtr.Zero) ? LLVM.X86AMXTypeInContext(this) : default;
public static implicit operator LLVMContextRef(LLVMOpaqueContext* value) => new LLVMContextRef((IntPtr)value);
@@ -58,35 +53,35 @@ public LLVMContextRef(IntPtr handle)
public static LLVMContextRef Create() => LLVM.ContextCreate();
- public LLVMBasicBlockRef AppendBasicBlock(LLVMValueRef Fn, string Name) => AppendBasicBlock(Fn, Name.AsSpan());
+ public readonly LLVMBasicBlockRef AppendBasicBlock(LLVMValueRef Fn, string Name) => AppendBasicBlock(Fn, Name.AsSpan());
- public LLVMBasicBlockRef AppendBasicBlock(LLVMValueRef Fn, ReadOnlySpan Name) => LLVMBasicBlockRef.AppendInContext(this, Fn, Name);
+ public readonly LLVMBasicBlockRef AppendBasicBlock(LLVMValueRef Fn, ReadOnlySpan Name) => LLVMBasicBlockRef.AppendInContext(this, Fn, Name);
- public LLVMBasicBlockRef CreateBasicBlock(string Name) => CreateBasicBlock(Name.AsSpan());
+ public readonly LLVMBasicBlockRef CreateBasicBlock(string Name) => CreateBasicBlock(Name.AsSpan());
- public LLVMBasicBlockRef CreateBasicBlock(ReadOnlySpan Name) => LLVMBasicBlockRef.CreateInContext(this, Name);
+ public readonly LLVMBasicBlockRef CreateBasicBlock(ReadOnlySpan Name) => LLVMBasicBlockRef.CreateInContext(this, Name);
- public LLVMBuilderRef CreateBuilder() => LLVMBuilderRef.Create(this);
+ public readonly LLVMBuilderRef CreateBuilder() => LLVMBuilderRef.Create(this);
- public LLVMMetadataRef CreateDebugLocation(uint Line, uint Column, LLVMMetadataRef Scope, LLVMMetadataRef InlinedAt) => LLVM.DIBuilderCreateDebugLocation(this, Line, Column, Scope, InlinedAt);
+ public readonly LLVMMetadataRef CreateDebugLocation(uint Line, uint Column, LLVMMetadataRef Scope, LLVMMetadataRef InlinedAt) => LLVM.DIBuilderCreateDebugLocation(this, Line, Column, Scope, InlinedAt);
- public LLVMModuleRef CreateModuleWithName(string ModuleID) => CreateModuleWithName(ModuleID.AsSpan());
+ public readonly LLVMModuleRef CreateModuleWithName(string ModuleID) => CreateModuleWithName(ModuleID.AsSpan());
- public LLVMModuleRef CreateModuleWithName(ReadOnlySpan ModuleID)
+ public readonly LLVMModuleRef CreateModuleWithName(ReadOnlySpan ModuleID)
{
using var marshaledModuleID = new MarshaledString(ModuleID);
return LLVM.ModuleCreateWithNameInContext(marshaledModuleID, this);
}
- public LLVMTypeRef CreateNamedStruct(string Name) => CreateNamedStruct(Name.AsSpan());
+ public readonly LLVMTypeRef CreateNamedStruct(string Name) => CreateNamedStruct(Name.AsSpan());
- public LLVMTypeRef CreateNamedStruct(ReadOnlySpan Name)
+ public readonly LLVMTypeRef CreateNamedStruct(ReadOnlySpan Name)
{
using var marshaledName = new MarshaledString(Name);
return LLVM.StructCreateNamed(this, marshaledName);
}
- public LLVMAttributeRef CreateEnumAttribute(uint KindId, ulong Val)
+ public readonly LLVMAttributeRef CreateEnumAttribute(uint KindId, ulong Val)
{
return LLVM.CreateEnumAttribute(this, KindId, Val);
}
@@ -100,11 +95,11 @@ public void Dispose()
}
}
- public override bool Equals(object? obj) => (obj is LLVMContextRef other) && Equals(other);
+ public override readonly bool Equals(object? obj) => (obj is LLVMContextRef other) && Equals(other);
- public bool Equals(LLVMContextRef other) => this == other;
+ public readonly bool Equals(LLVMContextRef other) => this == other;
- public LLVMModuleRef GetBitcodeModule(LLVMMemoryBufferRef MemBuf)
+ public readonly LLVMModuleRef GetBitcodeModule(LLVMMemoryBufferRef MemBuf)
{
if (!TryGetBitcodeModule(MemBuf, out LLVMModuleRef M, out string Message))
{
@@ -114,17 +109,17 @@ public LLVMModuleRef GetBitcodeModule(LLVMMemoryBufferRef MemBuf)
return M;
}
- public LLVMValueRef GetConstString(string Str, bool DontNullTerminate) => GetConstString(Str.AsSpan(), DontNullTerminate);
+ public readonly LLVMValueRef GetConstString(string Str, bool DontNullTerminate) => GetConstString(Str.AsSpan(), DontNullTerminate);
- public LLVMValueRef GetConstString(ReadOnlySpan Str, bool DontNullTerminate)
+ public readonly LLVMValueRef GetConstString(ReadOnlySpan Str, bool DontNullTerminate)
{
using var marshaledStr = new MarshaledString(Str);
return LLVM.ConstStringInContext(this, marshaledStr, (uint)marshaledStr.Length, DontNullTerminate ? 1 : 0);
}
- public LLVMValueRef GetConstStruct(LLVMValueRef[] ConstantVals, bool Packed) => GetConstStruct(ConstantVals.AsSpan(), Packed);
+ public readonly LLVMValueRef GetConstStruct(LLVMValueRef[] ConstantVals, bool Packed) => GetConstStruct(ConstantVals.AsSpan(), Packed);
- public LLVMValueRef GetConstStruct(ReadOnlySpan ConstantVals, bool Packed)
+ public readonly LLVMValueRef GetConstStruct(ReadOnlySpan ConstantVals, bool Packed)
{
fixed (LLVMValueRef* pConstantVals = ConstantVals)
{
@@ -132,25 +127,25 @@ public LLVMValueRef GetConstStruct(ReadOnlySpan ConstantVals, bool
}
}
- public override int GetHashCode() => Handle.GetHashCode();
+ public override readonly int GetHashCode() => Handle.GetHashCode();
- public LLVMTypeRef GetIntPtrType(LLVMTargetDataRef TD) => LLVM.IntPtrTypeInContext(this, TD);
+ public readonly LLVMTypeRef GetIntPtrType(LLVMTargetDataRef TD) => LLVM.IntPtrTypeInContext(this, TD);
- public LLVMTypeRef GetIntPtrTypeForAS(LLVMTargetDataRef TD, uint AS) => LLVM.IntPtrTypeForASInContext(this, TD, AS);
+ public readonly LLVMTypeRef GetIntPtrTypeForAS(LLVMTargetDataRef TD, uint AS) => LLVM.IntPtrTypeForASInContext(this, TD, AS);
- public LLVMTypeRef GetIntType(uint NumBits) => LLVM.IntTypeInContext(this, NumBits);
+ public readonly LLVMTypeRef GetIntType(uint NumBits) => LLVM.IntTypeInContext(this, NumBits);
- public uint GetMDKindID(string Name, uint SLen) => GetMDKindID(Name.AsSpan(0, (int)SLen));
+ public readonly uint GetMDKindID(string Name, uint SLen) => GetMDKindID(Name.AsSpan(0, (int)SLen));
- public uint GetMDKindID(ReadOnlySpan Name)
+ public readonly uint GetMDKindID(ReadOnlySpan Name)
{
using var marshaledName = new MarshaledString(Name);
return LLVM.GetMDKindIDInContext(this, marshaledName, (uint)marshaledName.Length);
}
- public LLVMValueRef GetMDNode(LLVMValueRef[] Vals) => GetMDNode(Vals.AsSpan());
+ public readonly LLVMValueRef GetMDNode(LLVMValueRef[] Vals) => GetMDNode(Vals.AsSpan());
- public LLVMValueRef GetMDNode(ReadOnlySpan Vals)
+ public readonly LLVMValueRef GetMDNode(ReadOnlySpan Vals)
{
fixed (LLVMValueRef* pVals = Vals)
{
@@ -158,17 +153,17 @@ public LLVMValueRef GetMDNode(ReadOnlySpan Vals)
}
}
- public LLVMValueRef GetMDString(string Str, uint SLen) => GetMDString(Str.AsSpan(0, (int)SLen));
+ public readonly LLVMValueRef GetMDString(string Str, uint SLen) => GetMDString(Str.AsSpan(0, (int)SLen));
- public LLVMValueRef GetMDString(ReadOnlySpan Str)
+ public readonly LLVMValueRef GetMDString(ReadOnlySpan Str)
{
using var marshaledStr = new MarshaledString(Str);
return LLVM.MDStringInContext(this, marshaledStr, (uint)marshaledStr.Length);
}
- public LLVMTypeRef GetStructType(LLVMTypeRef[] ElementTypes, bool Packed) => GetStructType(ElementTypes.AsSpan(), Packed);
+ public readonly LLVMTypeRef GetStructType(LLVMTypeRef[] ElementTypes, bool Packed) => GetStructType(ElementTypes.AsSpan(), Packed);
- public LLVMTypeRef GetStructType(ReadOnlySpan ElementTypes, bool Packed)
+ public readonly LLVMTypeRef GetStructType(ReadOnlySpan ElementTypes, bool Packed)
{
fixed (LLVMTypeRef* pElementTypes = ElementTypes)
{
@@ -176,11 +171,11 @@ public LLVMTypeRef GetStructType(ReadOnlySpan ElementTypes, bool Pa
}
}
- public LLVMBasicBlockRef InsertBasicBlock(LLVMBasicBlockRef BB, string Name) => LLVMBasicBlockRef.InsertInContext(this, BB, Name);
+ public readonly LLVMBasicBlockRef InsertBasicBlock(LLVMBasicBlockRef BB, string Name) => LLVMBasicBlockRef.InsertInContext(this, BB, Name);
- public LLVMValueRef MetadataAsValue(LLVMMetadataRef MD) => LLVM.MetadataAsValue(this, MD);
+ public readonly LLVMValueRef MetadataAsValue(LLVMMetadataRef MD) => LLVM.MetadataAsValue(this, MD);
- public LLVMModuleRef ParseBitcode(LLVMMemoryBufferRef MemBuf)
+ public readonly LLVMModuleRef ParseBitcode(LLVMMemoryBufferRef MemBuf)
{
if (!TryParseBitcode(MemBuf, out LLVMModuleRef M, out string Message))
{
@@ -190,7 +185,7 @@ public LLVMModuleRef ParseBitcode(LLVMMemoryBufferRef MemBuf)
return M;
}
- public LLVMModuleRef ParseIR(LLVMMemoryBufferRef MemBuf)
+ public readonly LLVMModuleRef ParseIR(LLVMMemoryBufferRef MemBuf)
{
if (!TryParseIR(MemBuf, out LLVMModuleRef M, out string Message))
{
@@ -200,31 +195,31 @@ public LLVMModuleRef ParseIR(LLVMMemoryBufferRef MemBuf)
return M;
}
- public void SetDiagnosticHandler(LLVMDiagnosticHandler Handler, void* DiagnosticContext)
+ public readonly void SetDiagnosticHandler(LLVMDiagnosticHandler Handler, void* DiagnosticContext)
{
var pHandler = (delegate* unmanaged[Cdecl] < LLVMOpaqueDiagnosticInfo *, void *, void > )Marshal.GetFunctionPointerForDelegate(Handler);
SetDiagnosticHandler(pHandler, DiagnosticContext);
}
- public void SetDiagnosticHandler(delegate* unmanaged[Cdecl] Handler, void* DiagnosticContext)
+ public readonly void SetDiagnosticHandler(delegate* unmanaged[Cdecl] Handler, void* DiagnosticContext)
{
LLVM.ContextSetDiagnosticHandler(this, Handler, DiagnosticContext);
}
- public void SetYieldCallback(LLVMYieldCallback Callback, void* OpaqueHandle)
+ public readonly void SetYieldCallback(LLVMYieldCallback Callback, void* OpaqueHandle)
{
var pCallback = (delegate* unmanaged[Cdecl] < LLVMOpaqueContext *, void *, void>)Marshal.GetFunctionPointerForDelegate(Callback);
SetYieldCallback(pCallback, OpaqueHandle);
}
- public void SetYieldCallback(delegate* unmanaged[Cdecl] Callback, void* OpaqueHandle)
+ public readonly void SetYieldCallback(delegate* unmanaged[Cdecl] Callback, void* OpaqueHandle)
{
LLVM.ContextSetYieldCallback(this, Callback, OpaqueHandle);
}
- public override string ToString() => $"{nameof(LLVMContextRef)}: {Handle:X}";
+ public override readonly string ToString() => $"{nameof(LLVMContextRef)}: {Handle:X}";
- public bool TryGetBitcodeModule(LLVMMemoryBufferRef MemBuf, out LLVMModuleRef OutM, out string OutMessage)
+ public readonly bool TryGetBitcodeModule(LLVMMemoryBufferRef MemBuf, out LLVMModuleRef OutM, out string OutMessage)
{
fixed (LLVMModuleRef* pOutM = &OutM)
{
@@ -244,7 +239,7 @@ public bool TryGetBitcodeModule(LLVMMemoryBufferRef MemBuf, out LLVMModuleRef Ou
}
}
- public bool TryParseBitcode(LLVMMemoryBufferRef MemBuf, out LLVMModuleRef OutModule, out string OutMessage)
+ public readonly bool TryParseBitcode(LLVMMemoryBufferRef MemBuf, out LLVMModuleRef OutModule, out string OutMessage)
{
fixed (LLVMModuleRef* pOutModule = &OutModule)
{
@@ -264,7 +259,7 @@ public bool TryParseBitcode(LLVMMemoryBufferRef MemBuf, out LLVMModuleRef OutMod
}
}
- public bool TryParseIR(LLVMMemoryBufferRef MemBuf, out LLVMModuleRef OutM, out string OutMessage)
+ public readonly bool TryParseIR(LLVMMemoryBufferRef MemBuf, out LLVMModuleRef OutM, out string OutMessage)
{
fixed (LLVMModuleRef* pOutM = &OutM)
{
diff --git a/sources/LLVMSharp.Interop/Extensions/LLVMDIBuilderRef.cs b/sources/LLVMSharp.Interop/Extensions/LLVMDIBuilderRef.cs
index bd8ed21c..c4f2413a 100644
--- a/sources/LLVMSharp.Interop/Extensions/LLVMDIBuilderRef.cs
+++ b/sources/LLVMSharp.Interop/Extensions/LLVMDIBuilderRef.cs
@@ -4,14 +4,9 @@
namespace LLVMSharp.Interop;
-public unsafe partial struct LLVMDIBuilderRef : IEquatable
+public unsafe partial struct LLVMDIBuilderRef(IntPtr handle) : IEquatable
{
- public IntPtr Handle;
-
- public LLVMDIBuilderRef(IntPtr handle)
- {
- Handle = handle;
- }
+ public IntPtr Handle = handle;
public static implicit operator LLVMDIBuilderRef(LLVMOpaqueDIBuilder* value) => new LLVMDIBuilderRef((IntPtr)value);
@@ -21,10 +16,10 @@ public LLVMDIBuilderRef(IntPtr handle)
public static bool operator !=(LLVMDIBuilderRef left, LLVMDIBuilderRef right) => !(left == right);
- public LLVMMetadataRef CreateCompileUnit(LLVMDWARFSourceLanguage SourceLanguage, LLVMMetadataRef FileMetadata, string Producer, int IsOptimized, string Flags, uint RuntimeVersion,
+ public readonly LLVMMetadataRef CreateCompileUnit(LLVMDWARFSourceLanguage SourceLanguage, LLVMMetadataRef FileMetadata, string Producer, int IsOptimized, string Flags, uint RuntimeVersion,
string SplitName, LLVMDWARFEmissionKind DwarfEmissionKind, uint DWOld, int SplitDebugInlining, int DebugInfoForProfiling, string SysRoot, string SDK) => CreateCompileUnit(SourceLanguage, FileMetadata, Producer.AsSpan(), IsOptimized, Flags.AsSpan(), RuntimeVersion, SplitName.AsSpan(), DwarfEmissionKind, DWOld, SplitDebugInlining, DebugInfoForProfiling, SysRoot.AsSpan(), SDK.AsSpan());
- public LLVMMetadataRef CreateCompileUnit(LLVMDWARFSourceLanguage SourceLanguage, LLVMMetadataRef FileMetadata, ReadOnlySpan Producer, int IsOptimized, ReadOnlySpan Flags, uint RuntimeVersion,
+ public readonly LLVMMetadataRef CreateCompileUnit(LLVMDWARFSourceLanguage SourceLanguage, LLVMMetadataRef FileMetadata, ReadOnlySpan Producer, int IsOptimized, ReadOnlySpan Flags, uint RuntimeVersion,
ReadOnlySpan SplitName, LLVMDWARFEmissionKind DwarfEmissionKind, uint DWOld, int SplitDebugInlining, int DebugInfoForProfiling, ReadOnlySpan SysRoot, ReadOnlySpan SDK)
{
using var marshaledProducer= new MarshaledString(Producer);
@@ -37,19 +32,19 @@ public LLVMMetadataRef CreateCompileUnit(LLVMDWARFSourceLanguage SourceLanguage,
RuntimeVersion, marshaledSplitNameFlags, (UIntPtr)marshaledSplitNameFlags.Length, DwarfEmissionKind, DWOld, SplitDebugInlining, DebugInfoForProfiling, marshaledSysRoot, (UIntPtr)marshaledSysRoot.Length, marshaledSDK, (UIntPtr)marshaledSDK.Length);
}
- public LLVMMetadataRef CreateFile(string FullPath, string Directory) => CreateFile(FullPath.AsSpan(), Directory.AsSpan());
+ public readonly LLVMMetadataRef CreateFile(string FullPath, string Directory) => CreateFile(FullPath.AsSpan(), Directory.AsSpan());
- public LLVMMetadataRef CreateFile(ReadOnlySpan FullPath, ReadOnlySpan Directory)
+ public readonly LLVMMetadataRef CreateFile(ReadOnlySpan FullPath, ReadOnlySpan Directory)
{
using var marshaledFullPath = new MarshaledString(FullPath);
using var marshaledDirectory = new MarshaledString(Directory);
return LLVM.DIBuilderCreateFile(this, marshaledFullPath, (UIntPtr)marshaledFullPath.Length, marshaledDirectory, (UIntPtr)marshaledDirectory.Length);
}
- public LLVMMetadataRef CreateFunction(LLVMMetadataRef Scope, string Name, string LinkageName, LLVMMetadataRef File, uint LineNo, LLVMMetadataRef Type, int IsLocalToUnit, int IsDefinition,
+ public readonly LLVMMetadataRef CreateFunction(LLVMMetadataRef Scope, string Name, string LinkageName, LLVMMetadataRef File, uint LineNo, LLVMMetadataRef Type, int IsLocalToUnit, int IsDefinition,
uint ScopeLine, LLVMDIFlags Flags, int IsOptimized) => CreateFunction(Scope, Name.AsSpan(), LinkageName.AsSpan(), File, LineNo, Type, IsLocalToUnit, IsDefinition, ScopeLine, Flags, IsOptimized);
- public LLVMMetadataRef CreateFunction(LLVMMetadataRef Scope, ReadOnlySpan Name, ReadOnlySpan LinkageName, LLVMMetadataRef File, uint LineNo, LLVMMetadataRef Type, int IsLocalToUnit, int IsDefinition,
+ public readonly LLVMMetadataRef CreateFunction(LLVMMetadataRef Scope, ReadOnlySpan Name, ReadOnlySpan LinkageName, LLVMMetadataRef File, uint LineNo, LLVMMetadataRef Type, int IsLocalToUnit, int IsDefinition,
uint ScopeLine, LLVMDIFlags Flags, int IsOptimized)
{
using var marshaledName = new MarshaledString(Name);
@@ -61,9 +56,9 @@ public LLVMMetadataRef CreateFunction(LLVMMetadataRef Scope, ReadOnlySpan
LineNo, Type, IsLocalToUnit, IsDefinition, ScopeLine, Flags, IsOptimized);
}
- public LLVMMetadataRef CreateMacro(LLVMMetadataRef ParentMacroFile, uint Line, LLVMDWARFMacinfoRecordType RecordType, string Name, string Value) => CreateMacro(ParentMacroFile, Line, RecordType, Name.AsSpan(), Value.AsSpan());
+ public readonly LLVMMetadataRef CreateMacro(LLVMMetadataRef ParentMacroFile, uint Line, LLVMDWARFMacinfoRecordType RecordType, string Name, string Value) => CreateMacro(ParentMacroFile, Line, RecordType, Name.AsSpan(), Value.AsSpan());
- public LLVMMetadataRef CreateMacro(LLVMMetadataRef ParentMacroFile, uint Line, LLVMDWARFMacinfoRecordType RecordType, ReadOnlySpan Name, ReadOnlySpan Value)
+ public readonly LLVMMetadataRef CreateMacro(LLVMMetadataRef ParentMacroFile, uint Line, LLVMDWARFMacinfoRecordType RecordType, ReadOnlySpan Name, ReadOnlySpan Value)
{
using var marshaledName = new MarshaledString(Name);
using var marshaledValue = new MarshaledString(Value);
@@ -73,9 +68,9 @@ public LLVMMetadataRef CreateMacro(LLVMMetadataRef ParentMacroFile, uint Line, L
return LLVM.DIBuilderCreateMacro(this, ParentMacroFile, Line, RecordType, marshaledName, (UIntPtr)nameLength, marshaledValue, (UIntPtr)valueLength);
}
- public LLVMMetadataRef CreateModule(LLVMMetadataRef ParentScope, string Name, string ConfigMacros, string IncludePath, string SysRoot) => CreateModule(ParentScope, Name.AsSpan(), ConfigMacros.AsSpan(), IncludePath.AsSpan(), SysRoot.AsSpan());
+ public readonly LLVMMetadataRef CreateModule(LLVMMetadataRef ParentScope, string Name, string ConfigMacros, string IncludePath, string SysRoot) => CreateModule(ParentScope, Name.AsSpan(), ConfigMacros.AsSpan(), IncludePath.AsSpan(), SysRoot.AsSpan());
- public LLVMMetadataRef CreateModule(LLVMMetadataRef ParentScope, ReadOnlySpan Name, ReadOnlySpan ConfigMacros, ReadOnlySpan IncludePath, ReadOnlySpan SysRoot)
+ public readonly LLVMMetadataRef CreateModule(LLVMMetadataRef ParentScope, ReadOnlySpan Name, ReadOnlySpan ConfigMacros, ReadOnlySpan IncludePath, ReadOnlySpan