Skip to content

Commit 9645062

Browse files
authored
Removed all forward language and runtime versioning (#358)
* There are just too many problems with forward referencing of version to make it not worth even trying. * Updated numerous cases where "field" or other newer runtime/language version syntax was used. * Added extensions to support params array instead of `IEnumerable` and redirect to an IEnumerable variant. * This has the least impact as the consumers don't need to change except perhaps to include a `using` to reference the namespace containing the extensions. * Comdat is no longer a ref struct New Rules: 1) DO NOT set LangVersion to anything other than what is supported by the SDK in use. In other words don't set it to `preview` or ANY other value not supported by the targetted .NET runtime. 2) DO NOT set LangVersion at all unless mutli-targetting or explicity targetting downlevel (netstandard2.0) for plugin compatibility.
1 parent 3c08b75 commit 9645062

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+723
-69
lines changed

src/Interop/InteropTests/Ubiquity.NET.Llvm.Interop.UT.csproj

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<TargetFramework>net8.0</TargetFramework>
4-
<!--Until C#14 and the "field" and "extension" keywords are available use the preview language -->
5-
<LangVersion>preview</LangVersion>
64
<Nullable>enable</Nullable>
75
<IsPackable>false</IsPackable>
86
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>

src/Interop/LlvmBindingsGenerator/Configuration/HandleDetails.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ public HandleDetails(string name, string? disposer = null, bool alias = false)
2424
/// <summary>Gets the name of the disposer for the handle (if any)</summary>
2525
public string? Disposer { get; init; }
2626

27+
#if NET9_0_OR_GREATER
2728
/// <summary>Gets a value indicating whether this handle has an alias type</summary>
2829
/// <remarks>
2930
/// If <see cref="Disposer"/> is <see langword="null"/> or all whitespace then the return is always <see langword="false"/> [Ignoring
@@ -34,5 +35,19 @@ public bool Alias
3435
get => !string.IsNullOrWhiteSpace(Disposer) && (field);
3536
init;
3637
}
38+
#else
39+
/// <summary>Gets a value indicating whether this handle has an alias type</summary>
40+
/// <remarks>
41+
/// If <see cref="Disposer"/> is <see langword="null"/> or all whitespace then the return is always <see langword="false"/> [Ignoring
42+
/// any value it is initialized with]
43+
/// </remarks>
44+
public bool Alias
45+
{
46+
get => !string.IsNullOrWhiteSpace( Disposer ) && (AliasBackingField);
47+
init => AliasBackingField = value;
48+
}
49+
50+
private readonly bool AliasBackingField;
51+
#endif
3752
}
3853
}

src/Interop/LlvmBindingsGenerator/LlvmBindingsGenerator.csproj

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
<!-- Dependent library (CppSharp) ONLY supports x64 targets -->
66
<PlatformTarget>x64</PlatformTarget>
77
<TargetFramework>net8.0</TargetFramework>
8-
<!--Until C#14 and the "field" and "extension" keywords are available use the preview language -->
9-
<LangVersion>preview</LangVersion>
108
<Nullable>enable</Nullable>
119
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
1210
<SignAssembly>False</SignAssembly>

src/Interop/Ubiquity.NET.Llvm.Interop/Ubiquity.NET.Llvm.Interop.csproj

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<TargetFramework>net8.0</TargetFramework>
4-
<!--Until C#14 and the "field" and "extension" keywords are available use the preview language -->
5-
<LangVersion>preview</LangVersion>
64
<Nullable>enable</Nullable>
75

86
<!-- TODO: additional RIDs as supported in native library -->

src/Samples/CodeGenWithDebugInfo/CodeGenWithDebugInfo.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
<Project Sdk="Microsoft.NET.Sdk">
33
<PropertyGroup>
44
<TargetFramework>net8.0</TargetFramework>
5-
<LangVersion>13</LangVersion>
65
<OutputType>exe</OutputType>
76
<OutputTypeEx>exe</OutputTypeEx>
87
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>

src/Samples/Kaleidoscope/Chapter2/Chapter2.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
<PropertyGroup>
33
<OutputType>Exe</OutputType>
44
<TargetFramework>net8.0</TargetFramework>
5-
<LangVersion>13</LangVersion>
65
<AssemblyName>kls2</AssemblyName>
76
<RootNamespace>Kaleidoscope</RootNamespace>
87
<PlatformTarget>AnyCPU</PlatformTarget>

src/Samples/Kaleidoscope/Chapter3.5/Chapter3.5.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
<PropertyGroup>
33
<OutputType>Exe</OutputType>
44
<TargetFramework>net8.0</TargetFramework>
5-
<LangVersion>13</LangVersion>
65
<AssemblyName>kls3.5</AssemblyName>
76
<RootNamespace>Kaleidoscope</RootNamespace>
87
<PlatformTarget>AnyCPU</PlatformTarget>

src/Samples/Kaleidoscope/Chapter3/Chapter3.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
<PropertyGroup>
33
<OutputType>Exe</OutputType>
44
<TargetFramework>net8.0</TargetFramework>
5-
<LangVersion>13</LangVersion>
65
<AssemblyName>kls3</AssemblyName>
76
<RootNamespace>Kaleidoscope</RootNamespace>
87
<PlatformTarget>AnyCPU</PlatformTarget>

src/Samples/Kaleidoscope/Chapter4/Chapter4.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
<PropertyGroup>
33
<OutputType>Exe</OutputType>
44
<TargetFramework>net8.0</TargetFramework>
5-
<LangVersion>13</LangVersion>
65
<AssemblyName>kls4</AssemblyName>
76
<RootNamespace>Kaleidoscope</RootNamespace>
87
<PlatformTarget>AnyCPU</PlatformTarget>

src/Samples/Kaleidoscope/Chapter5/Chapter5.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
<PropertyGroup>
33
<OutputType>Exe</OutputType>
44
<TargetFramework>net8.0</TargetFramework>
5-
<LangVersion>13</LangVersion>
65
<AssemblyName>kls5</AssemblyName>
76
<RootNamespace>Kaleidoscope</RootNamespace>
87
<PlatformTarget>AnyCPU</PlatformTarget>

0 commit comments

Comments
 (0)