Skip to content

Commit ad822e7

Browse files
committed
Updated to Clang 12.0.1.
1 parent 6ca064c commit ad822e7

File tree

5 files changed

+10
-14
lines changed

5 files changed

+10
-14
lines changed

.github/workflows/Biohazrd.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ env:
88
DOTNET_CLI_TELEMETRY_OPTOUT: true
99
DOTNET_GENERATE_ASPNET_CERTIFICATE: false
1010
ContinuousIntegrationBuild: true
11-
# Workaround for https://github.com/InfectedLibraries/Biohazrd/issues/176 until we have time for a proper fix.
12-
VCToolsInstallDir: C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.25.28610\
1311
jobs:
1412
build-and-test:
1513
strategy:

Biohazrd.Utilities/InlineExportHelper.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ protected override TransformationResult TransformFunction(TransformationContext
128128
{
129129
// We can't use a trampoline function to call an abstract constructor, a different approach is necessary here.
130130
// https://github.com/InfectedLibraries/Biohazrd/issues/14
131-
if (functionDecl.CursorParent is CXXRecordDecl { IsAbstract: true })
131+
if (functionDecl.SemanticParentCursor is CXXRecordDecl { IsAbstract: true })
132132
{
133133
return declaration with { Diagnostics = declaration.Diagnostics.Add(Severity.Warning, "Constructor needs to be exported to be accessible, but it is abstract.") };
134134
}
@@ -265,7 +265,7 @@ protected override TranslatedLibrary PostTransformLibrary(TranslatedLibrary libr
265265

266266
if (functionDecl is CXXMethodDecl)
267267
{
268-
parentRecord = functionDecl.CursorParent as RecordDecl;
268+
parentRecord = functionDecl.SemanticParentCursor as RecordDecl;
269269
Debug.Assert(parentRecord is not null);
270270
}
271271

@@ -348,10 +348,10 @@ protected override TranslatedLibrary PostTransformLibrary(TranslatedLibrary libr
348348

349349
private void WriteOutNamespaceAndType(Cursor cursor)
350350
{
351-
if (cursor is TranslationUnitDecl || cursor.CursorParent is null)
351+
if (cursor is TranslationUnitDecl || cursor.SemanticParentCursor is null)
352352
{ return; }
353353

354-
WriteOutNamespaceAndType(cursor.CursorParent);
354+
WriteOutNamespaceAndType(cursor.SemanticParentCursor);
355355

356356
switch (cursor)
357357
{

Biohazrd/#Declarations/TranslatedEnumConstant.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ internal TranslatedEnumConstant(TranslatedFile file, EnumConstantDecl enumConsta
2626
else
2727
{
2828
HasExplicitValue = true;
29-
IsHexValue = integerLiteral.Value.StartsWith("0x", StringComparison.InvariantCultureIgnoreCase);
29+
IsHexValue = integerLiteral.ValueString.StartsWith("0x", StringComparison.InvariantCultureIgnoreCase);
3030
}
3131
}
3232

Biohazrd/#Declarations/TranslatedStaticField.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ internal TranslatedStaticField(TranslatedFile file, VarDecl variable)
1717
MangledName = variable.Handle.Mangling.ToString();
1818

1919
// Static variables outside of records should always be public.
20-
if (variable.CursorParent is not RecordDecl)
20+
if (variable.SemanticParentCursor is not RecordDecl)
2121
{ Accessibility = AccessModifier.Public; }
2222
}
2323

Biohazrd/Biohazrd.csproj

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,12 @@
55
</PropertyGroup>
66

77
<ItemGroup>
8-
<PackageReference Include="ClangSharp" Version="10.0.0-beta" />
9-
<PackageReference Include="ClangSharp.Pathogen" Version="[0.0.0-ci43]" />
10-
<!--
11-
-->
8+
<PackageReference Include="ClangSharp" Version="[12.0.0-beta2]" />
9+
<PackageReference Include="ClangSharp.Pathogen" Version="[0.0.0-ci45]" />
1210

1311
<!-- Exclude ClangSharp's runtime packages (we provide libclang and libClangSharp via ClangSharp.Pathogen -->
14-
<PackageReference Include="libClang" Version="10.0.0" PrivateAssets="all" />
15-
<PackageReference Include="libClangSharp" Version="10.0.0-beta1" PrivateAssets="all" />
12+
<PackageReference Include="libClang" Version="12.0.0" PrivateAssets="all" />
13+
<PackageReference Include="libClangSharp" Version="12.0.0-beta1" PrivateAssets="all" />
1614

1715
<!-- This package is needed to support __HACK__Stl1300Workaround -->
1816
<PackageReference Include="Microsoft.VisualStudio.Setup.Configuration.Interop" Version="2.3.2262-g94fae01e" />

0 commit comments

Comments
 (0)