Update QIR generation to LLVM 13, add multiplatform CI validation (#1329)
* Rework LlvmBindings to use custom interop, LLVM 13 (#1301) * Rework LlvmBindings to use custom interop, LLVM 13 This change updates the LlvmBindings package to use the custom LLVM binaries and generated C# from the LLVM pipeline. This allows us to eliminate the dependency on LLVMSharp and control the surface area and LLVM version we use. It also includes all test updates to use LLVM 13 compatible output. * Ensure native libs included in package * Clean up dependency, PR feedback * Add multiplatform testing to feature/llvm13 (#1304) * Add multiplatform validation of compiler repo * skip VS Extension in build script * Use LlvmBindings MCJIT for execution * Simplify devcontainer * Updates for CR feedback * More CR feedback * Fix copyright on copied files (#1331)
This commit is contained in:
Родитель
35973a1786
Коммит
48ee0cac98
|
@ -1,10 +1,3 @@
|
||||||
FROM mcr.microsoft.com/dotnet/core/sdk:3.1-focal
|
FROM mcr.microsoft.com/vscode/devcontainers/universal:1-linux
|
||||||
|
|
||||||
# Mono is required to run pack.ps1, so we install it here.
|
USER codespace
|
||||||
RUN apt-get -y update && \
|
|
||||||
apt-get -y install dirmngr gnupg apt-transport-https ca-certificates && \
|
|
||||||
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF && \
|
|
||||||
sh -c 'echo "deb https://download.mono-project.com/repo/ubuntu stable-focal main" > /etc/apt/sources.list.d/mono-official-stable.list' && \
|
|
||||||
apt-get -y update && \
|
|
||||||
apt-get -y install --no-install-recommends mono-complete nuget && \
|
|
||||||
apt-get clean && rm -rf /var/lib/apt/lists/
|
|
||||||
|
|
|
@ -7,13 +7,6 @@ $ErrorActionPreference = 'Stop'
|
||||||
$all_ok = $True
|
$all_ok = $True
|
||||||
Write-Host "Assembly version: $Env:ASSEMBLY_VERSION"
|
Write-Host "Assembly version: $Env:ASSEMBLY_VERSION"
|
||||||
|
|
||||||
choco install llvm --version=11.1.0 --allow-downgrade
|
|
||||||
if (!(Get-Command clang -ErrorAction SilentlyContinue) -and (choco find --idonly -l llvm) -contains "llvm") {
|
|
||||||
# For some reason, adding to the path does not work on our build servers, even after calling refreshenv.
|
|
||||||
# LLVM was installed by Chocolatey, so add the install location to the path.
|
|
||||||
$env:PATH += ";$($env:SystemDrive)\Program Files\LLVM\bin"
|
|
||||||
}
|
|
||||||
|
|
||||||
##
|
##
|
||||||
# Q# compiler and Sdk tools
|
# Q# compiler and Sdk tools
|
||||||
##
|
##
|
||||||
|
@ -145,7 +138,7 @@ Build-One '../src/QuantumSdk/Tools/Tools.sln'
|
||||||
Build-One '../src/Telemetry/Telemetry.sln'
|
Build-One '../src/Telemetry/Telemetry.sln'
|
||||||
Build-One '../QsFmt.sln'
|
Build-One '../QsFmt.sln'
|
||||||
|
|
||||||
if ($Env:ENABLE_VSIX -ne "false") {
|
if ($Env:ENABLE_VSIX -ne "false" -and $IsWindows) {
|
||||||
Build-VSCode
|
Build-VSCode
|
||||||
Build-VS
|
Build-VS
|
||||||
} else {
|
} else {
|
||||||
|
|
10
build/ci.yml
10
build/ci.yml
|
@ -33,8 +33,16 @@ jobs:
|
||||||
- template: init.yml
|
- template: init.yml
|
||||||
- template: steps.yml
|
- template: steps.yml
|
||||||
- template: wrap-up.yml
|
- template: wrap-up.yml
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
linux:
|
||||||
|
imageName: 'ubuntu-latest'
|
||||||
|
mac:
|
||||||
|
imageName: 'macOS-latest'
|
||||||
|
windows:
|
||||||
|
imageName: 'windows-latest'
|
||||||
pool:
|
pool:
|
||||||
vmImage: windows-latest
|
vmImage: $(imageName)
|
||||||
|
|
||||||
|
|
||||||
- job: Style
|
- job: Style
|
||||||
|
|
|
@ -16,14 +16,14 @@ steps:
|
||||||
versionSpec: 5.8.1
|
versionSpec: 5.8.1
|
||||||
|
|
||||||
- task: UseDotNet@2
|
- task: UseDotNet@2
|
||||||
displayName: Use .NET SDK 5.0.102
|
displayName: Use .NET SDK 5.0.404
|
||||||
inputs:
|
inputs:
|
||||||
version: 5.0.102
|
version: 5.0.404
|
||||||
|
|
||||||
- task: UseDotNet@2
|
- task: UseDotNet@2
|
||||||
displayName: Use .NET Core SDK 3.1.405
|
displayName: Use .NET Core SDK 3.1.416
|
||||||
inputs:
|
inputs:
|
||||||
version: 3.1.405
|
version: 3.1.416
|
||||||
|
|
||||||
# Make sure that npm is up to date, as is required by our VS Code extension
|
# Make sure that npm is up to date, as is required by our VS Code extension
|
||||||
# build.
|
# build.
|
||||||
|
|
|
@ -11,11 +11,12 @@ steps:
|
||||||
- pwsh: ./pack.ps1
|
- pwsh: ./pack.ps1
|
||||||
displayName: "Pack NuGets and VS Code"
|
displayName: "Pack NuGets and VS Code"
|
||||||
workingDirectory: $(System.DefaultWorkingDirectory)/build
|
workingDirectory: $(System.DefaultWorkingDirectory)/build
|
||||||
|
condition: eq( variables['Agent.OS'], 'Windows_NT' )
|
||||||
|
|
||||||
# Visual Studio extension can't be built from the build script as MSBuild is not available.
|
# Visual Studio extension can't be built from the build script as MSBuild is not available.
|
||||||
- task: VSBuild@1
|
- task: VSBuild@1
|
||||||
displayName: 'Pack VisualStudio extension'
|
displayName: 'Pack VisualStudio extension'
|
||||||
condition: and(succeeded(), ne(variables['Enable.VSIX'], 'false'))
|
condition: and(succeeded(), and(ne(variables['Enable.VSIX'], 'false'), eq( variables['Agent.OS'], 'Windows_NT' )))
|
||||||
inputs:
|
inputs:
|
||||||
solution: '$(System.DefaultWorkingDirectory)/VisualStudioExtension.sln'
|
solution: '$(System.DefaultWorkingDirectory)/VisualStudioExtension.sln'
|
||||||
msbuildArgs: >-
|
msbuildArgs: >-
|
||||||
|
@ -25,5 +26,5 @@ steps:
|
||||||
|
|
||||||
- pwsh: ./manifest.ps1
|
- pwsh: ./manifest.ps1
|
||||||
displayName: "List built packages & assemblies"
|
displayName: "List built packages & assemblies"
|
||||||
condition: succeededOrFailed()
|
condition: and(succeededOrFailed(), eq( variables['Agent.OS'], 'Windows_NT' ))
|
||||||
workingDirectory: '$(System.DefaultWorkingDirectory)/build'
|
workingDirectory: '$(System.DefaultWorkingDirectory)/build'
|
||||||
|
|
|
@ -41,7 +41,11 @@ function Test-One {
|
||||||
|
|
||||||
Test-One '../QsCompiler.sln'
|
Test-One '../QsCompiler.sln'
|
||||||
Test-One '../src/Telemetry/Telemetry.sln'
|
Test-One '../src/Telemetry/Telemetry.sln'
|
||||||
|
if ($IsWindows) {
|
||||||
|
# These tests should be able to run cross-platform, see tracking issue:
|
||||||
|
# https://github.com/microsoft/qsharp-compiler/issues/1319
|
||||||
Test-One '../QsFmt.sln'
|
Test-One '../QsFmt.sln'
|
||||||
|
}
|
||||||
|
|
||||||
if (-not $all_ok) {
|
if (-not $all_ok) {
|
||||||
throw "Running tests failed. Check the logs."
|
throw "Running tests failed. Check the logs."
|
||||||
|
|
|
@ -8,18 +8,7 @@
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Condition="$([MSBuild]::IsOsPlatform('Windows'))"
|
<PackageReference Include="Microsoft.Quantum.LlvmBindings.Native" Version="13.0.0-CI-20220129-005156" PrivateAssets="All" GeneratePathProperty="true"/>
|
||||||
Include="libLLVM.runtime.win-x64" Version="11.0.0"
|
|
||||||
PrivateAssets="All" GeneratePathProperty="true" />
|
|
||||||
<PackageReference Condition="$([MSBuild]::IsOsPlatform('OSX'))"
|
|
||||||
Include="libLLVM.runtime.osx-x64" Version="11.0.0"
|
|
||||||
PrivateAssets="All" GeneratePathProperty="true" />
|
|
||||||
<PackageReference Condition="$([MSBuild]::IsOsPlatform('Linux')) And '$(UbuntuVersion)' == '18.04'"
|
|
||||||
Include="libLLVM.runtime.ubuntu.18.04-x64" Version="11.0.0"
|
|
||||||
PrivateAssets="All" GeneratePathProperty="true" />
|
|
||||||
<PackageReference Condition="$([MSBuild]::IsOsPlatform('Linux')) And '$(UbuntuVersion)' != '18.04'"
|
|
||||||
Include="libLLVM.runtime.ubuntu.20.04-x64" Version="11.0.0"
|
|
||||||
PrivateAssets="All" GeneratePathProperty="true" />
|
|
||||||
<PackageReference Include="Microsoft.Quantum.Qir.Runtime" Version="0.20.2110171573-alpha" GeneratePathProperty="true" />
|
<PackageReference Include="Microsoft.Quantum.Qir.Runtime" Version="0.20.2110171573-alpha" GeneratePathProperty="true" />
|
||||||
<PackageReference Include="Microsoft.Quantum.Simulators" Version="0.20.2110171573" GeneratePathProperty="true" />
|
<PackageReference Include="Microsoft.Quantum.Simulators" Version="0.20.2110171573" GeneratePathProperty="true" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
@ -28,6 +17,7 @@
|
||||||
<CSharpGeneration>false</CSharpGeneration>
|
<CSharpGeneration>false</CSharpGeneration>
|
||||||
<QscExe>dotnet $(MSBuildThisFileDirectory)../../../src/QsCompiler/CommandLineTool/bin/$(Configuration)/netcoreapp3.1/qsc.dll</QscExe>
|
<QscExe>dotnet $(MSBuildThisFileDirectory)../../../src/QsCompiler/CommandLineTool/bin/$(Configuration)/netcoreapp3.1/qsc.dll</QscExe>
|
||||||
<_QscCommandPredefinedAssemblyProperties>$(_QscCommandPredefinedAssemblyProperties) QirOutputPath:"qir"</_QscCommandPredefinedAssemblyProperties>
|
<_QscCommandPredefinedAssemblyProperties>$(_QscCommandPredefinedAssemblyProperties) QirOutputPath:"qir"</_QscCommandPredefinedAssemblyProperties>
|
||||||
|
<LlvmLibsPath>$(PkgMicrosoft_Quantum_LlvmBindings_Native)</LlvmLibsPath>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
@ -131,9 +121,8 @@
|
||||||
<SimulatorRuntime Condition="$([MSBuild]::IsOsPlatform('OSX'))">$(PkgMicrosoft_Quantum_Simulators)/runtimes/osx-x64/native/libMicrosoft.Quantum.Simulator.Runtime.dylib</SimulatorRuntime>
|
<SimulatorRuntime Condition="$([MSBuild]::IsOsPlatform('OSX'))">$(PkgMicrosoft_Quantum_Simulators)/runtimes/osx-x64/native/libMicrosoft.Quantum.Simulator.Runtime.dylib</SimulatorRuntime>
|
||||||
<SimulatorRuntime Condition="$([MSBuild]::IsOsPlatform('Windows'))">$(PkgMicrosoft_Quantum_Simulators)/runtimes/win-x64/native/Microsoft.Quantum.Simulator.Runtime.dll</SimulatorRuntime>
|
<SimulatorRuntime Condition="$([MSBuild]::IsOsPlatform('Windows'))">$(PkgMicrosoft_Quantum_Simulators)/runtimes/win-x64/native/Microsoft.Quantum.Simulator.Runtime.dll</SimulatorRuntime>
|
||||||
<SimulatorRuntime Condition="$([MSBuild]::IsOsPlatform('Linux'))">$(PkgMicrosoft_Quantum_Simulators)/runtimes/linux-x64/native/libMicrosoft.Quantum.Simulator.Runtime.so</SimulatorRuntime>
|
<SimulatorRuntime Condition="$([MSBuild]::IsOsPlatform('Linux'))">$(PkgMicrosoft_Quantum_Simulators)/runtimes/linux-x64/native/libMicrosoft.Quantum.Simulator.Runtime.so</SimulatorRuntime>
|
||||||
<ClangName Condition="$([MSBuild]::IsOsPlatform('Windows')) Or $([MSBuild]::IsOsPlatform('OSX'))">clang++</ClangName>
|
<ClangOptions Condition="$([MSBuild]::IsOsPlatform('Linux')) Or $([MSBuild]::IsOsPlatform('OSX'))">-fseh-exceptions -lstdc++</ClangOptions>
|
||||||
<ClangName Condition="$([MSBuild]::IsOsPlatform('Linux'))">clang++-11</ClangName>
|
<ClangCommand>clang -std=c++17 -Wno-override-module $(ClangOptions) -o $(ExecutablePath) $(QirOutputPath)$(PathCompatibleAssemblyName).ll $(BuildOutputPath)/Main.cpp -I$(BuildOutputPath) -L$(BuildOutputPath) -lMicrosoft.Quantum.Qir.Runtime -lMicrosoft.Quantum.Qir.QSharp.Core -lMicrosoft.Quantum.Qir.QSharp.Foundation</ClangCommand>
|
||||||
<ClangCommand>$(ClangName) -o $(ExecutablePath) $(QirOutputPath)$(PathCompatibleAssemblyName).ll $(BuildOutputPath)/Main.cpp -I$(BuildOutputPath) -L$(BuildOutputPath) -lMicrosoft.Quantum.Qir.Runtime -lMicrosoft.Quantum.Qir.QSharp.Core -lMicrosoft.Quantum.Qir.QSharp.Foundation</ClangCommand>
|
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<_QirRuntimeLibFiles Include="$(QirRuntimeLibs)/**/*.*" Exclude="$(QirRuntimeLibs)/**/*.exe" />
|
<_QirRuntimeLibFiles Include="$(QirRuntimeLibs)/**/*.*" Exclude="$(QirRuntimeLibs)/**/*.exe" />
|
||||||
|
@ -143,7 +132,11 @@
|
||||||
<Copy SourceFiles="$(SimulatorRuntime)" DestinationFolder="$(BuildOutputPath)" SkipUnchangedFiles="true" />
|
<Copy SourceFiles="$(SimulatorRuntime)" DestinationFolder="$(BuildOutputPath)" SkipUnchangedFiles="true" />
|
||||||
<Copy SourceFiles="@(_QirRuntimeLibFiles)" DestinationFolder="$(BuildOutputPath)\%(RecursiveDir)" SkipUnchangedFiles="true" />
|
<Copy SourceFiles="@(_QirRuntimeLibFiles)" DestinationFolder="$(BuildOutputPath)\%(RecursiveDir)" SkipUnchangedFiles="true" />
|
||||||
<Copy SourceFiles="@(_QirRuntimeHeaderFiles)" DestinationFolder="$(BuildOutputPath)\%(RecursiveDir)" SkipUnchangedFiles="true" />
|
<Copy SourceFiles="@(_QirRuntimeHeaderFiles)" DestinationFolder="$(BuildOutputPath)\%(RecursiveDir)" SkipUnchangedFiles="true" />
|
||||||
<Exec Command="$(ClangCommand)" IgnoreExitCode="false" />
|
<Exec Command="clang --version" IgnoreExitCode="true" ContinueOnError="ErrorAndContinue">
|
||||||
|
<Output TaskParameter="ExitCode" PropertyName="ClangVersionCheckExitCode"/>
|
||||||
|
</Exec>
|
||||||
|
<Warning Text="Clang not found, skipping native build." Condition="'$(ClangVersionCheckExitCode)' != '0'" />
|
||||||
|
<Exec Command="$(ClangCommand)" Condition="'$(ClangVersionCheckExitCode)' == '0'" IgnoreExitCode="false" />
|
||||||
</Target>
|
</Target>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|
|
@ -6,5 +6,5 @@ This is *not* how the QIR generation is meant to be used if you don't intend to
|
||||||
|
|
||||||
Note: If you are using the Development project on Linux, you may run into the following error: `System.DllNotFoundException: Unable to load shared library 'libLLVM' or one of its dependencies.` The solution to this is to set the LD_LIBRARY_PATH environment variable to point towards the libLLVM.so libary. This can be done using the following command in bash:
|
Note: If you are using the Development project on Linux, you may run into the following error: `System.DllNotFoundException: Unable to load shared library 'libLLVM' or one of its dependencies.` The solution to this is to set the LD_LIBRARY_PATH environment variable to point towards the libLLVM.so libary. This can be done using the following command in bash:
|
||||||
```
|
```
|
||||||
export LD_LIBRARY_PATH=/usr/lib/llvm-11/lib
|
export LD_LIBRARY_PATH=/usr/lib/llvm-13/lib
|
||||||
```
|
```
|
||||||
|
|
|
@ -37,27 +37,27 @@ On Windows, the conda method is recommended since it's also able to install the
|
||||||
|
|
||||||
Package managers:
|
Package managers:
|
||||||
|
|
||||||
* **Ubuntu** : `sudo apt install clang-11`
|
* **Ubuntu** : `sudo apt install clang-13`
|
||||||
* **Windows** : `choco install llvm --version=11.1.0` using [chocolatey](https://chocolatey.org/)
|
* **Windows** : `choco install llvm --version=13.0.0` using [chocolatey](https://chocolatey.org/)
|
||||||
* **macOS** : `brew install llvm@11` using [homebrew](https://brew.sh/)
|
* **macOS** : `brew install llvm@11` using [homebrew](https://brew.sh/)
|
||||||
|
|
||||||
* **all** : `conda install -c conda-forge clang=11.1.0 clangxx=11.1.0 llvm=11.1.0` using [conda](https://conda.io/projects/conda/en/latest/user-guide/install/index.html)
|
* **all** : `conda install -c conda-forge clang=13.0.0 clangxx=13.0.0 llvm=13.0.0` using [conda](https://conda.io/projects/conda/en/latest/user-guide/install/index.html)
|
||||||
|
|
||||||
Pre-built binaries/installers:
|
Pre-built binaries/installers:
|
||||||
|
|
||||||
* **Ubuntu** : get `clang+llvm-11.1.0-x86_64-linux-gnu-ubuntu-20.10.tar.xz` from the [GitHub release](https://github.com/llvm/llvm-project/releases/tag/llvmorg-11.1.0)
|
* **Ubuntu** : get `clang+llvm-13.0.0-x86_64-linux-gnu-ubuntu-20.10.tar.xz` from the [GitHub release](https://github.com/llvm/llvm-project/releases/tag/llvmorg-13.0.0)
|
||||||
* **Windows** : get `LLVM-11.1.0-win64.exe` from the [GitHub release](https://github.com/llvm/llvm-project/releases/tag/llvmorg-11.1.0)
|
* **Windows** : get `LLVM-13.0.0-win64.exe` from the [GitHub release](https://github.com/llvm/llvm-project/releases/tag/llvmorg-13.0.0)
|
||||||
* **macOS** : get `clang+llvm-11.0.0-x86_64-apple-darwin.tar.xz` from the [11.0.0 release](https://github.com/llvm/llvm-project/releases/tag/llvmorg-11.0.0) (11.1.0 not released)
|
* **macOS** : get `clang+llvm-13.0.0-x86_64-apple-darwin.tar.xz` from the [13.0.0 release](https://github.com/llvm/llvm-project/releases/tag/llvmorg-13.0.0)
|
||||||
|
|
||||||
|
|
||||||
(**Linux**) If installing via `apt`, the clang/llvm commands will have `-11` attached to their name.
|
(**Linux**) If installing via `apt`, the clang/llvm commands will have `-13` attached to their name.
|
||||||
It's convenient to define aliases for these commands so as not to have to type out the full name every time.
|
It's convenient to define aliases for these commands so as not to have to type out the full name every time.
|
||||||
If you want to skip this step, substitute `clang`/`clang++`/`opt` with `clang-11`/`clang++-11`/`opt-11` throughout the rest of this document.
|
If you want to skip this step, substitute `clang`/`clang++`/`opt` with `clang-13`/`clang++-13`/`opt-13` throughout the rest of this document.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
echo 'alias clang=clang-11' >> ~/.bashrc
|
echo 'alias clang=clang-13' >> ~/.bashrc
|
||||||
echo 'alias clang++=clang++-11' >> ~/.bashrc
|
echo 'alias clang++=clang++-13' >> ~/.bashrc
|
||||||
echo 'alias opt=opt-11' >> ~/.bashrc
|
echo 'alias opt=opt-13' >> ~/.bashrc
|
||||||
```
|
```
|
||||||
|
|
||||||
Restart the terminal for the aliases to take effect.
|
Restart the terminal for the aliases to take effect.
|
||||||
|
|
|
@ -10,6 +10,7 @@ LLVMAttributeReturnIndex
|
||||||
LLVMInitializeCore
|
LLVMInitializeCore
|
||||||
--file
|
--file
|
||||||
llvm-c/Analysis.h
|
llvm-c/Analysis.h
|
||||||
|
llvm-c/BitReader.h
|
||||||
llvm-c/BitWriter.h
|
llvm-c/BitWriter.h
|
||||||
llvm-c/Comdat.h
|
llvm-c/Comdat.h
|
||||||
llvm-c/Core.h
|
llvm-c/Core.h
|
||||||
|
@ -17,6 +18,7 @@ llvm-c/DataTypes.h
|
||||||
llvm-c/DebugInfo.h
|
llvm-c/DebugInfo.h
|
||||||
llvm-c/Error.h
|
llvm-c/Error.h
|
||||||
llvm-c/ErrorHandling.h
|
llvm-c/ErrorHandling.h
|
||||||
|
llvm-c/ExecutionEngine.h
|
||||||
llvm-c/ExternC.h
|
llvm-c/ExternC.h
|
||||||
llvm-c/Initialization.h
|
llvm-c/Initialization.h
|
||||||
llvm-c/Object.h
|
llvm-c/Object.h
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by a tool.
|
||||||
|
// Changes to this file may cause incorrect behavior and will be lost if
|
||||||
|
// the code is regenerated.
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
|
@ -50,7 +50,7 @@ foreach ($file in $llvmArchiveFiles) {
|
||||||
}
|
}
|
||||||
|
|
||||||
# Windows: bin/LLVM-C.dll
|
# Windows: bin/LLVM-C.dll
|
||||||
# Linux: lib/libLLVM-11.so
|
# Linux: lib/libLLVM-13.so
|
||||||
# Darwin: lib/libLLVM.dylib
|
# Darwin: lib/libLLVM.dylib
|
||||||
|
|
||||||
$linuxPath = Resolve-Path (Join-Path '.' "$($env:LINUX_PKG_NAME)" "lib" "libLLVM-[0-9][0-9].so")
|
$linuxPath = Resolve-Path (Join-Path '.' "$($env:LINUX_PKG_NAME)" "lib" "libLLVM-[0-9][0-9].so")
|
||||||
|
@ -95,7 +95,8 @@ ClangSharpPInvokeGenerator `
|
||||||
"@$(Join-Path $PSScriptRoot GenerateLLVM.rsp)" `
|
"@$(Join-Path $PSScriptRoot GenerateLLVM.rsp)" `
|
||||||
--output $generatedDir `
|
--output $generatedDir `
|
||||||
--file-directory $includeDir `
|
--file-directory $includeDir `
|
||||||
--include-directory $includeDir
|
--include-directory $includeDir `
|
||||||
|
--headerFile (Join-Path $PSScriptRoot header.txt)
|
||||||
|
|
||||||
New-Item -ItemType Directory -Force (Join-Path $PSScriptRoot drops) | Out-Null
|
New-Item -ItemType Directory -Force (Join-Path $PSScriptRoot drops) | Out-Null
|
||||||
|
|
||||||
|
|
|
@ -72,4 +72,7 @@ else()
|
||||||
set(LLVM_BUILD_LLVM_DYLIB ON CACHE BOOL "")
|
set(LLVM_BUILD_LLVM_DYLIB ON CACHE BOOL "")
|
||||||
set(CPACK_BINARY_TGZ ON CACHE BOOL "")
|
set(CPACK_BINARY_TGZ ON CACHE BOOL "")
|
||||||
endif()
|
endif()
|
||||||
set(LLVM_DYLIB_COMPONENTS "core;debuginfodwarf;linker;support;target;bitwriter" CACHE STRING "")
|
|
||||||
|
# See https://github.com/llvm/llvm-project/blob/llvmorg-13.0.0/llvm/utils/gn/build/write_library_dependencies.py for a list
|
||||||
|
# of these dependencies and what they bring into the linked binary.
|
||||||
|
set(LLVM_DYLIB_COMPONENTS "core;debuginfodwarf;linker;support;target;bitwriter;analysis;executionengine;runtimedyld;mcjit;bitstreamreader;bitreader;native" CACHE STRING "")
|
||||||
|
|
|
@ -32,6 +32,14 @@
|
||||||
<ProjectReference Include="..\Compiler\Compiler.csproj" />
|
<ProjectReference Include="..\Compiler\Compiler.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup Condition="!$([MSBuild]::IsOsPlatform('Windows'))">
|
||||||
|
<PackageReference Include="Microsoft.Quantum.LlvmBindings.Native" Version="13.0.0-CI-20220129-005156">
|
||||||
|
<PrivateAssets>all</PrivateAssets>
|
||||||
|
<Visible>false</Visible>
|
||||||
|
<Pack>false</Pack>
|
||||||
|
</PackageReference>
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Content Include="..\..\..\NOTICE.txt" Link="NOTICE.txt">
|
<Content Include="..\..\..\NOTICE.txt" Link="NOTICE.txt">
|
||||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
|
|
|
@ -57,4 +57,4 @@ Add-NuGetDependencyFromCsprojToNuspec "Compiler.csproj" $dep
|
||||||
|
|
||||||
# Save into .nuspec file:
|
# Save into .nuspec file:
|
||||||
$nuspec.package.metadata.AppendChild($dep)
|
$nuspec.package.metadata.AppendChild($dep)
|
||||||
$nuspec.Save("$PSScriptRoot\Compiler.nuspec")
|
$nuspec.Save((Join-Path $PSScriptRoot Compiler.nuspec))
|
||||||
|
|
|
@ -10,15 +10,13 @@ using System.Collections.Generic;
|
||||||
using System.Diagnostics.CodeAnalysis;
|
using System.Diagnostics.CodeAnalysis;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using LlvmBindings.DebugInfo;
|
||||||
|
using LlvmBindings.Instructions;
|
||||||
|
using LlvmBindings.Interop;
|
||||||
|
using LlvmBindings.Types;
|
||||||
|
using LlvmBindings.Values;
|
||||||
|
|
||||||
using LLVMSharp.Interop;
|
namespace LlvmBindings
|
||||||
|
|
||||||
using Ubiquity.NET.Llvm.DebugInfo;
|
|
||||||
using Ubiquity.NET.Llvm.Instructions;
|
|
||||||
using Ubiquity.NET.Llvm.Types;
|
|
||||||
using Ubiquity.NET.Llvm.Values;
|
|
||||||
|
|
||||||
namespace Ubiquity.NET.Llvm
|
|
||||||
{
|
{
|
||||||
/// <summary>Enumeration to indicate the behavior of module level flags metadata sharing the same name in a <see cref="BitcodeModule"/>.</summary>
|
/// <summary>Enumeration to indicate the behavior of module level flags metadata sharing the same name in a <see cref="BitcodeModule"/>.</summary>
|
||||||
[SuppressMessage("Design", "CA1027:Mark enums with FlagsAttribute", Justification = "It isn't a flags enum")]
|
[SuppressMessage("Design", "CA1027:Mark enums with FlagsAttribute", Justification = "It isn't a flags enum")]
|
||||||
|
@ -240,39 +238,6 @@ namespace Ubiquity.NET.Llvm
|
||||||
|
|
||||||
public ref LLVMModuleRef ModuleHandle => ref this.moduleHandle;
|
public ref LLVMModuleRef ModuleHandle => ref this.moduleHandle;
|
||||||
|
|
||||||
/// <summary>Load a bit-code module from a given file.</summary>
|
|
||||||
/// <param name="path">path of the file to load.</param>
|
|
||||||
/// <param name="context">Context to use for creating the module.</param>
|
|
||||||
/// <returns>Loaded <see cref="BitcodeModule"/>.</returns>
|
|
||||||
public static BitcodeModule LoadFrom(string path, Context context)
|
|
||||||
{
|
|
||||||
if (!File.Exists(path))
|
|
||||||
{
|
|
||||||
throw new FileNotFoundException();
|
|
||||||
}
|
|
||||||
|
|
||||||
var buffer = new MemoryBuffer(path);
|
|
||||||
return LoadFrom(buffer, context);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>Load bit code from a memory buffer.</summary>
|
|
||||||
/// <param name="buffer">Buffer to load from.</param>
|
|
||||||
/// <param name="context">Context to load the module into.</param>
|
|
||||||
/// <returns>Loaded <see cref="BitcodeModule"/>.</returns>
|
|
||||||
/// <remarks>
|
|
||||||
/// This along with <see cref="WriteToBuffer"/> are useful for "cloning"
|
|
||||||
/// a module from one context to another. This allows creation of multiple
|
|
||||||
/// modules on different threads and contexts and later moving them to a
|
|
||||||
/// single context in order to link them into a single final module for
|
|
||||||
/// optimization.
|
|
||||||
/// </remarks>
|
|
||||||
public static BitcodeModule LoadFrom(MemoryBuffer buffer, Context context)
|
|
||||||
{
|
|
||||||
return context.ContextHandle.TryParseBitcode(buffer.BufferHandle, out LLVMModuleRef modRef, out string message)
|
|
||||||
? context.GetModuleFor(modRef)
|
|
||||||
: throw new InternalCodeGeneratorException(message);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>Disposes the <see cref="BitcodeModule"/>, releasing resources associated with the module in native code.</summary>
|
/// <summary>Disposes the <see cref="BitcodeModule"/>, releasing resources associated with the module in native code.</summary>
|
||||||
public void Dispose()
|
public void Dispose()
|
||||||
{
|
{
|
||||||
|
@ -288,32 +253,6 @@ namespace Ubiquity.NET.Llvm
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>Link another module into this one.</summary>
|
|
||||||
/// <param name="otherModule">module to link into this one.</param>
|
|
||||||
/// <remarks>
|
|
||||||
/// <note type="warning">
|
|
||||||
/// <paramref name="otherModule"/> is destroyed by this process and no longer usable
|
|
||||||
/// when this method returns.
|
|
||||||
/// </note>
|
|
||||||
/// </remarks>
|
|
||||||
public void Link(BitcodeModule otherModule)
|
|
||||||
{
|
|
||||||
this.ThrowIfDisposed();
|
|
||||||
|
|
||||||
if (otherModule.Context != this.Context)
|
|
||||||
{
|
|
||||||
throw new ArgumentException();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.moduleHandle.Link(otherModule.moduleHandle))
|
|
||||||
{
|
|
||||||
throw new InternalCodeGeneratorException();
|
|
||||||
}
|
|
||||||
|
|
||||||
this.Context.RemoveModule(otherModule);
|
|
||||||
otherModule.Detach().Dispose();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>Verifies a bit-code module.</summary>
|
/// <summary>Verifies a bit-code module.</summary>
|
||||||
/// <param name="errorMessage">Error messages describing any issues found in the bit-code.</param>
|
/// <param name="errorMessage">Error messages describing any issues found in the bit-code.</param>
|
||||||
/// <returns>true if the verification succeeded and false if not.</returns>
|
/// <returns>true if the verification succeeded and false if not.</returns>
|
||||||
|
@ -654,23 +593,6 @@ namespace Ubiquity.NET.Llvm
|
||||||
return FromHandle(this.moduleHandle.Clone())!;
|
return FromHandle(this.moduleHandle.Clone())!;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>Clones the module into a new <see cref="Context"/>.</summary>
|
|
||||||
/// <param name="targetContext"><see cref="Context"/> to clone the module into.</param>
|
|
||||||
/// <returns>Cloned copy of the module.</returns>
|
|
||||||
public BitcodeModule Clone(Context targetContext)
|
|
||||||
{
|
|
||||||
this.ThrowIfDisposed();
|
|
||||||
|
|
||||||
if (targetContext == this.Context)
|
|
||||||
{
|
|
||||||
return this.Clone();
|
|
||||||
}
|
|
||||||
|
|
||||||
var buffer = this.WriteToBuffer();
|
|
||||||
var retVal = LoadFrom(buffer, targetContext);
|
|
||||||
return retVal;
|
|
||||||
}
|
|
||||||
|
|
||||||
internal static BitcodeModule FromHandle(LLVMModuleRef nativeHandle)
|
internal static BitcodeModule FromHandle(LLVMModuleRef nativeHandle)
|
||||||
{
|
{
|
||||||
var contextRef = nativeHandle.Context;
|
var contextRef = nativeHandle.Context;
|
||||||
|
|
|
@ -11,12 +11,11 @@ using System.Diagnostics;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using LLVMSharp.Interop;
|
using LlvmBindings.Interop;
|
||||||
using Ubiquity.NET.Llvm.Interop;
|
using LlvmBindings.Types;
|
||||||
using Ubiquity.NET.Llvm.Types;
|
using LlvmBindings.Values;
|
||||||
using Ubiquity.NET.Llvm.Values;
|
|
||||||
|
|
||||||
namespace Ubiquity.NET.Llvm
|
namespace LlvmBindings
|
||||||
{
|
{
|
||||||
/// <summary>Encapsulates an LLVM context.</summary>
|
/// <summary>Encapsulates an LLVM context.</summary>
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
|
@ -28,7 +27,7 @@ namespace Ubiquity.NET.Llvm
|
||||||
/// <para>LLVM Debug information is ultimately all parented to a top level <see cref="DICompileUnit"/> as
|
/// <para>LLVM Debug information is ultimately all parented to a top level <see cref="DICompileUnit"/> as
|
||||||
/// the scope, and a compilation unit is bound to a <see cref="BitcodeModule"/>, even though, technically
|
/// the scope, and a compilation unit is bound to a <see cref="BitcodeModule"/>, even though, technically
|
||||||
/// the types are owned by a Context. Thus to keep things simpler and help make working with debug information
|
/// the types are owned by a Context. Thus to keep things simpler and help make working with debug information
|
||||||
/// easier. Ubiquity.NET.Llvm encapsulates the native type and the debug type in separate classes that are instances
|
/// easier. LlvmBindings encapsulates the native type and the debug type in separate classes that are instances
|
||||||
/// of the <see cref="IDebugType{NativeT, DebugT}"/> interface. </para>
|
/// of the <see cref="IDebugType{NativeT, DebugT}"/> interface. </para>
|
||||||
///
|
///
|
||||||
/// <note type="note">It is important to be aware of the fact that a Context is not thread safe. The context
|
/// <note type="note">It is important to be aware of the fact that a Context is not thread safe. The context
|
||||||
|
|
|
@ -8,11 +8,11 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
using LLVMSharp.Interop;
|
using LlvmBindings.Interop;
|
||||||
using Ubiquity.NET.Llvm.Types;
|
using LlvmBindings.Types;
|
||||||
using Ubiquity.NET.Llvm.Values;
|
using LlvmBindings.Values;
|
||||||
|
|
||||||
namespace Ubiquity.NET.Llvm
|
namespace LlvmBindings
|
||||||
{
|
{
|
||||||
/// <summary>Byte ordering for target code generation and data type layout</summary>
|
/// <summary>Byte ordering for target code generation and data type layout</summary>
|
||||||
public enum ByteOrdering
|
public enum ByteOrdering
|
||||||
|
|
|
@ -5,9 +5,9 @@
|
||||||
// </copyright>
|
// </copyright>
|
||||||
// -----------------------------------------------------------------------
|
// -----------------------------------------------------------------------
|
||||||
|
|
||||||
using LLVMSharp.Interop;
|
using LlvmBindings.Interop;
|
||||||
|
|
||||||
namespace Ubiquity.NET.Llvm.DebugInfo
|
namespace LlvmBindings.DebugInfo
|
||||||
{
|
{
|
||||||
/// <summary>Debug information for a basic type</summary>
|
/// <summary>Debug information for a basic type</summary>
|
||||||
/// <seealso cref="DebugInfoBuilder.CreateBasicType(string, ulong, DiTypeKind, DebugInfoFlags)"/>
|
/// <seealso cref="DebugInfoBuilder.CreateBasicType(string, ulong, DiTypeKind, DebugInfoFlags)"/>
|
||||||
|
|
|
@ -5,9 +5,9 @@
|
||||||
// </copyright>
|
// </copyright>
|
||||||
// -----------------------------------------------------------------------
|
// -----------------------------------------------------------------------
|
||||||
|
|
||||||
using LLVMSharp.Interop;
|
using LlvmBindings.Interop;
|
||||||
|
|
||||||
namespace Ubiquity.NET.Llvm.DebugInfo
|
namespace LlvmBindings.DebugInfo
|
||||||
{
|
{
|
||||||
/// <summary>Debug Information Compile Unit, which acts as the containing parent for debug information in a module</summary>
|
/// <summary>Debug Information Compile Unit, which acts as the containing parent for debug information in a module</summary>
|
||||||
/// <seealso href="xref:llvm_langref#dicompileunit">LLVM DICompileUnit</seealso>
|
/// <seealso href="xref:llvm_langref#dicompileunit">LLVM DICompileUnit</seealso>
|
||||||
|
|
|
@ -5,9 +5,9 @@
|
||||||
// </copyright>
|
// </copyright>
|
||||||
// -----------------------------------------------------------------------
|
// -----------------------------------------------------------------------
|
||||||
|
|
||||||
using LLVMSharp.Interop;
|
using LlvmBindings.Interop;
|
||||||
|
|
||||||
namespace Ubiquity.NET.Llvm.DebugInfo
|
namespace LlvmBindings.DebugInfo
|
||||||
{
|
{
|
||||||
/// <summary>Debug information for a composite type</summary>
|
/// <summary>Debug information for a composite type</summary>
|
||||||
/// <seealso href="xref:llvm_langref#dicompositetype">LLVM DICompositeType</seealso>
|
/// <seealso href="xref:llvm_langref#dicompositetype">LLVM DICompositeType</seealso>
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
using System.Diagnostics.CodeAnalysis;
|
using System.Diagnostics.CodeAnalysis;
|
||||||
|
|
||||||
namespace Ubiquity.NET.Llvm.DebugInfo
|
namespace LlvmBindings.DebugInfo
|
||||||
{
|
{
|
||||||
/// <summary>Array of <see cref="DICompositeType"/> debug information nodes for use with <see cref="DebugInfoBuilder"/> methods</summary>
|
/// <summary>Array of <see cref="DICompositeType"/> debug information nodes for use with <see cref="DebugInfoBuilder"/> methods</summary>
|
||||||
[SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix", Justification = "This matches the wrapped native type")]
|
[SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix", Justification = "This matches the wrapped native type")]
|
||||||
|
|
|
@ -5,10 +5,10 @@
|
||||||
// </copyright>
|
// </copyright>
|
||||||
// -----------------------------------------------------------------------
|
// -----------------------------------------------------------------------
|
||||||
|
|
||||||
using LLVMSharp.Interop;
|
using LlvmBindings.Interop;
|
||||||
using Ubiquity.NET.Llvm.Values;
|
using LlvmBindings.Values;
|
||||||
|
|
||||||
namespace Ubiquity.NET.Llvm.DebugInfo
|
namespace LlvmBindings.DebugInfo
|
||||||
{
|
{
|
||||||
/// <summary>Derived type</summary>
|
/// <summary>Derived type</summary>
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
|
|
|
@ -5,9 +5,9 @@
|
||||||
// </copyright>
|
// </copyright>
|
||||||
// -----------------------------------------------------------------------
|
// -----------------------------------------------------------------------
|
||||||
|
|
||||||
using LLVMSharp.Interop;
|
using LlvmBindings.Interop;
|
||||||
|
|
||||||
namespace Ubiquity.NET.Llvm.DebugInfo
|
namespace LlvmBindings.DebugInfo
|
||||||
{
|
{
|
||||||
/// <summary>Debug Information for a name value par of an enumerated type</summary>
|
/// <summary>Debug Information for a name value par of an enumerated type</summary>
|
||||||
/// <seealso href="xref:llvm_langref#dienumerator">LLVM DIEnumerator</seealso>
|
/// <seealso href="xref:llvm_langref#dienumerator">LLVM DIEnumerator</seealso>
|
||||||
|
|
|
@ -5,9 +5,9 @@
|
||||||
// </copyright>
|
// </copyright>
|
||||||
// -----------------------------------------------------------------------
|
// -----------------------------------------------------------------------
|
||||||
|
|
||||||
using LLVMSharp.Interop;
|
using LlvmBindings.Interop;
|
||||||
|
|
||||||
namespace Ubiquity.NET.Llvm.DebugInfo
|
namespace LlvmBindings.DebugInfo
|
||||||
{
|
{
|
||||||
/// <summary>Debug information expression</summary>
|
/// <summary>Debug information expression</summary>
|
||||||
/// <seealso href="xref:llvm_langref#diexpression">LLVM DIExpression</seealso>
|
/// <seealso href="xref:llvm_langref#diexpression">LLVM DIExpression</seealso>
|
||||||
|
|
|
@ -5,9 +5,9 @@
|
||||||
// </copyright>
|
// </copyright>
|
||||||
// -----------------------------------------------------------------------
|
// -----------------------------------------------------------------------
|
||||||
|
|
||||||
using LLVMSharp.Interop;
|
using LlvmBindings.Interop;
|
||||||
|
|
||||||
namespace Ubiquity.NET.Llvm.DebugInfo
|
namespace LlvmBindings.DebugInfo
|
||||||
{
|
{
|
||||||
/// <summary>Debug information for a source file</summary>
|
/// <summary>Debug information for a source file</summary>
|
||||||
/// <seealso href="xref:llvm_langref#difile">LLVM DIFile</seealso>
|
/// <seealso href="xref:llvm_langref#difile">LLVM DIFile</seealso>
|
||||||
|
|
|
@ -5,9 +5,9 @@
|
||||||
// </copyright>
|
// </copyright>
|
||||||
// -----------------------------------------------------------------------
|
// -----------------------------------------------------------------------
|
||||||
|
|
||||||
using LLVMSharp.Interop;
|
using LlvmBindings.Interop;
|
||||||
|
|
||||||
namespace Ubiquity.NET.Llvm.DebugInfo
|
namespace LlvmBindings.DebugInfo
|
||||||
{
|
{
|
||||||
/// <summary>Debug information for a global variable</summary>
|
/// <summary>Debug information for a global variable</summary>
|
||||||
/// <seealso href="xref:llvm_langref#diglobalvariable">LLVM DIGlobalVariable</seealso>
|
/// <seealso href="xref:llvm_langref#diglobalvariable">LLVM DIGlobalVariable</seealso>
|
||||||
|
|
|
@ -5,9 +5,9 @@
|
||||||
// </copyright>
|
// </copyright>
|
||||||
// -----------------------------------------------------------------------
|
// -----------------------------------------------------------------------
|
||||||
|
|
||||||
using LLVMSharp.Interop;
|
using LlvmBindings.Interop;
|
||||||
|
|
||||||
namespace Ubiquity.NET.Llvm.DebugInfo
|
namespace LlvmBindings.DebugInfo
|
||||||
{
|
{
|
||||||
/// <summary>Debug Global variable expression</summary>
|
/// <summary>Debug Global variable expression</summary>
|
||||||
/// <remarks>This node binds a <see cref="DIGlobalVariable"/> and a <see cref="DIExpression"/></remarks>
|
/// <remarks>This node binds a <see cref="DIGlobalVariable"/> and a <see cref="DIExpression"/></remarks>
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
using System.Diagnostics.CodeAnalysis;
|
using System.Diagnostics.CodeAnalysis;
|
||||||
|
|
||||||
namespace Ubiquity.NET.Llvm.DebugInfo
|
namespace LlvmBindings.DebugInfo
|
||||||
{
|
{
|
||||||
/// <summary>Array of <see cref="DIGlobalVariableExpression"/> debug information nodes for use with <see cref="DebugInfoBuilder"/> methods</summary>
|
/// <summary>Array of <see cref="DIGlobalVariableExpression"/> debug information nodes for use with <see cref="DebugInfoBuilder"/> methods</summary>
|
||||||
[SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix", Justification = "This matches the wrapped native type")]
|
[SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix", Justification = "This matches the wrapped native type")]
|
||||||
|
|
|
@ -5,9 +5,9 @@
|
||||||
// </copyright>
|
// </copyright>
|
||||||
// -----------------------------------------------------------------------
|
// -----------------------------------------------------------------------
|
||||||
|
|
||||||
using LLVMSharp.Interop;
|
using LlvmBindings.Interop;
|
||||||
|
|
||||||
namespace Ubiquity.NET.Llvm.DebugInfo
|
namespace LlvmBindings.DebugInfo
|
||||||
{
|
{
|
||||||
/// <summary>Debug information from an imported entity</summary>
|
/// <summary>Debug information from an imported entity</summary>
|
||||||
/// <seealso href="xref:llvm_langref#diimportedentity">LLVM DIImportedEntity</seealso>
|
/// <seealso href="xref:llvm_langref#diimportedentity">LLVM DIImportedEntity</seealso>
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
using System.Diagnostics.CodeAnalysis;
|
using System.Diagnostics.CodeAnalysis;
|
||||||
|
|
||||||
namespace Ubiquity.NET.Llvm.DebugInfo
|
namespace LlvmBindings.DebugInfo
|
||||||
{
|
{
|
||||||
/// <summary>Array of <see cref="DIImportedEntity"/> debug information nodes for use with <see cref="DebugInfoBuilder"/> methods</summary>
|
/// <summary>Array of <see cref="DIImportedEntity"/> debug information nodes for use with <see cref="DebugInfoBuilder"/> methods</summary>
|
||||||
[SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix", Justification = "This matches the wrapped native type")]
|
[SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix", Justification = "This matches the wrapped native type")]
|
||||||
|
|
|
@ -5,9 +5,9 @@
|
||||||
// </copyright>
|
// </copyright>
|
||||||
// -----------------------------------------------------------------------
|
// -----------------------------------------------------------------------
|
||||||
|
|
||||||
using LLVMSharp.Interop;
|
using LlvmBindings.Interop;
|
||||||
|
|
||||||
namespace Ubiquity.NET.Llvm.DebugInfo
|
namespace LlvmBindings.DebugInfo
|
||||||
{
|
{
|
||||||
/// <summary>Debug information for a Lexical block</summary>
|
/// <summary>Debug information for a Lexical block</summary>
|
||||||
/// <seealso href="xref:llvm_langref#dilexicalblock">LLVM DILexicalBlock</seealso>
|
/// <seealso href="xref:llvm_langref#dilexicalblock">LLVM DILexicalBlock</seealso>
|
||||||
|
|
|
@ -5,9 +5,9 @@
|
||||||
// </copyright>
|
// </copyright>
|
||||||
// -----------------------------------------------------------------------
|
// -----------------------------------------------------------------------
|
||||||
|
|
||||||
using LLVMSharp.Interop;
|
using LlvmBindings.Interop;
|
||||||
|
|
||||||
namespace Ubiquity.NET.Llvm.DebugInfo
|
namespace LlvmBindings.DebugInfo
|
||||||
{
|
{
|
||||||
/// <summary>Base for lexical blocks</summary>
|
/// <summary>Base for lexical blocks</summary>
|
||||||
public class DILexicalBlockBase
|
public class DILexicalBlockBase
|
||||||
|
|
|
@ -5,9 +5,9 @@
|
||||||
// </copyright>
|
// </copyright>
|
||||||
// -----------------------------------------------------------------------
|
// -----------------------------------------------------------------------
|
||||||
|
|
||||||
using LLVMSharp.Interop;
|
using LlvmBindings.Interop;
|
||||||
|
|
||||||
namespace Ubiquity.NET.Llvm.DebugInfo
|
namespace LlvmBindings.DebugInfo
|
||||||
{
|
{
|
||||||
/// <summary>Debug information for a file lexical block</summary>
|
/// <summary>Debug information for a file lexical block</summary>
|
||||||
/// <seealso href="xref:llvm_langref#dilexicalblockfile">LLVM DILexicalBlockBase</seealso>
|
/// <seealso href="xref:llvm_langref#dilexicalblockfile">LLVM DILexicalBlockBase</seealso>
|
||||||
|
|
|
@ -5,9 +5,9 @@
|
||||||
// </copyright>
|
// </copyright>
|
||||||
// -----------------------------------------------------------------------
|
// -----------------------------------------------------------------------
|
||||||
|
|
||||||
using LLVMSharp.Interop;
|
using LlvmBindings.Interop;
|
||||||
|
|
||||||
namespace Ubiquity.NET.Llvm.DebugInfo
|
namespace LlvmBindings.DebugInfo
|
||||||
{
|
{
|
||||||
/// <summary>Legal scope for lexical blocks, local variables, and debug info locations</summary>
|
/// <summary>Legal scope for lexical blocks, local variables, and debug info locations</summary>
|
||||||
public class DILocalScope
|
public class DILocalScope
|
||||||
|
|
|
@ -5,9 +5,9 @@
|
||||||
// </copyright>
|
// </copyright>
|
||||||
// -----------------------------------------------------------------------
|
// -----------------------------------------------------------------------
|
||||||
|
|
||||||
using LLVMSharp.Interop;
|
using LlvmBindings.Interop;
|
||||||
|
|
||||||
namespace Ubiquity.NET.Llvm.DebugInfo
|
namespace LlvmBindings.DebugInfo
|
||||||
{
|
{
|
||||||
/// <summary>Debug information for a local variable</summary>
|
/// <summary>Debug information for a local variable</summary>
|
||||||
/// <seealso href="xref:llvm_langref#dilocalvariable">LLVM DILocalVariable</seealso>
|
/// <seealso href="xref:llvm_langref#dilocalvariable">LLVM DILocalVariable</seealso>
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
using System.Diagnostics.CodeAnalysis;
|
using System.Diagnostics.CodeAnalysis;
|
||||||
|
|
||||||
namespace Ubiquity.NET.Llvm.DebugInfo
|
namespace LlvmBindings.DebugInfo
|
||||||
{
|
{
|
||||||
/// <summary>Array of <see cref="DILocalVariable"/> nodes for use with see <see cref="DebugInfoBuilder"/> methods</summary>
|
/// <summary>Array of <see cref="DILocalVariable"/> nodes for use with see <see cref="DebugInfoBuilder"/> methods</summary>
|
||||||
[SuppressMessage("Naming", "CA1710:Identifiers should have correct suffix", Justification = "Name matches underlying LLVM and is descriptive of what it is")]
|
[SuppressMessage("Naming", "CA1710:Identifiers should have correct suffix", Justification = "Name matches underlying LLVM and is descriptive of what it is")]
|
||||||
|
|
|
@ -5,9 +5,9 @@
|
||||||
// </copyright>
|
// </copyright>
|
||||||
// -----------------------------------------------------------------------
|
// -----------------------------------------------------------------------
|
||||||
|
|
||||||
using LLVMSharp.Interop;
|
using LlvmBindings.Interop;
|
||||||
|
|
||||||
namespace Ubiquity.NET.Llvm.DebugInfo
|
namespace LlvmBindings.DebugInfo
|
||||||
{
|
{
|
||||||
/// <summary>Debug source location information</summary>
|
/// <summary>Debug source location information</summary>
|
||||||
public class DILocation
|
public class DILocation
|
||||||
|
|
|
@ -5,9 +5,9 @@
|
||||||
// </copyright>
|
// </copyright>
|
||||||
// -----------------------------------------------------------------------
|
// -----------------------------------------------------------------------
|
||||||
|
|
||||||
using LLVMSharp.Interop;
|
using LlvmBindings.Interop;
|
||||||
|
|
||||||
namespace Ubiquity.NET.Llvm.DebugInfo
|
namespace LlvmBindings.DebugInfo
|
||||||
{
|
{
|
||||||
/// <summary>Pre-Processor macro</summary>
|
/// <summary>Pre-Processor macro</summary>
|
||||||
public class DIMacro
|
public class DIMacro
|
||||||
|
|
|
@ -5,9 +5,9 @@
|
||||||
// </copyright>
|
// </copyright>
|
||||||
// -----------------------------------------------------------------------
|
// -----------------------------------------------------------------------
|
||||||
|
|
||||||
using LLVMSharp.Interop;
|
using LlvmBindings.Interop;
|
||||||
|
|
||||||
namespace Ubiquity.NET.Llvm.DebugInfo
|
namespace LlvmBindings.DebugInfo
|
||||||
{
|
{
|
||||||
/// <summary>Macro file included by a unit</summary>
|
/// <summary>Macro file included by a unit</summary>
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
|
|
|
@ -5,9 +5,9 @@
|
||||||
// </copyright>
|
// </copyright>
|
||||||
// -----------------------------------------------------------------------
|
// -----------------------------------------------------------------------
|
||||||
|
|
||||||
using LLVMSharp.Interop;
|
using LlvmBindings.Interop;
|
||||||
|
|
||||||
namespace Ubiquity.NET.Llvm.DebugInfo
|
namespace LlvmBindings.DebugInfo
|
||||||
{
|
{
|
||||||
/// <summary>Base class for macro related nodes in the debug hierarchy</summary>
|
/// <summary>Base class for macro related nodes in the debug hierarchy</summary>
|
||||||
public class DIMacroNode
|
public class DIMacroNode
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
using System.Diagnostics.CodeAnalysis;
|
using System.Diagnostics.CodeAnalysis;
|
||||||
|
|
||||||
namespace Ubiquity.NET.Llvm.DebugInfo
|
namespace LlvmBindings.DebugInfo
|
||||||
{
|
{
|
||||||
/// <summary>Array of <see cref="DIMacroNode"/> debug information nodes for use with <see cref="DebugInfoBuilder"/> methods</summary>
|
/// <summary>Array of <see cref="DIMacroNode"/> debug information nodes for use with <see cref="DebugInfoBuilder"/> methods</summary>
|
||||||
[SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix", Justification = "This matches the wrapped native type")]
|
[SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix", Justification = "This matches the wrapped native type")]
|
||||||
|
|
|
@ -5,9 +5,9 @@
|
||||||
// </copyright>
|
// </copyright>
|
||||||
// -----------------------------------------------------------------------
|
// -----------------------------------------------------------------------
|
||||||
|
|
||||||
using LLVMSharp.Interop;
|
using LlvmBindings.Interop;
|
||||||
|
|
||||||
namespace Ubiquity.NET.Llvm.DebugInfo
|
namespace LlvmBindings.DebugInfo
|
||||||
{
|
{
|
||||||
/// <summary>A source module that is imported by a compile unit</summary>
|
/// <summary>A source module that is imported by a compile unit</summary>
|
||||||
public class DIModule
|
public class DIModule
|
||||||
|
|
|
@ -5,9 +5,9 @@
|
||||||
// </copyright>
|
// </copyright>
|
||||||
// -----------------------------------------------------------------------
|
// -----------------------------------------------------------------------
|
||||||
|
|
||||||
using LLVMSharp.Interop;
|
using LlvmBindings.Interop;
|
||||||
|
|
||||||
namespace Ubiquity.NET.Llvm.DebugInfo
|
namespace LlvmBindings.DebugInfo
|
||||||
{
|
{
|
||||||
/// <summary>Debug information namespace scope</summary>
|
/// <summary>Debug information namespace scope</summary>
|
||||||
/// <seealso href="xref:llvm_langref#dinamespace"/>
|
/// <seealso href="xref:llvm_langref#dinamespace"/>
|
||||||
|
|
|
@ -5,9 +5,9 @@
|
||||||
// </copyright>
|
// </copyright>
|
||||||
// -----------------------------------------------------------------------
|
// -----------------------------------------------------------------------
|
||||||
|
|
||||||
using LLVMSharp.Interop;
|
using LlvmBindings.Interop;
|
||||||
|
|
||||||
namespace Ubiquity.NET.Llvm.DebugInfo
|
namespace LlvmBindings.DebugInfo
|
||||||
{
|
{
|
||||||
/// <summary>Root of the object hierarchy for Debug information metadata nodes</summary>
|
/// <summary>Root of the object hierarchy for Debug information metadata nodes</summary>
|
||||||
public class DINode
|
public class DINode
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
using System.Diagnostics.CodeAnalysis;
|
using System.Diagnostics.CodeAnalysis;
|
||||||
|
|
||||||
namespace Ubiquity.NET.Llvm.DebugInfo
|
namespace LlvmBindings.DebugInfo
|
||||||
{
|
{
|
||||||
/// <summary>Array of <see cref="DINode"/> debug information nodes for use with <see cref="DebugInfoBuilder"/> methods</summary>
|
/// <summary>Array of <see cref="DINode"/> debug information nodes for use with <see cref="DebugInfoBuilder"/> methods</summary>
|
||||||
/// <seealso cref="DebugInfoBuilder.GetOrCreateArray(System.Collections.Generic.IEnumerable{DINode})"/>
|
/// <seealso cref="DebugInfoBuilder.GetOrCreateArray(System.Collections.Generic.IEnumerable{DINode})"/>
|
||||||
|
|
|
@ -5,9 +5,9 @@
|
||||||
// </copyright>
|
// </copyright>
|
||||||
// -----------------------------------------------------------------------
|
// -----------------------------------------------------------------------
|
||||||
|
|
||||||
using LLVMSharp.Interop;
|
using LlvmBindings.Interop;
|
||||||
|
|
||||||
namespace Ubiquity.NET.Llvm.DebugInfo
|
namespace LlvmBindings.DebugInfo
|
||||||
{
|
{
|
||||||
/// <summary>Objective-C Property</summary>
|
/// <summary>Objective-C Property</summary>
|
||||||
public class DIObjCProperty
|
public class DIObjCProperty
|
||||||
|
|
|
@ -5,9 +5,9 @@
|
||||||
// </copyright>
|
// </copyright>
|
||||||
// -----------------------------------------------------------------------
|
// -----------------------------------------------------------------------
|
||||||
|
|
||||||
using LLVMSharp.Interop;
|
using LlvmBindings.Interop;
|
||||||
|
|
||||||
namespace Ubiquity.NET.Llvm.DebugInfo
|
namespace LlvmBindings.DebugInfo
|
||||||
{
|
{
|
||||||
/// <summary>Base class for all Debug information scopes</summary>
|
/// <summary>Base class for all Debug information scopes</summary>
|
||||||
public class DIScope
|
public class DIScope
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
using System.Diagnostics.CodeAnalysis;
|
using System.Diagnostics.CodeAnalysis;
|
||||||
|
|
||||||
namespace Ubiquity.NET.Llvm.DebugInfo
|
namespace LlvmBindings.DebugInfo
|
||||||
{
|
{
|
||||||
/// <summary>Array of <see cref="DIScope"/> debug information nodes for use with <see cref="DebugInfoBuilder"/> methods</summary>
|
/// <summary>Array of <see cref="DIScope"/> debug information nodes for use with <see cref="DebugInfoBuilder"/> methods</summary>
|
||||||
[SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix", Justification = "This matches the wrapped native type")]
|
[SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix", Justification = "This matches the wrapped native type")]
|
||||||
|
|
|
@ -7,10 +7,10 @@
|
||||||
|
|
||||||
using System.Diagnostics.CodeAnalysis;
|
using System.Diagnostics.CodeAnalysis;
|
||||||
|
|
||||||
using LLVMSharp.Interop;
|
using LlvmBindings.Interop;
|
||||||
using Ubiquity.NET.Llvm.Values;
|
using LlvmBindings.Values;
|
||||||
|
|
||||||
namespace Ubiquity.NET.Llvm.DebugInfo
|
namespace LlvmBindings.DebugInfo
|
||||||
{
|
{
|
||||||
/// <summary>Debug information for a SubProgram</summary>
|
/// <summary>Debug information for a SubProgram</summary>
|
||||||
/// <seealso href="xref:llvm_langref#disubprogram"/>
|
/// <seealso href="xref:llvm_langref#disubprogram"/>
|
||||||
|
|
|
@ -7,10 +7,10 @@
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
using LLVMSharp.Interop;
|
using LlvmBindings.Interop;
|
||||||
using Ubiquity.NET.Llvm.Values;
|
using LlvmBindings.Values;
|
||||||
|
|
||||||
namespace Ubiquity.NET.Llvm.DebugInfo
|
namespace LlvmBindings.DebugInfo
|
||||||
{
|
{
|
||||||
/// <summary>Sub range</summary>
|
/// <summary>Sub range</summary>
|
||||||
/// <seealso href="xref:llvm_langref#disubrange">LLVM DISubRange</seealso>
|
/// <seealso href="xref:llvm_langref#disubrange">LLVM DISubRange</seealso>
|
||||||
|
|
|
@ -5,9 +5,9 @@
|
||||||
// </copyright>
|
// </copyright>
|
||||||
// -----------------------------------------------------------------------
|
// -----------------------------------------------------------------------
|
||||||
|
|
||||||
using LLVMSharp.Interop;
|
using LlvmBindings.Interop;
|
||||||
|
|
||||||
namespace Ubiquity.NET.Llvm.DebugInfo
|
namespace LlvmBindings.DebugInfo
|
||||||
{
|
{
|
||||||
/// <summary>Debug information for a function signature</summary>
|
/// <summary>Debug information for a function signature</summary>
|
||||||
/// <seealso href="xref:llvm_langref#disubroutinetype"/>
|
/// <seealso href="xref:llvm_langref#disubroutinetype"/>
|
||||||
|
|
|
@ -5,9 +5,9 @@
|
||||||
// </copyright>
|
// </copyright>
|
||||||
// -----------------------------------------------------------------------
|
// -----------------------------------------------------------------------
|
||||||
|
|
||||||
using LLVMSharp.Interop;
|
using LlvmBindings.Interop;
|
||||||
|
|
||||||
namespace Ubiquity.NET.Llvm.DebugInfo
|
namespace LlvmBindings.DebugInfo
|
||||||
{
|
{
|
||||||
/// <summary>Base class for template parameter information</summary>
|
/// <summary>Base class for template parameter information</summary>
|
||||||
/// <seealso cref="DITemplateTypeParameter"/>
|
/// <seealso cref="DITemplateTypeParameter"/>
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
using System.Diagnostics.CodeAnalysis;
|
using System.Diagnostics.CodeAnalysis;
|
||||||
|
|
||||||
namespace Ubiquity.NET.Llvm.DebugInfo
|
namespace LlvmBindings.DebugInfo
|
||||||
{
|
{
|
||||||
/// <summary>Array of <see cref="DITemplateParameter"/> nodes for use with see <see cref="DebugInfoBuilder"/> methods</summary>
|
/// <summary>Array of <see cref="DITemplateParameter"/> nodes for use with see <see cref="DebugInfoBuilder"/> methods</summary>
|
||||||
[SuppressMessage("Naming", "CA1710:Identifiers should have correct suffix", Justification = "Name matches underlying LLVM and is descriptive of what it is")]
|
[SuppressMessage("Naming", "CA1710:Identifiers should have correct suffix", Justification = "Name matches underlying LLVM and is descriptive of what it is")]
|
||||||
|
|
|
@ -5,9 +5,9 @@
|
||||||
// </copyright>
|
// </copyright>
|
||||||
// -----------------------------------------------------------------------
|
// -----------------------------------------------------------------------
|
||||||
|
|
||||||
using LLVMSharp.Interop;
|
using LlvmBindings.Interop;
|
||||||
|
|
||||||
namespace Ubiquity.NET.Llvm.DebugInfo
|
namespace LlvmBindings.DebugInfo
|
||||||
{
|
{
|
||||||
/// <summary>Template type parameter</summary>
|
/// <summary>Template type parameter</summary>
|
||||||
/// <seealso href="xref:llvm_langref#ditemplatetypeparameter">LLVM DITemplateTypeParameter</seealso>
|
/// <seealso href="xref:llvm_langref#ditemplatetypeparameter">LLVM DITemplateTypeParameter</seealso>
|
||||||
|
|
|
@ -5,9 +5,9 @@
|
||||||
// </copyright>
|
// </copyright>
|
||||||
// -----------------------------------------------------------------------
|
// -----------------------------------------------------------------------
|
||||||
|
|
||||||
using LLVMSharp.Interop;
|
using LlvmBindings.Interop;
|
||||||
|
|
||||||
namespace Ubiquity.NET.Llvm.DebugInfo
|
namespace LlvmBindings.DebugInfo
|
||||||
{
|
{
|
||||||
/// <summary>Template Value parameter</summary>
|
/// <summary>Template Value parameter</summary>
|
||||||
/// <seealso href="xref:llvm_langref#ditemplatevalueparameter">LLVM DITemplateValueParameter</seealso>
|
/// <seealso href="xref:llvm_langref#ditemplatevalueparameter">LLVM DITemplateValueParameter</seealso>
|
||||||
|
|
|
@ -7,9 +7,9 @@
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
using LLVMSharp.Interop;
|
using LlvmBindings.Interop;
|
||||||
|
|
||||||
namespace Ubiquity.NET.Llvm.DebugInfo
|
namespace LlvmBindings.DebugInfo
|
||||||
{
|
{
|
||||||
/// <summary>Base class for Debug info types</summary>
|
/// <summary>Base class for Debug info types</summary>
|
||||||
/// <seealso href="xref:llvm_langref#ditype">LLVM DIType</seealso>
|
/// <seealso href="xref:llvm_langref#ditype">LLVM DIType</seealso>
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
using System.Diagnostics.CodeAnalysis;
|
using System.Diagnostics.CodeAnalysis;
|
||||||
|
|
||||||
namespace Ubiquity.NET.Llvm.DebugInfo
|
namespace LlvmBindings.DebugInfo
|
||||||
{
|
{
|
||||||
/// <summary>Array of <see cref="DIType"/> nodes for use with see <see cref="DebugInfoBuilder"/> methods</summary>
|
/// <summary>Array of <see cref="DIType"/> nodes for use with see <see cref="DebugInfoBuilder"/> methods</summary>
|
||||||
[SuppressMessage("Naming", "CA1710:Identifiers should have correct suffix", Justification = "Name matches underlying LLVM and is descriptive of what it is")]
|
[SuppressMessage("Naming", "CA1710:Identifiers should have correct suffix", Justification = "Name matches underlying LLVM and is descriptive of what it is")]
|
||||||
|
|
|
@ -7,9 +7,9 @@
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
using LLVMSharp.Interop;
|
using LlvmBindings.Interop;
|
||||||
|
|
||||||
namespace Ubiquity.NET.Llvm.DebugInfo
|
namespace LlvmBindings.DebugInfo
|
||||||
{
|
{
|
||||||
/// <summary>Debug information for a variable</summary>
|
/// <summary>Debug information for a variable</summary>
|
||||||
public class DIVariable
|
public class DIVariable
|
||||||
|
|
|
@ -7,11 +7,11 @@
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
using LLVMSharp.Interop;
|
using LlvmBindings.Interop;
|
||||||
|
|
||||||
using Ubiquity.NET.Llvm.Types;
|
using LlvmBindings.Types;
|
||||||
|
|
||||||
namespace Ubiquity.NET.Llvm.DebugInfo
|
namespace LlvmBindings.DebugInfo
|
||||||
{
|
{
|
||||||
/// <summary>Provides debug information binding between an <see cref="IArrayType"/> and a <see cref="DICompositeType"/></summary>
|
/// <summary>Provides debug information binding between an <see cref="IArrayType"/> and a <see cref="DICompositeType"/></summary>
|
||||||
/// <seealso href="xref:llvm_langref#dicompositetype">DICompositeType</seealso>
|
/// <seealso href="xref:llvm_langref#dicompositetype">DICompositeType</seealso>
|
||||||
|
|
|
@ -7,9 +7,9 @@
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
using Ubiquity.NET.Llvm.Types;
|
using LlvmBindings.Types;
|
||||||
|
|
||||||
namespace Ubiquity.NET.Llvm.DebugInfo
|
namespace LlvmBindings.DebugInfo
|
||||||
{
|
{
|
||||||
/// <summary>Debug information binding between an LLVM native <see cref="ITypeRef"/> and a <see cref="DIBasicType"/></summary>
|
/// <summary>Debug information binding between an LLVM native <see cref="ITypeRef"/> and a <see cref="DIBasicType"/></summary>
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
|
|
|
@ -8,9 +8,9 @@
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
|
||||||
using Ubiquity.NET.Llvm.Types;
|
using LlvmBindings.Types;
|
||||||
|
|
||||||
namespace Ubiquity.NET.Llvm.DebugInfo
|
namespace LlvmBindings.DebugInfo
|
||||||
{
|
{
|
||||||
/// <summary>This class provides debug information binding for an <see cref="IFunctionType"/>
|
/// <summary>This class provides debug information binding for an <see cref="IFunctionType"/>
|
||||||
/// and a <see cref="DISubroutineType"/>
|
/// and a <see cref="DISubroutineType"/>
|
||||||
|
@ -34,7 +34,7 @@ namespace Ubiquity.NET.Llvm.DebugInfo
|
||||||
/// <note type="note">It is important to keep in mind that signatures are only concerned
|
/// <note type="note">It is important to keep in mind that signatures are only concerned
|
||||||
/// with types. That is, they do not include names of parameters. Parameter information is
|
/// with types. That is, they do not include names of parameters. Parameter information is
|
||||||
/// provided by <see cref="DebugInfoBuilder.CreateArgument(DIScope, string, DIFile, uint, DIType, bool, DebugInfoFlags, ushort)"/>
|
/// provided by <see cref="DebugInfoBuilder.CreateArgument(DIScope, string, DIFile, uint, DIType, bool, DebugInfoFlags, ushort)"/>
|
||||||
/// and [DebugInfoBuilder.InsertDeclare](xref:Ubiquity.NET.Llvm.DebugInfo.DebugInfoBuilder.InsertDeclare*)</note>
|
/// and [DebugInfoBuilder.InsertDeclare](xref:LlvmBindings.DebugInfo.DebugInfoBuilder.InsertDeclare*)</note>
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
/// <seealso href="xref:llvm_langref#disubroutinetype">LLVM DISubroutineType</seealso>
|
/// <seealso href="xref:llvm_langref#disubroutinetype">LLVM DISubroutineType</seealso>
|
||||||
public class DebugFunctionType
|
public class DebugFunctionType
|
||||||
|
|
|
@ -8,15 +8,13 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Diagnostics.CodeAnalysis;
|
using System.Diagnostics.CodeAnalysis;
|
||||||
using System.Globalization;
|
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using LlvmBindings.Instructions;
|
||||||
using LLVMSharp.Interop;
|
using LlvmBindings.Interop;
|
||||||
using Ubiquity.NET.Llvm.Instructions;
|
using LlvmBindings.Values;
|
||||||
using Ubiquity.NET.Llvm.Values;
|
|
||||||
|
|
||||||
namespace Ubiquity.NET.Llvm.DebugInfo
|
namespace LlvmBindings.DebugInfo
|
||||||
{
|
{
|
||||||
/// <summary>Defines the amount of debug information to emit</summary>
|
/// <summary>Defines the amount of debug information to emit</summary>
|
||||||
public enum DwarfEmissionKind
|
public enum DwarfEmissionKind
|
||||||
|
@ -226,7 +224,17 @@ namespace Ubiquity.NET.Llvm.DebugInfo
|
||||||
/// </returns>
|
/// </returns>
|
||||||
public DIFile CreateFile(string? fileName, string? directory)
|
public DIFile CreateFile(string? fileName, string? directory)
|
||||||
{
|
{
|
||||||
var handle = this.BuilderHandle.CreateFile(fileName, directory);
|
if (fileName == null)
|
||||||
|
{
|
||||||
|
throw new ArgumentNullException(nameof(fileName));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (directory == null)
|
||||||
|
{
|
||||||
|
throw new ArgumentNullException(nameof(directory));
|
||||||
|
}
|
||||||
|
|
||||||
|
var handle = this.BuilderHandle.CreateFile(fileName!, directory!);
|
||||||
return MDNode.FromHandle<DIFile>(handle)!;
|
return MDNode.FromHandle<DIFile>(handle)!;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,9 +5,9 @@
|
||||||
// </copyright>
|
// </copyright>
|
||||||
// -----------------------------------------------------------------------
|
// -----------------------------------------------------------------------
|
||||||
|
|
||||||
using Ubiquity.NET.Llvm.Types;
|
using LlvmBindings.Types;
|
||||||
|
|
||||||
namespace Ubiquity.NET.Llvm.DebugInfo
|
namespace LlvmBindings.DebugInfo
|
||||||
{
|
{
|
||||||
/// <summary>Describes a member/field of a type for creating debug information</summary>
|
/// <summary>Describes a member/field of a type for creating debug information</summary>
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
|
@ -64,7 +64,7 @@ namespace Ubiquity.NET.Llvm.DebugInfo
|
||||||
public IDebugType<ITypeRef, DIType> DebugType { get; }
|
public IDebugType<ITypeRef, DIType> DebugType { get; }
|
||||||
|
|
||||||
/// <summary>Gets the explicit layout information for this member</summary>
|
/// <summary>Gets the explicit layout information for this member</summary>
|
||||||
/// <remarks>If this is <see langword="null"/> then <see href="xref:Ubiquity.NET.Llvm.DebugInfo.DebugStructType.SetBody*">DebugStructType.SetBody</see>
|
/// <remarks>If this is <see langword="null"/> then <see href="xref:LlvmBindings.DebugInfo.DebugStructType.SetBody*">DebugStructType.SetBody</see>
|
||||||
/// will default to using <see cref="BitcodeModule.Layout"/> to determine the size using the module's target specific layout.
|
/// will default to using <see cref="BitcodeModule.Layout"/> to determine the size using the module's target specific layout.
|
||||||
/// <note type="Important">
|
/// <note type="Important">
|
||||||
/// If this property is provided (e.g. is not <see langword="null"/>) for any member of a type, then
|
/// If this property is provided (e.g. is not <see langword="null"/>) for any member of a type, then
|
||||||
|
|
|
@ -5,12 +5,12 @@
|
||||||
// </copyright>
|
// </copyright>
|
||||||
// -----------------------------------------------------------------------
|
// -----------------------------------------------------------------------
|
||||||
|
|
||||||
namespace Ubiquity.NET.Llvm.DebugInfo
|
namespace LlvmBindings.DebugInfo
|
||||||
{
|
{
|
||||||
/// <summary>DebugMemberLayout is used to define custom layout information for structure members</summary>
|
/// <summary>DebugMemberLayout is used to define custom layout information for structure members</summary>
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
/// Ordinarily layout information is handle automatically in
|
/// Ordinarily layout information is handle automatically in
|
||||||
/// <see href="xref:Ubiquity.NET.Llvm.DebugInfo.DebugStructType.SetBody*">DebugStructType.SetBody</see>
|
/// <see href="xref:LlvmBindings.DebugInfo.DebugStructType.SetBody*">DebugStructType.SetBody</see>
|
||||||
/// however in cases where explicitly controlled (or "packed") layout is required, instances of DebugMemberLayout are
|
/// however in cases where explicitly controlled (or "packed") layout is required, instances of DebugMemberLayout are
|
||||||
/// used to provide the information necessary to generate a proper type and debug information.
|
/// used to provide the information necessary to generate a proper type and debug information.
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
|
|
|
@ -5,9 +5,9 @@
|
||||||
// </copyright>
|
// </copyright>
|
||||||
// -----------------------------------------------------------------------
|
// -----------------------------------------------------------------------
|
||||||
|
|
||||||
using Ubiquity.NET.Llvm.Types;
|
using LlvmBindings.Types;
|
||||||
|
|
||||||
namespace Ubiquity.NET.Llvm.DebugInfo
|
namespace LlvmBindings.DebugInfo
|
||||||
{
|
{
|
||||||
/// <summary>Binding between a <see cref="DIDerivedType"/> and an <see cref="IPointerType"/></summary>
|
/// <summary>Binding between a <see cref="DIDerivedType"/> and an <see cref="IPointerType"/></summary>
|
||||||
/// <seealso href="xref:llvm_langref#diderivedtype">LLVM DIDerivedType</seealso>
|
/// <seealso href="xref:llvm_langref#diderivedtype">LLVM DIDerivedType</seealso>
|
||||||
|
|
|
@ -10,9 +10,9 @@ using System.Collections.Generic;
|
||||||
using System.Collections.ObjectModel;
|
using System.Collections.ObjectModel;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
|
||||||
using Ubiquity.NET.Llvm.Types;
|
using LlvmBindings.Types;
|
||||||
|
|
||||||
namespace Ubiquity.NET.Llvm.DebugInfo
|
namespace LlvmBindings.DebugInfo
|
||||||
{
|
{
|
||||||
/// <summary>Debug information for a structure type</summary>
|
/// <summary>Debug information for a structure type</summary>
|
||||||
/// <seealso href="xref:llvm_langref#dicompositetype">LLVM DICompositeType</seealso>
|
/// <seealso href="xref:llvm_langref#dicompositetype">LLVM DICompositeType</seealso>
|
||||||
|
|
|
@ -8,14 +8,14 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Diagnostics.CodeAnalysis;
|
using System.Diagnostics.CodeAnalysis;
|
||||||
|
|
||||||
using LLVMSharp.Interop;
|
using LlvmBindings.Interop;
|
||||||
|
|
||||||
using Ubiquity.NET.Llvm.Types;
|
using LlvmBindings.Types;
|
||||||
using Ubiquity.NET.Llvm.Values;
|
using LlvmBindings.Values;
|
||||||
|
|
||||||
#pragma warning disable SA1649 // File name must match first type ( Justification - Interface + internal Impl + public extensions )
|
#pragma warning disable SA1649 // File name must match first type ( Justification - Interface + internal Impl + public extensions )
|
||||||
|
|
||||||
namespace Ubiquity.NET.Llvm.DebugInfo
|
namespace LlvmBindings.DebugInfo
|
||||||
{
|
{
|
||||||
/// <summary>Provides pairing of a <see cref="ITypeRef"/> with a <see cref="DIType"/> for function signatures</summary>
|
/// <summary>Provides pairing of a <see cref="ITypeRef"/> with a <see cref="DIType"/> for function signatures</summary>
|
||||||
/// <typeparam name="TNative">Native LLVM type</typeparam>
|
/// <typeparam name="TNative">Native LLVM type</typeparam>
|
||||||
|
|
|
@ -10,9 +10,9 @@ using System.Collections.Generic;
|
||||||
using System.Collections.ObjectModel;
|
using System.Collections.ObjectModel;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
|
||||||
using Ubiquity.NET.Llvm.Types;
|
using LlvmBindings.Types;
|
||||||
|
|
||||||
namespace Ubiquity.NET.Llvm.DebugInfo
|
namespace LlvmBindings.DebugInfo
|
||||||
{
|
{
|
||||||
/// <summary>Debug representation of a union type</summary>
|
/// <summary>Debug representation of a union type</summary>
|
||||||
/// <remarks>The underlying native LLVM type is a structure with a single member</remarks>
|
/// <remarks>The underlying native LLVM type is a structure with a single member</remarks>
|
||||||
|
|
|
@ -8,13 +8,13 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Diagnostics.CodeAnalysis;
|
using System.Diagnostics.CodeAnalysis;
|
||||||
|
|
||||||
using LLVMSharp.Interop;
|
using LlvmBindings.Interop;
|
||||||
|
|
||||||
// The names describe what they are, further details are available in the DWARF specs
|
// The names describe what they are, further details are available in the DWARF specs
|
||||||
#pragma warning disable CS1591, SA1600, SA1602 // Enumeration items must be documented
|
#pragma warning disable CS1591, SA1600, SA1602 // Enumeration items must be documented
|
||||||
|
|
||||||
// ReSharper disable IdentifierTypo
|
// ReSharper disable IdentifierTypo
|
||||||
namespace Ubiquity.NET.Llvm.DebugInfo
|
namespace LlvmBindings.DebugInfo
|
||||||
{
|
{
|
||||||
/// <summary>DWARF Debug information language</summary>
|
/// <summary>DWARF Debug information language</summary>
|
||||||
public enum SourceLanguage
|
public enum SourceLanguage
|
||||||
|
@ -66,10 +66,10 @@ namespace Ubiquity.NET.Llvm.DebugInfo
|
||||||
/// <summary>Base value for unofficial languages ids</summary>
|
/// <summary>Base value for unofficial languages ids</summary>
|
||||||
UserMin = 0x8000,
|
UserMin = 0x8000,
|
||||||
|
|
||||||
/// <summary>[Ubiquity.NET.Llvm] C# Language</summary>
|
/// <summary>[LlvmBindings] C# Language</summary>
|
||||||
CSharp = UserMin + 0x01000,
|
CSharp = UserMin + 0x01000,
|
||||||
|
|
||||||
/// <summary>[Ubiquity.NET.Llvm] .NET IL Assembly language (ILAsm)</summary>
|
/// <summary>[LlvmBindings] .NET IL Assembly language (ILAsm)</summary>
|
||||||
ILAsm = UserMin + 0x01001,
|
ILAsm = UserMin + 0x01001,
|
||||||
|
|
||||||
/// <summary>Max Value for unofficial language ids</summary>
|
/// <summary>Max Value for unofficial language ids</summary>
|
||||||
|
|
|
@ -5,9 +5,9 @@
|
||||||
// </copyright>
|
// </copyright>
|
||||||
// -----------------------------------------------------------------------
|
// -----------------------------------------------------------------------
|
||||||
|
|
||||||
using LLVMSharp.Interop;
|
using LlvmBindings.Interop;
|
||||||
|
|
||||||
namespace Ubiquity.NET.Llvm.DebugInfo
|
namespace LlvmBindings.DebugInfo
|
||||||
{
|
{
|
||||||
/// <summary>Generic tagged DWARF-like Metadata node</summary>
|
/// <summary>Generic tagged DWARF-like Metadata node</summary>
|
||||||
public class GenericDINode
|
public class GenericDINode
|
||||||
|
|
|
@ -10,7 +10,7 @@ using System.Collections.Generic;
|
||||||
using System.Diagnostics.CodeAnalysis;
|
using System.Diagnostics.CodeAnalysis;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
|
||||||
namespace Ubiquity.NET.Llvm.DebugInfo
|
namespace LlvmBindings.DebugInfo
|
||||||
{
|
{
|
||||||
/// <summary>Generic wrapper to treat an MDTuple as an array of elements of specific type</summary>
|
/// <summary>Generic wrapper to treat an MDTuple as an array of elements of specific type</summary>
|
||||||
/// <typeparam name="T">Type of elements</typeparam>
|
/// <typeparam name="T">Type of elements</typeparam>
|
||||||
|
|
|
@ -6,7 +6,7 @@ using System;
|
||||||
using System.Diagnostics.CodeAnalysis;
|
using System.Diagnostics.CodeAnalysis;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
|
|
||||||
namespace Ubiquity.NET.Llvm.Interop
|
namespace LlvmBindings.Interop
|
||||||
{
|
{
|
||||||
/// <summary>Abstract base class for implementing the Disposable pattern.</summary>
|
/// <summary>Abstract base class for implementing the Disposable pattern.</summary>
|
||||||
public abstract class DisposableObject
|
public abstract class DisposableObject
|
||||||
|
|
|
@ -9,7 +9,7 @@ using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Diagnostics.CodeAnalysis;
|
using System.Diagnostics.CodeAnalysis;
|
||||||
|
|
||||||
namespace Ubiquity.NET.Llvm
|
namespace LlvmBindings
|
||||||
{
|
{
|
||||||
/// <summary>Common implementation of <see cref="IExtensiblePropertyContainer"/></summary>
|
/// <summary>Common implementation of <see cref="IExtensiblePropertyContainer"/></summary>
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace LLVMSharp.Interop
|
namespace LlvmBindings.Interop
|
||||||
{
|
{
|
||||||
/// <summary>Extensions for <see cref="LLVMDIBuilderRef"/>.</summary>
|
/// <summary>Extensions for <see cref="LLVMDIBuilderRef"/>.</summary>
|
||||||
public static unsafe class LLVMDIBuilderRefExtensions
|
public static unsafe class LLVMDIBuilderRefExtensions
|
|
@ -0,0 +1,17 @@
|
||||||
|
// Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT).
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
|
namespace LlvmBindings.Interop
|
||||||
|
{
|
||||||
|
public unsafe partial struct LLVMMCJITCompilerOptions
|
||||||
|
{
|
||||||
|
public static LLVMMCJITCompilerOptions Create()
|
||||||
|
{
|
||||||
|
LLVMMCJITCompilerOptions options;
|
||||||
|
LLVM.InitializeMCJITCompilerOptions(&options, (UIntPtr)Marshal.SizeOf<LLVMMCJITCompilerOptions>());
|
||||||
|
return options;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace LLVMSharp.Interop
|
namespace LlvmBindings.Interop
|
||||||
{
|
{
|
||||||
/// <summary>Extensions for <see cref="LLVMMemoryBufferRef"/>.</summary>
|
/// <summary>Extensions for <see cref="LLVMMemoryBufferRef"/>.</summary>
|
||||||
public static unsafe class LLVMMemoryBufferRefExtensions
|
public static unsafe class LLVMMemoryBufferRefExtensions
|
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace LLVMSharp.Interop
|
namespace LlvmBindings.Interop
|
||||||
{
|
{
|
||||||
/// <summary>Extensions for <see cref="LLVMMetadataRef"/>.</summary>
|
/// <summary>Extensions for <see cref="LLVMMetadataRef"/>.</summary>
|
||||||
public static unsafe class LLVMMetadataRefExtensions
|
public static unsafe class LLVMMetadataRefExtensions
|
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace LLVMSharp.Interop
|
namespace LlvmBindings.Interop
|
||||||
{
|
{
|
||||||
/// <summary>Extensions for <see cref="LLVMModuleFlagEntry"/>.</summary>
|
/// <summary>Extensions for <see cref="LLVMModuleFlagEntry"/>.</summary>
|
||||||
public static unsafe class LLVMModuleFlagEntryExtensions
|
public static unsafe class LLVMModuleFlagEntryExtensions
|
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace LLVMSharp.Interop
|
namespace LlvmBindings.Interop
|
||||||
{
|
{
|
||||||
/// <summary>Extensions for <see cref="LLVMModuleRef"/>.</summary>
|
/// <summary>Extensions for <see cref="LLVMModuleRef"/>.</summary>
|
||||||
public static unsafe class LLVMModuleRefExtensions
|
public static unsafe class LLVMModuleRefExtensions
|
||||||
|
@ -31,9 +31,6 @@ namespace LLVMSharp.Interop
|
||||||
return new ReadOnlySpan<byte>(pStr, (int)len).AsString();
|
return new ReadOnlySpan<byte>(pStr, (int)len).AsString();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>Convenience wrapper for <see cref="LLVM.LinkModules2"/>.</summary>
|
|
||||||
public static bool Link(this LLVMModuleRef self, LLVMModuleRef other) => LLVM.LinkModules2(self, other) == 0;
|
|
||||||
|
|
||||||
/// <summary>Convenience wrapper for <see cref="LLVM.AddGlobalIFunc"/>.</summary>
|
/// <summary>Convenience wrapper for <see cref="LLVM.AddGlobalIFunc"/>.</summary>
|
||||||
public static LLVMValueRef AddGlobalIFunc(this LLVMModuleRef self, string name, LLVMTypeRef typeRef, uint addrSpace, LLVMValueRef resolver)
|
public static LLVMValueRef AddGlobalIFunc(this LLVMModuleRef self, string name, LLVMTypeRef typeRef, uint addrSpace, LLVMValueRef resolver)
|
||||||
{
|
{
|
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace LLVMSharp.Interop
|
namespace LlvmBindings.Interop
|
||||||
{
|
{
|
||||||
/// <summary>Extensions for <see cref="LLVMNamedMDNodeRef"/>.</summary>
|
/// <summary>Extensions for <see cref="LLVMNamedMDNodeRef"/>.</summary>
|
||||||
public static unsafe class LLVMNamedMDNodeRefExtensions
|
public static unsafe class LLVMNamedMDNodeRefExtensions
|
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace LLVMSharp.Interop
|
namespace LlvmBindings.Interop
|
||||||
{
|
{
|
||||||
/// <summary>Extensions for <see cref="LLVMTargetDataRef"/>.</summary>
|
/// <summary>Extensions for <see cref="LLVMTargetDataRef"/>.</summary>
|
||||||
public static unsafe class LLVMTargetDataRefExtensions
|
public static unsafe class LLVMTargetDataRefExtensions
|
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace LLVMSharp.Interop
|
namespace LlvmBindings.Interop
|
||||||
{
|
{
|
||||||
/// <summary>Extensions for <see cref="LLVMUseRef"/>.</summary>
|
/// <summary>Extensions for <see cref="LLVMUseRef"/>.</summary>
|
||||||
public static unsafe class LLVMUseRefExtensions
|
public static unsafe class LLVMUseRefExtensions
|
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace LLVMSharp.Interop
|
namespace LlvmBindings.Interop
|
||||||
{
|
{
|
||||||
/// <summary>Support for refs to LLVMOpaqueValueMetadataEntry*.</summary>
|
/// <summary>Support for refs to LLVMOpaqueValueMetadataEntry*.</summary>
|
||||||
public unsafe partial struct LLVMValueMetadataEntryRef : IEquatable<LLVMValueMetadataEntryRef>
|
public unsafe partial struct LLVMValueMetadataEntryRef : IEquatable<LLVMValueMetadataEntryRef>
|
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace LLVMSharp.Interop
|
namespace LlvmBindings.Interop
|
||||||
{
|
{
|
||||||
/// <summary>Extensions for <see cref="LLVMValueRef"/>.</summary>
|
/// <summary>Extensions for <see cref="LLVMValueRef"/>.</summary>
|
||||||
public static unsafe class LLVMValueRefExtensions
|
public static unsafe class LLVMValueRefExtensions
|
|
@ -7,9 +7,9 @@ using System;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
namespace LLVMSharp.Interop
|
namespace LlvmBindings.Interop
|
||||||
{
|
{
|
||||||
internal unsafe struct MarshaledString : IDisposable
|
public unsafe struct MarshaledString : IDisposable
|
||||||
{
|
{
|
||||||
public MarshaledString(ReadOnlySpan<char> input)
|
public MarshaledString(ReadOnlySpan<char> input)
|
||||||
{
|
{
|
|
@ -0,0 +1,58 @@
|
||||||
|
// Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT).
|
||||||
|
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace LlvmBindings.Interop
|
||||||
|
{
|
||||||
|
public unsafe struct MarshaledStringArray : IDisposable
|
||||||
|
{
|
||||||
|
public MarshaledStringArray(ReadOnlySpan<string> inputs)
|
||||||
|
{
|
||||||
|
if (inputs.IsEmpty)
|
||||||
|
{
|
||||||
|
this.Count = 0;
|
||||||
|
this.Values = null;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
this.Count = inputs.Length;
|
||||||
|
this.Values = new MarshaledString[this.Count];
|
||||||
|
|
||||||
|
for (int i = 0; i < this.Count; i++)
|
||||||
|
{
|
||||||
|
this.Values[i] = new MarshaledString(inputs[i].AsSpan());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public int Count { get; private set; }
|
||||||
|
|
||||||
|
public MarshaledString[]? Values { get; private set; }
|
||||||
|
|
||||||
|
public void Dispose()
|
||||||
|
{
|
||||||
|
var values = this.Values;
|
||||||
|
if (values is object)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < values.Length; i++)
|
||||||
|
{
|
||||||
|
values[i].Dispose();
|
||||||
|
}
|
||||||
|
|
||||||
|
this.Values = null;
|
||||||
|
this.Count = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Fill(sbyte** pDestination)
|
||||||
|
{
|
||||||
|
if (this.Values is object)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < this.Count; i++)
|
||||||
|
{
|
||||||
|
pDestination[i] = this.Values[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -6,9 +6,9 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
namespace LLVMSharp.Interop
|
namespace LlvmBindings.Interop
|
||||||
{
|
{
|
||||||
internal static unsafe class SpanExtensions
|
public static unsafe class SpanExtensions
|
||||||
{
|
{
|
||||||
public static string AsString(this Span<byte> self) => AsString((ReadOnlySpan<byte>)self);
|
public static string AsString(this Span<byte> self) => AsString((ReadOnlySpan<byte>)self);
|
||||||
|
|
|
@ -6,9 +6,9 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
namespace LLVMSharp.Interop
|
namespace LlvmBindings.Interop
|
||||||
{
|
{
|
||||||
internal static unsafe class StringExtensions
|
public static unsafe class StringExtensions
|
||||||
{
|
{
|
||||||
public static MarshaledString AsMarshaledString(this string self)
|
public static MarshaledString AsMarshaledString(this string self)
|
||||||
{
|
{
|
|
@ -10,7 +10,7 @@ using System.Collections;
|
||||||
using System.Collections.Concurrent;
|
using System.Collections.Concurrent;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace Ubiquity.NET.Llvm
|
namespace LlvmBindings
|
||||||
{
|
{
|
||||||
internal abstract class HandleInterningMap<THandle, TMappedType>
|
internal abstract class HandleInterningMap<THandle, TMappedType>
|
||||||
: IHandleInterning<THandle, TMappedType>
|
: IHandleInterning<THandle, TMappedType>
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
// </copyright>
|
// </copyright>
|
||||||
// -----------------------------------------------------------------------
|
// -----------------------------------------------------------------------
|
||||||
|
|
||||||
namespace Ubiquity.NET.Llvm
|
namespace LlvmBindings
|
||||||
{
|
{
|
||||||
/// <summary>Interface for a <see cref="BitcodeModule"/> factory.</summary>
|
/// <summary>Interface for a <see cref="BitcodeModule"/> factory.</summary>
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
using System.Diagnostics.CodeAnalysis;
|
using System.Diagnostics.CodeAnalysis;
|
||||||
|
|
||||||
namespace Ubiquity.NET.Llvm
|
namespace LlvmBindings
|
||||||
{
|
{
|
||||||
/// <summary>Interface to allow adding arbitrary named data items to an object</summary>
|
/// <summary>Interface to allow adding arbitrary named data items to an object</summary>
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
|
|
|
@ -12,7 +12,7 @@ using System.Collections.Generic;
|
||||||
// gripes about these for interfaces...
|
// gripes about these for interfaces...
|
||||||
#pragma warning disable SA1600
|
#pragma warning disable SA1600
|
||||||
|
|
||||||
namespace Ubiquity.NET.Llvm
|
namespace LlvmBindings
|
||||||
{
|
{
|
||||||
internal interface IHandleInterning<THandle, TMappedType>
|
internal interface IHandleInterning<THandle, TMappedType>
|
||||||
: IEnumerable<TMappedType>
|
: IEnumerable<TMappedType>
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace Ubiquity.NET.Llvm.Interop
|
namespace LlvmBindings.Interop
|
||||||
{
|
{
|
||||||
/// <summary>Code gen target to register/initialize.</summary>
|
/// <summary>Code gen target to register/initialize.</summary>
|
||||||
public enum CodeGenTarget
|
public enum CodeGenTarget
|
||||||
|
@ -111,9 +111,5 @@ namespace Ubiquity.NET.Llvm.Interop
|
||||||
public interface ILibLlvm
|
public interface ILibLlvm
|
||||||
: IDisposable
|
: IDisposable
|
||||||
{
|
{
|
||||||
/// <summary>Registers components for ARM AArch64 target(s).</summary>
|
|
||||||
/// <param name="target">Target architecture to register/initialize.</param>
|
|
||||||
/// <param name="registrations">Flags indicating which components to register/enable.</param>
|
|
||||||
void RegisterTarget(CodeGenTarget target, TargetRegistrations registrations = TargetRegistrations.All);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace Ubiquity.NET.Llvm
|
namespace LlvmBindings
|
||||||
{
|
{
|
||||||
/// <summary>Interface for a fixed shape collection of operands.</summary>
|
/// <summary>Interface for a fixed shape collection of operands.</summary>
|
||||||
/// <typeparam name="T">Type of elements in the container.</typeparam>
|
/// <typeparam name="T">Type of elements in the container.</typeparam>
|
||||||
|
|
|
@ -5,9 +5,9 @@
|
||||||
// </copyright>
|
// </copyright>
|
||||||
// -----------------------------------------------------------------------
|
// -----------------------------------------------------------------------
|
||||||
|
|
||||||
using LLVMSharp.Interop;
|
using LlvmBindings.Interop;
|
||||||
|
|
||||||
namespace Ubiquity.NET.Llvm.Instructions
|
namespace LlvmBindings.Instructions
|
||||||
{
|
{
|
||||||
/// <summary>Address space cast instruction.</summary>
|
/// <summary>Address space cast instruction.</summary>
|
||||||
/// <seealso href="xref:llvm_langref#addrspaceast-to-instruction">LLVM addrspacecast .. to</seealso>
|
/// <seealso href="xref:llvm_langref#addrspaceast-to-instruction">LLVM addrspacecast .. to</seealso>
|
||||||
|
|
|
@ -5,10 +5,10 @@
|
||||||
// </copyright>
|
// </copyright>
|
||||||
// -----------------------------------------------------------------------
|
// -----------------------------------------------------------------------
|
||||||
|
|
||||||
using LLVMSharp.Interop;
|
using LlvmBindings.Interop;
|
||||||
using Ubiquity.NET.Llvm.Types;
|
using LlvmBindings.Types;
|
||||||
|
|
||||||
namespace Ubiquity.NET.Llvm.Instructions
|
namespace LlvmBindings.Instructions
|
||||||
{
|
{
|
||||||
/// <summary>Alloca instruction for allocating stack space.</summary>
|
/// <summary>Alloca instruction for allocating stack space.</summary>
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
|
|
|
@ -5,9 +5,9 @@
|
||||||
// </copyright>
|
// </copyright>
|
||||||
// -----------------------------------------------------------------------
|
// -----------------------------------------------------------------------
|
||||||
|
|
||||||
using LLVMSharp.Interop;
|
using LlvmBindings.Interop;
|
||||||
|
|
||||||
namespace Ubiquity.NET.Llvm.Instructions
|
namespace LlvmBindings.Instructions
|
||||||
{
|
{
|
||||||
/// <summary>Base class for a binary operator.</summary>
|
/// <summary>Base class for a binary operator.</summary>
|
||||||
public class BinaryOperator
|
public class BinaryOperator
|
||||||
|
|
|
@ -5,9 +5,9 @@
|
||||||
// </copyright>
|
// </copyright>
|
||||||
// -----------------------------------------------------------------------
|
// -----------------------------------------------------------------------
|
||||||
|
|
||||||
using LLVMSharp.Interop;
|
using LlvmBindings.Interop;
|
||||||
|
|
||||||
namespace Ubiquity.NET.Llvm.Instructions
|
namespace LlvmBindings.Instructions
|
||||||
{
|
{
|
||||||
/// <summary>This class represents a no-op cast from one type to another.</summary>
|
/// <summary>This class represents a no-op cast from one type to another.</summary>
|
||||||
public class BitCast
|
public class BitCast
|
||||||
|
|
|
@ -5,11 +5,11 @@
|
||||||
// </copyright>
|
// </copyright>
|
||||||
// -----------------------------------------------------------------------
|
// -----------------------------------------------------------------------
|
||||||
|
|
||||||
using LLVMSharp.Interop;
|
using LlvmBindings.Interop;
|
||||||
|
|
||||||
using Ubiquity.NET.Llvm.Values;
|
using LlvmBindings.Values;
|
||||||
|
|
||||||
namespace Ubiquity.NET.Llvm.Instructions
|
namespace LlvmBindings.Instructions
|
||||||
{
|
{
|
||||||
/// <summary>Branch instruction.</summary>
|
/// <summary>Branch instruction.</summary>
|
||||||
public class Branch
|
public class Branch
|
||||||
|
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче