Skip to content

Commit

Permalink
Update libClangSharp to 10.0.2-beta and improve some codegen handling (
Browse files Browse the repository at this point in the history
…#162)

* Exposing additional information about types

* Don't pack as tool for local builds

* Handle Enum as the backing bitfield type

* Handle CXXUuidofExpr

* Handle arrays with a size of 0

* Adding support for alignof UnaryExprOrTypeTraitExpr

* Adding support for GotoStmt and LabelStmt

* Ensure the number of template arguments is correctly returned

* Escape string literals

* Cleaning up how semicolons are emitted and statement bodies are visited

* Upgrading libClangSharp to 10.0.2-beta2

* Adding Microsoft.SourceLink.GitHub

* Fixing the handling of while statement bodies
  • Loading branch information
tannergooding authored Jul 23, 2020
1 parent 7a873c8 commit 28dd073
Show file tree
Hide file tree
Showing 78 changed files with 2,709 additions and 470 deletions.
8 changes: 8 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,12 @@
<UseSharedCompilation>true</UseSharedCompilation>
</PropertyGroup>

<PropertyGroup Condition="'$(TF_BUILD)' == 'true'">
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" IsImplicitlyDefined="true" PrivateAssets="all" />
</ItemGroup>

</Project>
3 changes: 2 additions & 1 deletion Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,10 @@
<!-- Package versions for package references across all projects -->
<ItemGroup>
<PackageReference Update="libClang" Version="10.0.0" />
<PackageReference Update="libClangSharp" Version="10.0.1-beta2" />
<PackageReference Update="libClangSharp" Version="10.0.2-beta2" />
<PackageReference Update="Microsoft.Bcl.HashCode" Version="1.1.0" />
<PackageReference Update="Microsoft.NET.Test.Sdk" Version="16.6.1" />
<PackageReference Update="Microsoft.SourceLink.GitHub" Version="1.0.0" />
<PackageReference Update="System.CommandLine" Version="2.0.0-beta1.20253.1" />
<PackageReference Update="System.Memory" Version="4.5.4" />
<PackageReference Update="xunit" Version="2.4.1" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
<metadata minClientVersion="2.12">
<id>libClangSharp.runtime.freebsd.11-x64</id>
<version>10.0.1-beta2</version>
<version>10.0.2-beta2</version>
<authors>Microsoft and Contributors</authors>
<owners>Microsoft and Contributors</owners>
<requireLicenseAcceptance>true</requireLicenseAcceptance>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
<metadata minClientVersion="2.12">
<id>libClangSharp.runtime.freebsd.11-x86</id>
<version>10.0.1-beta2</version>
<version>10.0.2-beta2</version>
<authors>Microsoft and Contributors</authors>
<owners>Microsoft and Contributors</owners>
<requireLicenseAcceptance>true</requireLicenseAcceptance>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
<metadata minClientVersion="2.12">
<id>libClangSharp.runtime.linux-arm</id>
<version>10.0.1-beta2</version>
<version>10.0.2-beta2</version>
<authors>Microsoft and Contributors</authors>
<owners>Microsoft and Contributors</owners>
<requireLicenseAcceptance>true</requireLicenseAcceptance>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
<metadata minClientVersion="2.12">
<id>libClangSharp.runtime.linux-arm64</id>
<version>10.0.1-beta2</version>
<version>10.0.2-beta2</version>
<authors>Microsoft and Contributors</authors>
<owners>Microsoft and Contributors</owners>
<requireLicenseAcceptance>true</requireLicenseAcceptance>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
<metadata minClientVersion="2.12">
<id>libClangSharp.runtime.osx-x64</id>
<version>10.0.1-beta2</version>
<version>10.0.2-beta2</version>
<authors>Microsoft and Contributors</authors>
<owners>Microsoft and Contributors</owners>
<requireLicenseAcceptance>true</requireLicenseAcceptance>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
<metadata minClientVersion="2.12">
<id>libClangSharp.runtime.sles-x64</id>
<version>10.0.1-beta2</version>
<version>10.0.2-beta2</version>
<authors>Microsoft and Contributors</authors>
<owners>Microsoft and Contributors</owners>
<requireLicenseAcceptance>true</requireLicenseAcceptance>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
<metadata minClientVersion="2.12">
<id>libClangSharp.runtime.ubuntu.16.04-x64</id>
<version>10.0.1-beta2</version>
<version>10.0.2-beta2</version>
<authors>Microsoft and Contributors</authors>
<owners>Microsoft and Contributors</owners>
<requireLicenseAcceptance>true</requireLicenseAcceptance>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
<metadata minClientVersion="2.12">
<id>libClangSharp.runtime.ubuntu.18.04-x64</id>
<version>10.0.1-beta2</version>
<version>10.0.2-beta2</version>
<authors>Microsoft and Contributors</authors>
<owners>Microsoft and Contributors</owners>
<requireLicenseAcceptance>true</requireLicenseAcceptance>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
<metadata minClientVersion="2.12">
<id>libClangSharp.runtime.ubuntu.20.04-x64</id>
<version>10.0.1-beta2</version>
<version>10.0.2-beta2</version>
<authors>Microsoft and Contributors</authors>
<owners>Microsoft and Contributors</owners>
<requireLicenseAcceptance>true</requireLicenseAcceptance>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
<metadata minClientVersion="2.12">
<id>libClangSharp.runtime.win-x64</id>
<version>10.0.1-beta2</version>
<version>10.0.2-beta2</version>
<authors>Microsoft and Contributors</authors>
<owners>Microsoft and Contributors</owners>
<requireLicenseAcceptance>true</requireLicenseAcceptance>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
<metadata minClientVersion="2.12">
<id>libClangSharp.runtime.win-x86</id>
<version>10.0.1-beta2</version>
<version>10.0.2-beta2</version>
<authors>Microsoft and Contributors</authors>
<owners>Microsoft and Contributors</owners>
<requireLicenseAcceptance>true</requireLicenseAcceptance>
Expand Down
2 changes: 1 addition & 1 deletion packages/libClangSharp/libClangSharp/libClangSharp.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
<metadata minClientVersion="2.12">
<id>libClangSharp</id>
<version>10.0.1-beta2</version>
<version>10.0.2-beta2</version>
<authors>Microsoft and Contributors</authors>
<owners>Microsoft and Contributors</owners>
<requireLicenseAcceptance>true</requireLicenseAcceptance>
Expand Down
22 changes: 11 additions & 11 deletions packages/libClangSharp/libClangSharp/runtime.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,57 +2,57 @@
"runtimes": {
"freebsd.11-x64": {
"libClangSharp": {
"libClangSharp.runtime.freebsd.11-x64": "10.0.1-beta2"
"libClangSharp.runtime.freebsd.11-x64": "10.0.2-beta2"
}
},
"freebsd.11-x86": {
"libClangSharp": {
"libClangSharp.runtime.freebsd.11-x86": "10.0.1-beta2"
"libClangSharp.runtime.freebsd.11-x86": "10.0.2-beta2"
}
},
"linux-arm": {
"libClangSharp": {
"libClangSharp.runtime.linux-arm": "10.0.1-beta2"
"libClangSharp.runtime.linux-arm": "10.0.2-beta2"
}
},
"linux-arm64": {
"libClangSharp": {
"libClangSharp.runtime.linux-arm64": "10.0.1-beta2"
"libClangSharp.runtime.linux-arm64": "10.0.2-beta2"
}
},
"osx-x64": {
"libClangSharp": {
"libClangSharp.runtime.osx-x64": "10.0.1-beta2"
"libClangSharp.runtime.osx-x64": "10.0.2-beta2"
}
},
"sles-x64": {
"libClangSharp": {
"libClangSharp.runtime.sles-x64": "10.0.1-beta2"
"libClangSharp.runtime.sles-x64": "10.0.2-beta2"
}
},
"ubuntu.16.04-x64": {
"libClangSharp": {
"libClangSharp.runtime.ubuntu.16.04-x64": "10.0.1-beta2"
"libClangSharp.runtime.ubuntu.16.04-x64": "10.0.2-beta2"
}
},
"ubuntu.18.04-x64": {
"libClangSharp": {
"libClangSharp.runtime.ubuntu.18.04-x64": "10.0.1-beta2"
"libClangSharp.runtime.ubuntu.18.04-x64": "10.0.2-beta2"
}
},
"ubuntu.20.04-x64": {
"libClangSharp": {
"libClangSharp.runtime.ubuntu.20.04-x64": "10.0.1-beta2"
"libClangSharp.runtime.ubuntu.20.04-x64": "10.0.2-beta2"
}
},
"win-x64": {
"libClangSharp": {
"libClangSharp.runtime.win-x64": "10.0.1-beta2"
"libClangSharp.runtime.win-x64": "10.0.2-beta2"
}
},
"win-x86": {
"libClangSharp": {
"libClangSharp.runtime.win-x86": "10.0.1-beta2"
"libClangSharp.runtime.win-x86": "10.0.2-beta2"
}
}
}
Expand Down
26 changes: 16 additions & 10 deletions sources/ClangSharp.PInvokeGenerator/OutputBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -119,34 +119,40 @@ public void WriteIndentedLine<T>(T value)
WriteLine(value);
}

public void WriteLine()
public void WriteLine<T>(T value)
{
_contents.Add(_currentLine.ToString());
_currentLine.Clear();
Write(value);
WriteNewline();
}

public void WriteLine<T>(T value)
public void WriteNewline()
{
Write(value);
WriteLine();
_contents.Add(_currentLine.ToString());
_currentLine.Clear();
NeedsNewline = false;
}

public void WriteNewlineIfNeeded()
{
if (NeedsNewline)
{
WriteLine();
WriteNewline();
}
NeedsNewline = false;
}

public void WriteSemicolon()
{
Write(';');
NeedsSemicolon = false;
NeedsNewline = true;
}

public void WriteSemicolonIfNeeded()
{
if (NeedsSemicolon)
{
WriteLine(';');
WriteSemicolon();
}
NeedsSemicolon = true;
}
}
}
Loading

0 comments on commit 28dd073

Please sign in to comment.