Skip to content

Commit 9d2f9a1

Browse files
Regenerating bindings for LLVM 11.0.0 (#151)
* Normalizing the Interop.Extensions types to implement the same base members * Adding some base managed types for various handles * Regenerating bindings for LLVM 11.0.0
1 parent 3e0b15e commit 9d2f9a1

File tree

244 files changed

+4744
-2250
lines changed

Some content is hidden

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

244 files changed

+4744
-2250
lines changed

Directory.Build.props

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
<Company>Microsoft</Company>
4141
<PackageOutputPath>$(BaseArtifactsPath)pkg/$(Configuration)/</PackageOutputPath>
4242
<Product>LLVMSharp</Product>
43-
<VersionPrefix>10.0.0</VersionPrefix>
43+
<VersionPrefix>11.0.0</VersionPrefix>
4444
<VersionSuffix>beta</VersionSuffix>
4545
</PropertyGroup>
4646

Directory.Build.targets

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
<!-- Package versions for package references across all projects -->
2424
<ItemGroup>
25-
<PackageReference Update="libLLVM" Version="10.0.0" />
25+
<PackageReference Update="libLLVM" Version="11.0.0" />
2626
<PackageReference Update="Microsoft.Bcl.HashCode" Version="1.1.0" />
2727
<PackageReference Update="Microsoft.Net.Compilers.Toolset" Version="3.5.0" />
2828
<PackageReference Update="Microsoft.NET.Test.Sdk" Version="16.5.0" />

packages/libLLVM/libLLVM.runtime.freebsd.11-x64/libLLVM.runtime.freebsd.11-x64.nuspec

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
33
<metadata minClientVersion="2.12">
44
<id>libLLVM.runtime.freebsd.11-x64</id>
5-
<version>10.0.0</version>
5+
<version>11.0.0</version>
66
<authors>Microsoft and Contributors</authors>
77
<owners>Microsoft and Contributors</owners>
88
<requireLicenseAcceptance>true</requireLicenseAcceptance>
99
<license type="expression">Apache-2.0</license>
1010
<projectUrl>https://github.com/microsoft/llvmsharp</projectUrl>
1111
<description>freebsd 11 x64 native library for libLLVM.</description>
1212
<copyright>Copyright © University of Illinois at Urbana-Champaign</copyright>
13-
<repository type="git" url="https://github.com/llvm/llvm-project" branch="llvmorg-10.0.0" />
13+
<repository type="git" url="https://github.com/llvm/llvm-project" branch="llvmorg-11.0.0" />
1414
</metadata>
1515
<files>
1616
<file src="..\libLLVM\LICENSE.TXT" target="LICENSE.TXT" />

packages/libLLVM/libLLVM.runtime.freebsd.11-x86/libLLVM.runtime.freebsd.11-x86.nuspec

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
33
<metadata minClientVersion="2.12">
44
<id>libLLVM.runtime.freebsd.11-x86</id>
5-
<version>10.0.0</version>
5+
<version>11.0.0</version>
66
<authors>Microsoft and Contributors</authors>
77
<owners>Microsoft and Contributors</owners>
88
<requireLicenseAcceptance>true</requireLicenseAcceptance>
99
<license type="expression">Apache-2.0</license>
1010
<projectUrl>https://github.com/microsoft/llvmsharp</projectUrl>
1111
<description>freebsd 11 x86 native library for libLLVM.</description>
1212
<copyright>Copyright © University of Illinois at Urbana-Champaign</copyright>
13-
<repository type="git" url="https://github.com/llvm/llvm-project" branch="llvmorg-10.0.0" />
13+
<repository type="git" url="https://github.com/llvm/llvm-project" branch="llvmorg-11.0.0" />
1414
</metadata>
1515
<files>
1616
<file src="..\libLLVM\LICENSE.TXT" target="LICENSE.TXT" />

packages/libLLVM/libLLVM.runtime.linux-arm/libLLVM.runtime.linux-arm.nuspec

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
33
<metadata minClientVersion="2.12">
44
<id>libLLVM.runtime.linux-arm</id>
5-
<version>10.0.0</version>
5+
<version>11.0.0</version>
66
<authors>Microsoft and Contributors</authors>
77
<owners>Microsoft and Contributors</owners>
88
<requireLicenseAcceptance>true</requireLicenseAcceptance>
99
<license type="expression">Apache-2.0</license>
1010
<projectUrl>https://github.com/microsoft/llvmsharp</projectUrl>
1111
<description>linux arm native library for libLLVM.</description>
1212
<copyright>Copyright © University of Illinois at Urbana-Champaign</copyright>
13-
<repository type="git" url="https://github.com/llvm/llvm-project" branch="llvmorg-10.0.0" />
13+
<repository type="git" url="https://github.com/llvm/llvm-project" branch="llvmorg-11.0.0" />
1414
</metadata>
1515
<files>
1616
<file src="..\libLLVM\LICENSE.TXT" target="LICENSE.TXT" />

packages/libLLVM/libLLVM.runtime.linux-arm64/libLLVM.runtime.linux-arm64.nuspec

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
33
<metadata minClientVersion="2.12">
44
<id>libLLVM.runtime.linux-arm64</id>
5-
<version>10.0.0</version>
5+
<version>11.0.0</version>
66
<authors>Microsoft and Contributors</authors>
77
<owners>Microsoft and Contributors</owners>
88
<requireLicenseAcceptance>true</requireLicenseAcceptance>
99
<license type="expression">Apache-2.0</license>
1010
<projectUrl>https://github.com/microsoft/llvmsharp</projectUrl>
1111
<description>linux arm64 native library for libLLVM.</description>
1212
<copyright>Copyright © University of Illinois at Urbana-Champaign</copyright>
13-
<repository type="git" url="https://github.com/llvm/llvm-project" branch="llvmorg-10.0.0" />
13+
<repository type="git" url="https://github.com/llvm/llvm-project" branch="llvmorg-11.0.0" />
1414
</metadata>
1515
<files>
1616
<file src="..\libLLVM\LICENSE.TXT" target="LICENSE.TXT" />

packages/libLLVM/libLLVM.runtime.osx-x64/libLLVM.runtime.osx-x64.nuspec

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
33
<metadata minClientVersion="2.12">
44
<id>libLLVM.runtime.osx-x64</id>
5-
<version>10.0.0</version>
5+
<version>11.0.0</version>
66
<authors>Microsoft and Contributors</authors>
77
<owners>Microsoft and Contributors</owners>
88
<requireLicenseAcceptance>true</requireLicenseAcceptance>
99
<license type="expression">Apache-2.0</license>
1010
<projectUrl>https://github.com/microsoft/llvmsharp</projectUrl>
1111
<description>osx x64 native library for libLLVM.</description>
1212
<copyright>Copyright © University of Illinois at Urbana-Champaign</copyright>
13-
<repository type="git" url="https://github.com/llvm/llvm-project" branch="llvmorg-10.0.0" />
13+
<repository type="git" url="https://github.com/llvm/llvm-project" branch="llvmorg-11.0.0" />
1414
</metadata>
1515
<files>
1616
<file src="..\libLLVM\LICENSE.TXT" target="LICENSE.TXT" />

packages/libLLVM/libLLVM.runtime.sles-x64/libLLVM.runtime.sles-x64.nuspec

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
33
<metadata minClientVersion="2.12">
44
<id>libLLVM.runtime.sles-x64</id>
5-
<version>10.0.0</version>
5+
<version>11.0.0</version>
66
<authors>Microsoft and Contributors</authors>
77
<owners>Microsoft and Contributors</owners>
88
<requireLicenseAcceptance>true</requireLicenseAcceptance>
99
<license type="expression">Apache-2.0</license>
1010
<projectUrl>https://github.com/microsoft/llvmsharp</projectUrl>
1111
<description>sles x64 native library for libLLVM.</description>
1212
<copyright>Copyright © University of Illinois at Urbana-Champaign</copyright>
13-
<repository type="git" url="https://github.com/llvm/llvm-project" branch="llvmorg-10.0.0" />
13+
<repository type="git" url="https://github.com/llvm/llvm-project" branch="llvmorg-11.0.0" />
1414
</metadata>
1515
<files>
1616
<file src="..\libLLVM\LICENSE.TXT" target="LICENSE.TXT" />

packages/libLLVM/libLLVM.runtime.ubuntu.16.04-x64/libLLVM.runtime.ubuntu.16.04-x64.nuspec

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
33
<metadata minClientVersion="2.12">
44
<id>libLLVM.runtime.ubuntu.16.04-x64</id>
5-
<version>10.0.0</version>
5+
<version>11.0.0</version>
66
<authors>Microsoft and Contributors</authors>
77
<owners>Microsoft and Contributors</owners>
88
<requireLicenseAcceptance>true</requireLicenseAcceptance>
99
<license type="expression">Apache-2.0</license>
1010
<projectUrl>https://github.com/microsoft/llvmsharp</projectUrl>
1111
<description>ubuntu 16.04 x64 native library for libLLVM.</description>
1212
<copyright>Copyright © University of Illinois at Urbana-Champaign</copyright>
13-
<repository type="git" url="https://github.com/llvm/llvm-project" branch="llvmorg-10.0.0" />
13+
<repository type="git" url="https://github.com/llvm/llvm-project" branch="llvmorg-11.0.0" />
1414
</metadata>
1515
<files>
1616
<file src="..\libLLVM\LICENSE.TXT" target="LICENSE.TXT" />

packages/libLLVM/libLLVM.runtime.ubuntu.18.04-x64/libLLVM.runtime.ubuntu.18.04-x64.nuspec

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
33
<metadata minClientVersion="2.12">
44
<id>libLLVM.runtime.ubuntu.18.04-x64</id>
5-
<version>10.0.0</version>
5+
<version>11.0.0</version>
66
<authors>Microsoft and Contributors</authors>
77
<owners>Microsoft and Contributors</owners>
88
<requireLicenseAcceptance>true</requireLicenseAcceptance>
99
<license type="expression">Apache-2.0</license>
1010
<projectUrl>https://github.com/microsoft/llvmsharp</projectUrl>
1111
<description>ubuntu 18.04 x64 native library for libLLVM.</description>
1212
<copyright>Copyright © University of Illinois at Urbana-Champaign</copyright>
13-
<repository type="git" url="https://github.com/llvm/llvm-project" branch="llvmorg-10.0.0" />
13+
<repository type="git" url="https://github.com/llvm/llvm-project" branch="llvmorg-11.0.0" />
1414
</metadata>
1515
<files>
1616
<file src="..\libLLVM\LICENSE.TXT" target="LICENSE.TXT" />

packages/libLLVM/libLLVM.runtime.ubuntu.20.04-x64/libLLVM.runtime.ubuntu.20.04-x64.nuspec

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
33
<metadata minClientVersion="2.12">
44
<id>libLLVM.runtime.ubuntu.20.04-x64</id>
5-
<version>10.0.0</version>
5+
<version>11.0.0</version>
66
<authors>Microsoft and Contributors</authors>
77
<owners>Microsoft and Contributors</owners>
88
<requireLicenseAcceptance>true</requireLicenseAcceptance>
99
<license type="expression">Apache-2.0</license>
1010
<projectUrl>https://github.com/microsoft/llvmsharp</projectUrl>
1111
<description>ubuntu 20.04 x64 native library for libLLVM.</description>
1212
<copyright>Copyright © University of Illinois at Urbana-Champaign</copyright>
13-
<repository type="git" url="https://github.com/llvm/llvm-project" branch="llvmorg-10.0.0" />
13+
<repository type="git" url="https://github.com/llvm/llvm-project" branch="llvmorg-11.0.0" />
1414
</metadata>
1515
<files>
1616
<file src="..\libLLVM\LICENSE.TXT" target="LICENSE.TXT" />

packages/libLLVM/libLLVM.runtime.win-x64/libLLVM.runtime.win-x64.nuspec

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
33
<metadata minClientVersion="2.12">
44
<id>libLLVM.runtime.win-x64</id>
5-
<version>10.0.0</version>
5+
<version>11.0.0</version>
66
<authors>Microsoft and Contributors</authors>
77
<owners>Microsoft and Contributors</owners>
88
<requireLicenseAcceptance>true</requireLicenseAcceptance>
99
<license type="expression">Apache-2.0</license>
1010
<projectUrl>https://github.com/microsoft/llvmsharp</projectUrl>
1111
<description>win x64 native library for libLLVM.</description>
1212
<copyright>Copyright © University of Illinois at Urbana-Champaign</copyright>
13-
<repository type="git" url="https://github.com/llvm/llvm-project" branch="llvmorg-10.0.0" />
13+
<repository type="git" url="https://github.com/llvm/llvm-project" branch="llvmorg-11.0.0" />
1414
</metadata>
1515
<files>
1616
<file src="..\libLLVM\LICENSE.TXT" target="LICENSE.TXT" />

packages/libLLVM/libLLVM.runtime.win-x86/libLLVM.runtime.win-x86.nuspec

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
33
<metadata minClientVersion="2.12">
44
<id>libLLVM.runtime.win-x86</id>
5-
<version>10.0.0</version>
5+
<version>11.0.0</version>
66
<authors>Microsoft and Contributors</authors>
77
<owners>Microsoft and Contributors</owners>
88
<requireLicenseAcceptance>true</requireLicenseAcceptance>
99
<license type="expression">Apache-2.0</license>
1010
<projectUrl>https://github.com/microsoft/llvmsharp</projectUrl>
1111
<description>win x86 native library for libLLVM.</description>
1212
<copyright>Copyright © University of Illinois at Urbana-Champaign</copyright>
13-
<repository type="git" url="https://github.com/llvm/llvm-project" branch="llvmorg-10.0.0" />
13+
<repository type="git" url="https://github.com/llvm/llvm-project" branch="llvmorg-11.0.0" />
1414
</metadata>
1515
<files>
1616
<file src="..\libLLVM\LICENSE.TXT" target="LICENSE.TXT" />

packages/libLLVM/libLLVM/libLLVM.nuspec

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
33
<metadata minClientVersion="2.12">
44
<id>libLLVM</id>
5-
<version>10.0.0</version>
5+
<version>11.0.0</version>
66
<authors>Microsoft and Contributors</authors>
77
<owners>Microsoft and Contributors</owners>
88
<requireLicenseAcceptance>true</requireLicenseAcceptance>
99
<license type="expression">Apache-2.0</license>
1010
<projectUrl>https://github.com/microsoft/llvmsharp</projectUrl>
1111
<description>Multi-platform native library for libLLVM.</description>
1212
<copyright>Copyright © University of Illinois at Urbana-Champaign</copyright>
13-
<repository type="git" url="https://github.com/llvm/llvm-project" branch="llvmorg-10.0.0" />
13+
<repository type="git" url="https://github.com/llvm/llvm-project" branch="llvmorg-11.0.0" />
1414
<dependencies>
1515
<group targetFramework=".NETStandard1.0">
1616
<dependency id="Microsoft.NETCore.Platforms" version="1.0.1" />

packages/libLLVM/libLLVM/runtime.json

+11-11
Original file line numberDiff line numberDiff line change
@@ -2,57 +2,57 @@
22
"runtimes": {
33
"freebsd.11-x64": {
44
"libLLVM": {
5-
"libLLVM.runtime.freebsd.11-x64": "10.0.0"
5+
"libLLVM.runtime.freebsd.11-x64": "11.0.0"
66
}
77
},
88
"freebsd.11-x86": {
99
"libLLVM": {
10-
"libLLVM.runtime.freebsd.11-x86": "10.0.0"
10+
"libLLVM.runtime.freebsd.11-x86": "11.0.0"
1111
}
1212
},
1313
"linux-arm": {
1414
"libLLVM": {
15-
"libLLVM.runtime.linux-arm": "10.0.0"
15+
"libLLVM.runtime.linux-arm": "11.0.0"
1616
}
1717
},
1818
"linux-arm64": {
1919
"libLLVM": {
20-
"libLLVM.runtime.linux-arm64": "10.0.0"
20+
"libLLVM.runtime.linux-arm64": "11.0.0"
2121
}
2222
},
2323
"osx-x64": {
2424
"libLLVM": {
25-
"libLLVM.runtime.osx-x64": "10.0.0"
25+
"libLLVM.runtime.osx-x64": "11.0.0"
2626
}
2727
},
2828
"sles-x64": {
2929
"libLLVM": {
30-
"libLLVM.runtime.sles-x64": "10.0.0"
30+
"libLLVM.runtime.sles-x64": "11.0.0"
3131
}
3232
},
3333
"ubuntu.16.04-x64": {
3434
"libLLVM": {
35-
"libLLVM.runtime.ubuntu.16.04-x64": "10.0.0"
35+
"libLLVM.runtime.ubuntu.16.04-x64": "11.0.0"
3636
}
3737
},
3838
"ubuntu.18.04-x64": {
3939
"libLLVM": {
40-
"libLLVM.runtime.ubuntu.18.04-x64": "10.0.0"
40+
"libLLVM.runtime.ubuntu.18.04-x64": "11.0.0"
4141
}
4242
},
4343
"ubuntu.20.04-x64": {
4444
"libLLVM": {
45-
"libLLVM.runtime.ubuntu.20.04-x64": "10.0.0"
45+
"libLLVM.runtime.ubuntu.20.04-x64": "11.0.0"
4646
}
4747
},
4848
"win-x64": {
4949
"libLLVM": {
50-
"libLLVM.runtime.win-x64": "10.0.0"
50+
"libLLVM.runtime.win-x64": "11.0.0"
5151
}
5252
},
5353
"win-x86": {
5454
"libLLVM": {
55-
"libLLVM.runtime.win-x86": "10.0.0"
55+
"libLLVM.runtime.win-x86": "11.0.0"
5656
}
5757
}
5858
}

sources/LLVMSharp/Attribute.cs

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// Copyright (c) Microsoft and Contributors. All rights reserved. Licensed under the University of Illinois/NCSA Open Source License. See LICENSE.txt in the project root for license information.
2+
3+
using System;
4+
using LLVMSharp.Interop;
5+
6+
namespace LLVMSharp
7+
{
8+
public sealed class Attribute : IEquatable<Attribute>
9+
{
10+
public LLVMAttributeRef Handle { get; }
11+
12+
public static bool operator ==(Attribute left, Attribute right) => ReferenceEquals(left, right) || (left?.Handle == right?.Handle);
13+
14+
public static bool operator !=(Attribute left, Attribute right) => !(left == right);
15+
16+
public override bool Equals(object obj) => (obj is Attribute other) && Equals(other);
17+
18+
public bool Equals(Attribute other) => this == other;
19+
20+
public override int GetHashCode() => Handle.GetHashCode();
21+
22+
public override string ToString() => Handle.ToString();
23+
}
24+
}

sources/LLVMSharp/DataLayout.cs

+12-34
Original file line numberDiff line numberDiff line change
@@ -14,52 +14,30 @@ public DataLayout(ReadOnlySpan<char> stringRep)
1414

1515
public LLVMTargetDataRef Handle { get; }
1616

17-
public StructLayout GetStructLayout(StructType structType)
18-
{
19-
return new StructLayout(this, structType);
20-
}
17+
public StructLayout GetStructLayout(StructType structType) => new StructLayout(this, structType);
2118

22-
public ulong GetTypeSizeInBits(Type type)
23-
{
24-
return Handle.SizeOfTypeInBits(type.Handle);
25-
}
19+
public ulong GetTypeSizeInBits(Type type) => Handle.SizeOfTypeInBits(type.Handle);
2620

27-
public ulong GetTypeStoreSize(Type type)
28-
{
29-
return Handle.StoreSizeOfType(type.Handle);
30-
}
21+
public ulong GetTypeStoreSize(Type type) => Handle.StoreSizeOfType(type.Handle);
3122

32-
public ulong GetTypeAllocSize(Type type)
33-
{
34-
return Handle.ABISizeOfType(type.Handle);
35-
}
23+
public ulong GetTypeAllocSize(Type type) => Handle.ABISizeOfType(type.Handle);
3624

37-
public uint GetABITypeAlignment(Type type)
38-
{
39-
return Handle.ABIAlignmentOfType(type.Handle);
40-
}
25+
public uint GetABITypeAlignment(Type type) => Handle.ABIAlignmentOfType(type.Handle);
4126

42-
public uint GetPrefTypeAlignment(Type type)
43-
{
44-
return Handle.PreferredAlignmentOfType(type.Handle);
45-
}
27+
public uint GetPrefTypeAlignment(Type type) => Handle.PreferredAlignmentOfType(type.Handle);
4628

47-
public uint GetPreferredAlign(Value value)
48-
{
49-
return Handle.PreferredAlignmentOfGlobal(value.Handle);
50-
}
29+
public uint GetPreferredAlign(Value value) => Handle.PreferredAlignmentOfGlobal(value.Handle);
5130

52-
public static bool operator ==(DataLayout left, DataLayout right) => (left is object) ? ((right is object) && (left.Handle == right.Handle)) : (right is null);
31+
public static bool operator ==(DataLayout left, DataLayout right) => ReferenceEquals(left, right) || (left?.Handle == right?.Handle);
5332

54-
public static bool operator !=(DataLayout left, DataLayout right) => (left is object) ? ((right is null) || (left.Handle != right.Handle)) : (right is object);
33+
public static bool operator !=(DataLayout left, DataLayout right) => !(left == right);
5534

5635
public override bool Equals(object obj) => (obj is DataLayout other) && Equals(other);
5736

5837
public bool Equals(DataLayout other) => this == other;
5938

60-
public override int GetHashCode()
61-
{
62-
return Handle.GetHashCode();
63-
}
39+
public override int GetHashCode() => Handle.GetHashCode();
40+
41+
public override string ToString() => Handle.ToString();
6442
}
6543
}

0 commit comments

Comments
 (0)