diff --git a/Directory.Build.props b/Directory.Build.props
index 378350e6..80f45f36 100644
--- a/Directory.Build.props
+++ b/Directory.Build.props
@@ -25,6 +25,7 @@
false
CS0659;$(NoWarn)
true
+ true
true
true
@@ -38,20 +39,25 @@
Microsoft and Contributors
$(BaseArtifactsPath)bin/$(BaseArtifactsPathSuffix)/
Microsoft
+ true
$(BaseArtifactsPath)pkg/$(Configuration)/
LLVMSharp
11.0.0
beta
+ pr
+ $(MSBuildThisFileDirectory)Open.snk
+ 00240000048000009400000006020000002400005253413100040000010001004b86c4cb78549b34bab61a3b1800e23bfeb5b3ec390074041536a7e3cbd97f5f04cf0f857155a8928eaa29ebfd11cfbbad3ba70efea7bda3226c6a8d370a4cd303f714486b6ebc225985a638471e6ef571cc92a4613c00b8fa65d61ccee0cbe5f36330c9a01f4183559f1bef24cc2917c6d913e3a541333a1d05d9bed22b38cb
Copyright © Microsoft and Contributors
LLVMSharp is a multi-platform .NET Standard library for accessing the LLVM infrastructure.
strict
false
true
- preview
+ latest
+ 4.3
en-US
true
NCSA
@@ -65,9 +71,4 @@
true
-
-
-
-
-
diff --git a/Directory.Build.targets b/Directory.Build.targets
index ec173a49..0f0bb432 100644
--- a/Directory.Build.targets
+++ b/Directory.Build.targets
@@ -15,19 +15,25 @@
$(DefineConstants);$(OS)
+
+
+ $(Version)-$(BUILD_BUILDNUMBER)
+
+
-
- $(NETCoreSdkRuntimeIdentifier)
+
+ $(NETCoreSdkRuntimeIdentifier)
+ $(OVERRIDE_RUNTIME_IDENTIFIER)
-
-
-
-
-
+
+
+
+
+
diff --git a/Open.snk b/Open.snk
new file mode 100644
index 00000000..22a3cbd2
Binary files /dev/null and b/Open.snk differ
diff --git a/scripts/azure-pipelines.yml b/scripts/azure-pipelines.yml
index 50a10390..814c1e2b 100644
--- a/scripts/azure-pipelines.yml
+++ b/scripts/azure-pipelines.yml
@@ -33,13 +33,21 @@ jobs:
configuration: Release
architecture: x64
+- template: azure-windows.yml
+ parameters:
+ name: build_nuget
+ pool: windows-latest
+ configuration: Release
+ architecture: x64
+ EXCLUDE_BUILDNUMBER_FROM_PACKAGE: true
+
- template: azure-unix.yml
parameters:
name: ubuntu_debug_x64
pool: ubuntu-latest
configuration: Debug
architecture: x64
- rid: ubuntu.18.04-x64
+ OVERRIDE_RUNTIME_IDENTIFIER: ubuntu.18.04-x64
- template: azure-unix.yml
parameters:
@@ -47,7 +55,7 @@ jobs:
pool: ubuntu-latest
configuration: Release
architecture: x64
- rid: ubuntu.18.04-x64
+ OVERRIDE_RUNTIME_IDENTIFIER: ubuntu.18.04-x64
- template: azure-unix.yml
parameters:
diff --git a/scripts/azure-unix.yml b/scripts/azure-unix.yml
index 3c71c259..3f403532 100644
--- a/scripts/azure-unix.yml
+++ b/scripts/azure-unix.yml
@@ -26,4 +26,5 @@ jobs:
ArtifactName: packages
publishLocation: Container
variables:
- RuntimeIdentifier: ${{parameters.rid}}
+ EXCLUDE_BUILDNUMBER_FROM_PACKAGE: ${{parameters.EXCLUDE_BUILDNUMBER_FROM_PACKAGE}}
+ OVERRIDE_RUNTIME_IDENTIFIER: ${{parameters.OVERRIDE_RUNTIME_IDENTIFIER}}
diff --git a/scripts/azure-windows.yml b/scripts/azure-windows.yml
index 150ac812..42dae8e4 100644
--- a/scripts/azure-windows.yml
+++ b/scripts/azure-windows.yml
@@ -24,3 +24,6 @@ jobs:
PathtoPublish: artifacts/pkg/${{parameters.configuration}}
ArtifactName: packages
publishLocation: Container
+ variables:
+ EXCLUDE_BUILDNUMBER_FROM_PACKAGE: ${{parameters.EXCLUDE_BUILDNUMBER_FROM_PACKAGE}}
+ OVERRIDE_RUNTIME_IDENTIFIER: ${{parameters.OVERRIDE_RUNTIME_IDENTIFIER}}
diff --git a/scripts/build.ps1 b/scripts/build.ps1
index 85b775bf..43618392 100644
--- a/scripts/build.ps1
+++ b/scripts/build.ps1
@@ -120,8 +120,8 @@ try {
$DotNetInstallDirectory = Join-Path -Path $ArtifactsDir -ChildPath "dotnet"
Create-Directory -Path $DotNetInstallDirectory
- & $DotNetInstallScript -Channel 3.1 -Version latest -InstallDir $DotNetInstallDirectory -Architecture $architecture
- & $DotNetInstallScript -Channel 2.1 -Version latest -InstallDir $DotNetInstallDirectory -Architecture $architecture -Runtime dotnet
+ & $DotNetInstallScript -Channel 5.0 -Version latest -InstallDir $DotNetInstallDirectory -Architecture $architecture
+ & $DotNetInstallScript -Channel 3.1 -Version latest -InstallDir $DotNetInstallDirectory -Architecture $architecture -Runtime dotnet
$env:PATH="$DotNetInstallDirectory;$env:PATH"
}
diff --git a/scripts/build.sh b/scripts/build.sh
index 3fddfddd..a49523b7 100755
--- a/scripts/build.sh
+++ b/scripts/build.sh
@@ -204,8 +204,8 @@ if [[ ! -z "$architecture" ]]; then
DotNetInstallDirectory="$ArtifactsDir/dotnet"
CreateDirectory "$DotNetInstallDirectory"
- . "$DotNetInstallScript" --channel 3.1 --version latest --install-dir "$DotNetInstallDirectory" --architecture "$architecture"
- . "$DotNetInstallScript" --channel 2.1 --version latest --install-dir "$DotNetInstallDirectory" --architecture "$architecture" --runtime dotnet
+ . "$DotNetInstallScript" --channel 5.0 --version latest --install-dir "$DotNetInstallDirectory" --architecture "$architecture"
+ . "$DotNetInstallScript" --channel 3.1 --version latest --install-dir "$DotNetInstallDirectory" --architecture "$architecture" --runtime dotnet
PATH="$DotNetInstallDirectory:$PATH:"
fi
diff --git a/sources/Directory.Build.props b/sources/Directory.Build.props
index e2fc803d..85d5a0f0 100644
--- a/sources/Directory.Build.props
+++ b/sources/Directory.Build.props
@@ -11,6 +11,7 @@
-->
+ true
$(MSBuildAllProjects);$(MSBuildThisFileDirectory)..\Directory.Build.props
sources
@@ -18,7 +19,11 @@
-
+
+
+
+
+
diff --git a/sources/Directory.Build.targets b/sources/Directory.Build.targets
index c0e01ae5..d226f5f0 100644
--- a/sources/Directory.Build.targets
+++ b/sources/Directory.Build.targets
@@ -17,39 +17,32 @@
- $(IntermediateOutputPath)$(MSBuildProjectName).InternalsVisibleTo$(DefaultLanguageSourceExtension)
+ $(IntermediateOutputPath)$(MSBuildProjectName).SkipLocalsInit$(DefaultLanguageSourceExtension)
+
+
+// This code was generated by a tool.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+[module: System.Runtime.CompilerServices.SkipLocalsInitAttribute]
+// Generated by the MSBuild WriteLinesToFile class.]]>
+
-
-
- false
-
-
-
-
-
-
-
-
-
-
-
-
+ Outputs="$(GeneratedSkipLocalsInitFile)">
+
-
-
-
-
+
+
+
-
-
-
-
diff --git a/sources/LLVMSharp/Interop.Extensions/LLVM.ResolveLibrary.cs b/sources/LLVMSharp/Interop.Extensions/LLVM.ResolveLibrary.cs
index 17a8d9f0..7c1c498c 100644
--- a/sources/LLVMSharp/Interop.Extensions/LLVM.ResolveLibrary.cs
+++ b/sources/LLVMSharp/Interop.Extensions/LLVM.ResolveLibrary.cs
@@ -34,7 +34,7 @@ private static IntPtr OnDllImport(string libraryName, Assembly assembly, DllImpo
private static bool TryResolveLLVM(Assembly assembly, DllImportSearchPath? searchPath, out IntPtr nativeLibrary)
{
- if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux) && NativeLibrary.TryLoad("libLLVM-10.so", assembly, searchPath, out nativeLibrary))
+ if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux) && NativeLibrary.TryLoad("libLLVM-11.so", assembly, searchPath, out nativeLibrary))
{
return true;
}
diff --git a/sources/LLVMSharp/Interop.Extensions/LLVMBasicBlockRef.cs b/sources/LLVMSharp/Interop.Extensions/LLVMBasicBlockRef.cs
index 83f53964..b1e746a1 100644
--- a/sources/LLVMSharp/Interop.Extensions/LLVMBasicBlockRef.cs
+++ b/sources/LLVMSharp/Interop.Extensions/LLVMBasicBlockRef.cs
@@ -89,7 +89,7 @@ public string PrintToString()
{
var pStr = LLVM.PrintValueToString(this);
- if (pStr is null)
+ if (pStr == null)
{
return string.Empty;
}
diff --git a/sources/LLVMSharp/Interop.Extensions/LLVMContextRef.cs b/sources/LLVMSharp/Interop.Extensions/LLVMContextRef.cs
index ab92df93..90564bdf 100644
--- a/sources/LLVMSharp/Interop.Extensions/LLVMContextRef.cs
+++ b/sources/LLVMSharp/Interop.Extensions/LLVMContextRef.cs
@@ -211,10 +211,10 @@ public bool TryGetBitcodeModule(LLVMMemoryBufferRef MemBuf, out LLVMModuleRef Ou
{
fixed (LLVMModuleRef* pOutM = &OutM)
{
- sbyte* pMessage;
+ sbyte* pMessage = null;
var result = LLVM.GetBitcodeModuleInContext(this, MemBuf, (LLVMOpaqueModule**)pOutM, &pMessage);
- if (pMessage is null)
+ if (pMessage == null)
{
OutMessage = string.Empty;
}
@@ -232,10 +232,10 @@ public bool TryParseBitcode(LLVMMemoryBufferRef MemBuf, out LLVMModuleRef OutMod
{
fixed (LLVMModuleRef* pOutModule = &OutModule)
{
- sbyte* pMessage;
+ sbyte* pMessage = null;
var result = LLVM.ParseBitcodeInContext(this, MemBuf, (LLVMOpaqueModule**)pOutModule, &pMessage);
- if (pMessage is null)
+ if (pMessage == null)
{
OutMessage = string.Empty;
}
@@ -253,10 +253,10 @@ public bool TryParseIR(LLVMMemoryBufferRef MemBuf, out LLVMModuleRef OutM, out s
{
fixed (LLVMModuleRef* pOutM = &OutM)
{
- sbyte* pMessage;
+ sbyte* pMessage = null;
var result = LLVM.ParseIRInContext(this, MemBuf, (LLVMOpaqueModule**)pOutM, &pMessage);
- if (pMessage is null)
+ if (pMessage == null)
{
OutMessage = string.Empty;
}
diff --git a/sources/LLVMSharp/Interop.Extensions/LLVMExecutionEngineRef.cs b/sources/LLVMSharp/Interop.Extensions/LLVMExecutionEngineRef.cs
index c153a1ef..479b08fe 100644
--- a/sources/LLVMSharp/Interop.Extensions/LLVMExecutionEngineRef.cs
+++ b/sources/LLVMSharp/Interop.Extensions/LLVMExecutionEngineRef.cs
@@ -142,10 +142,10 @@ public bool TryRemoveModule(LLVMModuleRef M, out LLVMModuleRef OutMod, out strin
{
fixed (LLVMModuleRef* pOutMod = &OutMod)
{
- sbyte* pError;
+ sbyte* pError = null;
var result = LLVM.RemoveModule(this, M, (LLVMOpaqueModule**)pOutMod, &pError);
- if (pError is null)
+ if (pError == null)
{
OutError = string.Empty;
}
diff --git a/sources/LLVMSharp/Interop.Extensions/LLVMModuleRef.cs b/sources/LLVMSharp/Interop.Extensions/LLVMModuleRef.cs
index 7b538825..04f6aea6 100644
--- a/sources/LLVMSharp/Interop.Extensions/LLVMModuleRef.cs
+++ b/sources/LLVMSharp/Interop.Extensions/LLVMModuleRef.cs
@@ -27,7 +27,7 @@ public string DataLayout
var pDataLayoutStr = LLVM.GetDataLayout(this);
- if (pDataLayoutStr is null)
+ if (pDataLayoutStr == null)
{
return string.Empty;
}
@@ -62,7 +62,7 @@ public string Target
var pTriple = LLVM.GetTarget(this);
- if (pTriple is null)
+ if (pTriple == null)
{
return string.Empty;
}
@@ -271,7 +271,7 @@ public string PrintToString()
{
var pStr = LLVM.PrintModuleToString(this);
- if (pStr is null)
+ if (pStr == null)
{
return string.Empty;
}
@@ -296,10 +296,10 @@ public bool TryCreateExecutionEngine(out LLVMExecutionEngineRef OutEE, out strin
{
fixed (LLVMExecutionEngineRef* pOutEE = &OutEE)
{
- sbyte* pError;
+ sbyte* pError = null;
var result = LLVM.CreateExecutionEngineForModule((LLVMOpaqueExecutionEngine**)pOutEE, this, &pError);
- if (pError is null)
+ if (pError == null)
{
OutError = string.Empty;
}
@@ -317,10 +317,10 @@ public bool TryCreateInterpreter(out LLVMExecutionEngineRef OutInterp, out strin
{
fixed (LLVMExecutionEngineRef* pOutInterp = &OutInterp)
{
- sbyte* pError;
+ sbyte* pError = null;
var result = LLVM.CreateInterpreterForModule((LLVMOpaqueExecutionEngine**)pOutInterp, this, &pError);
- if (pError is null)
+ if (pError == null)
{
OutError = string.Empty;
}
@@ -345,10 +345,10 @@ public bool TryCreateMCJITCompiler(out LLVMExecutionEngineRef OutJIT, ref LLVMMC
fixed (LLVMExecutionEngineRef* pOutJIT = &OutJIT)
fixed (LLVMMCJITCompilerOptions* pOptions = &Options)
{
- sbyte* pError;
+ sbyte* pError = null;
var result = LLVM.CreateMCJITCompilerForModule((LLVMOpaqueExecutionEngine**)pOutJIT, this, pOptions, (UIntPtr)Marshal.SizeOf(), &pError);
- if (pError is null)
+ if (pError == null)
{
OutError = string.Empty;
}
@@ -376,10 +376,9 @@ public bool TryPrintToFile(ReadOnlySpan Filename, out string ErrorMessage)
}
catch (Exception)
{
-
}
- if (pErrorMessage is null)
+ if (pErrorMessage == null)
{
ErrorMessage = string.Empty;
}
@@ -394,10 +393,10 @@ public bool TryPrintToFile(ReadOnlySpan Filename, out string ErrorMessage)
public bool TryVerify(LLVMVerifierFailureAction Action, out string OutMessage)
{
- sbyte* pMessage;
+ sbyte* pMessage = null;
var result = LLVM.VerifyModule(this, Action, &pMessage);
- if (pMessage is null)
+ if (pMessage == null)
{
OutMessage = string.Empty;
}
diff --git a/sources/LLVMSharp/Interop.Extensions/LLVMTargetMachineRef.cs b/sources/LLVMSharp/Interop.Extensions/LLVMTargetMachineRef.cs
index ed86e7dd..2131c83e 100644
--- a/sources/LLVMSharp/Interop.Extensions/LLVMTargetMachineRef.cs
+++ b/sources/LLVMSharp/Interop.Extensions/LLVMTargetMachineRef.cs
@@ -48,10 +48,10 @@ public bool TryEmitToFile(LLVMModuleRef module, ReadOnlySpan fileName, LLV
{
using var marshaledFileName = new MarshaledString(fileName);
- sbyte* errorMessage;
+ sbyte* errorMessage = null;
int result = LLVM.TargetMachineEmitToFile(this, module, marshaledFileName, codegen, &errorMessage);
- if (errorMessage is null)
+ if (errorMessage == null)
{
message = string.Empty;
}
diff --git a/sources/LLVMSharp/Interop.Extensions/LLVMTargetRef.cs b/sources/LLVMSharp/Interop.Extensions/LLVMTargetRef.cs
index b1d84600..0fe8e9a0 100644
--- a/sources/LLVMSharp/Interop.Extensions/LLVMTargetRef.cs
+++ b/sources/LLVMSharp/Interop.Extensions/LLVMTargetRef.cs
@@ -21,7 +21,7 @@ public static string DefaultTriple
{
var pDefaultTriple = LLVM.GetDefaultTargetTriple();
- if (pDefaultTriple is null)
+ if (pDefaultTriple == null)
{
return string.Empty;
}
@@ -37,10 +37,10 @@ public static bool TryGetTargetFromTriple(ReadOnlySpan triple, out LLVMTar
fixed (LLVMTargetRef* pOutTarget = &outTarget)
{
- sbyte* pError;
+ sbyte* pError = null;
var result = LLVM.GetTargetFromTriple(marshaledTriple, (LLVMTarget**)pOutTarget, &pError);
- if (pError is null)
+ if (pError == null)
{
outError = string.Empty;
}
@@ -93,7 +93,7 @@ public string Name
var pName = LLVM.GetTargetName(this);
- if (pName is null)
+ if (pName == null)
{
return string.Empty;
}
diff --git a/sources/LLVMSharp/Interop.Extensions/LLVMTypeRef.cs b/sources/LLVMSharp/Interop.Extensions/LLVMTypeRef.cs
index a2fc98f8..6142b096 100644
--- a/sources/LLVMSharp/Interop.Extensions/LLVMTypeRef.cs
+++ b/sources/LLVMSharp/Interop.Extensions/LLVMTypeRef.cs
@@ -124,7 +124,7 @@ public string StructName
var pStructName = LLVM.GetStructName(this);
- if (pStructName is null)
+ if (pStructName == null)
{
return string.Empty;
}
@@ -214,7 +214,7 @@ public string PrintToString()
{
var pStr = LLVM.PrintTypeToString(this);
- if (pStr is null)
+ if (pStr == null)
{
return string.Empty;
}
diff --git a/sources/LLVMSharp/Interop.Extensions/LLVMValueRef.cs b/sources/LLVMSharp/Interop.Extensions/LLVMValueRef.cs
index 560a2543..1554e571 100644
--- a/sources/LLVMSharp/Interop.Extensions/LLVMValueRef.cs
+++ b/sources/LLVMSharp/Interop.Extensions/LLVMValueRef.cs
@@ -92,7 +92,7 @@ public string GC
var pName = LLVM.GetGC(this);
- if (pName is null)
+ if (pName == null)
{
return string.Empty;
}
@@ -412,7 +412,7 @@ public string Name
var pStr = LLVM.GetValueName(this);
- if (pStr is null)
+ if (pStr == null)
{
return string.Empty;
}
@@ -487,7 +487,7 @@ public string Section
var pSection = LLVM.GetSection(this);
- if (pSection is null)
+ if (pSection == null)
{
return string.Empty;
}
@@ -852,7 +852,7 @@ public string GetAsString(out UIntPtr Length)
{
var pStr = LLVM.GetAsString(this, pLength);
- if (pStr is null)
+ if (pStr == null)
{
return string.Empty;
}
@@ -915,7 +915,7 @@ public string GetMDString(out uint Len)
{
var pMDStr = LLVM.GetMDString(this, pLen);
- if (pMDStr is null)
+ if (pMDStr == null)
{
return string.Empty;
}
@@ -941,7 +941,7 @@ public string PrintToString()
{
var pStr = LLVM.PrintValueToString(this);
- if (pStr is null)
+ if (pStr == null)
{
return string.Empty;
}
diff --git a/sources/LLVMSharp/LLVMSharp.csproj b/sources/LLVMSharp/LLVMSharp.csproj
index be7d05f7..e1fccfc0 100644
--- a/sources/LLVMSharp/LLVMSharp.csproj
+++ b/sources/LLVMSharp/LLVMSharp.csproj
@@ -3,15 +3,18 @@
false
- netcoreapp3.1;netstandard2.0
+ net5.0;netcoreapp3.1;netstandard2.0
-
-
+
+
+
+
+
diff --git a/tests/LLVMSharp.UnitTests/LLVMSharp.UnitTests.csproj b/tests/LLVMSharp.UnitTests/LLVMSharp.UnitTests.csproj
index e7f9940a..3286cc4f 100644
--- a/tests/LLVMSharp.UnitTests/LLVMSharp.UnitTests.csproj
+++ b/tests/LLVMSharp.UnitTests/LLVMSharp.UnitTests.csproj
@@ -2,7 +2,7 @@
- netcoreapp3.1
+ net5.0;netcoreapp3.1