Skip to content

Commit e0e07dc

Browse files
Merge pull request #436 from tannergooding/sml-fix
Small infrastructure cleanup
2 parents 958dbac + 1def92c commit e0e07dc

File tree

587 files changed

+3819
-2974
lines changed

Some content is hidden

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

587 files changed

+3819
-2974
lines changed

Directory.Packages.props

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515
<PackageVersion Include="libClang" Version="15.0.0" />
1616
<PackageVersion Include="libClangSharp" Version="15.0.0" />
1717
<PackageVersion Include="Microsoft.Bcl.HashCode" Version="1.1.1" />
18-
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.4.1" />
18+
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.5.0" />
1919
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="1.1.1" />
2020
<PackageVersion Include="NUnit" Version="3.13.3" />
21-
<PackageVersion Include="NUnit3TestAdapter" Version="4.3.1" />
22-
<PackageVersion Include="System.CommandLine" Version="2.0.0-beta4.22272.1" />
21+
<PackageVersion Include="NUnit3TestAdapter" Version="4.4.2" />
22+
<PackageVersion Include="System.CommandLine" Version="2.0.0-beta3.22114.1" />
2323
<PackageVersion Include="System.Memory" Version="4.5.5" />
2424
</ItemGroup>
2525

global.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"sdk": {
33
"version": "7.0.100",
4-
"allowPrerelease": false,
4+
"allowPrerelease": true,
55
"rollForward": "latestFeature"
66
}
77
}

sources/ClangSharp.Interop/Extensions/CXCursor.cs

Lines changed: 872 additions & 866 deletions
Large diffs are not rendered by default.

sources/ClangSharp.Interop/Extensions/CXEvalResult.cs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
22

33
using System;
4+
using static ClangSharp.Interop.CXEvalResultKind;
45

56
namespace ClangSharp.Interop;
67

@@ -11,17 +12,17 @@ public CXEvalResult(IntPtr handle)
1112
Handle = handle;
1213
}
1314

14-
public double AsDouble => (Kind == CXEvalResultKind.CXEval_Float) ? clang.EvalResult_getAsDouble(this) : 0;
15+
public double AsDouble => (Kind == CXEval_Float) ? clang.EvalResult_getAsDouble(this) : 0;
1516

16-
public int AsInt => (Kind == CXEvalResultKind.CXEval_Int) ? clang.EvalResult_getAsInt(this) : 0;
17+
public int AsInt => (Kind == CXEval_Int) ? clang.EvalResult_getAsInt(this) : 0;
1718

18-
public long AsLongLong => (Kind == CXEvalResultKind.CXEval_Int) ? clang.EvalResult_getAsLongLong(this) : 0;
19+
public long AsLongLong => (Kind == CXEval_Int) ? clang.EvalResult_getAsLongLong(this) : 0;
1920

2021
public string AsStr
2122
{
2223
get
2324
{
24-
var pStr = Kind == CXEvalResultKind.CXEval_StrLiteral ? clang.EvalResult_getAsStr(this) : null;
25+
var pStr = Kind == CXEval_StrLiteral ? clang.EvalResult_getAsStr(this) : null;
2526

2627
if (pStr is null)
2728
{
@@ -32,11 +33,11 @@ public string AsStr
3233
}
3334
}
3435

35-
public ulong AsUnsigned => (Kind == CXEvalResultKind.CXEval_Int) ? clang.EvalResult_getAsUnsigned(this) : 0;
36+
public ulong AsUnsigned => (Kind == CXEval_Int) ? clang.EvalResult_getAsUnsigned(this) : 0;
3637

3738
public IntPtr Handle { get; set; }
3839

39-
public bool IsUnsignedInt => (Kind == CXEvalResultKind.CXEval_Int) && (clang.EvalResult_isUnsignedInt(this) != 0);
40+
public bool IsUnsignedInt => (Kind == CXEval_Int) && (clang.EvalResult_isUnsignedInt(this) != 0);
4041

4142
public CXEvalResultKind Kind => clang.EvalResult_getKind(this);
4243

sources/ClangSharp.Interop/Extensions/CXType.cs

Lines changed: 79 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,19 @@
33
using System;
44
using System.Diagnostics;
55
using System.Runtime.InteropServices;
6+
using static ClangSharp.Interop.CXTypeKind;
7+
using static ClangSharp.Interop.CX_TypeClass;
68

79
namespace ClangSharp.Interop;
810

911
[DebuggerDisplay("{DebuggerDisplayString,nq}")]
1012
public unsafe partial struct CXType : IEquatable<CXType>
1113
{
12-
public uint AddressSpace => (kind != CXTypeKind.CXType_Invalid) ? clang.getAddressSpace(this) : default;
14+
public uint AddressSpace => (kind != CXType_Invalid) ? clang.getAddressSpace(this) : default;
1315

1416
public CXCursor AddrSpaceExpr => clangsharp.Type_getAddrSpaceExpr(this);
1517

16-
public CXType AdjustedType => (kind != CXTypeKind.CXType_Invalid) ? clangsharp.Type_getAdjustedType(this) : default;
18+
public CXType AdjustedType => (kind != CXType_Invalid) ? clangsharp.Type_getAdjustedType(this) : default;
1719

1820
public long AlignOf => clang.Type_getAlignOf(this);
1921

@@ -35,27 +37,27 @@ public unsafe partial struct CXType : IEquatable<CXType>
3537

3638
public CXType DecayedType => clangsharp.Type_getDecayedType(this);
3739

38-
public CXCursor Declaration => (kind != CXTypeKind.CXType_Invalid) ? clangsharp.Type_getDeclaration(this) : default;
40+
public CXCursor Declaration => (kind != CXType_Invalid) ? clangsharp.Type_getDeclaration(this) : default;
3941

40-
public CXType DeducedType => (kind != CXTypeKind.CXType_Invalid) ? clangsharp.Type_getDeducedType(this) : default;
42+
public CXType DeducedType => (kind != CXType_Invalid) ? clangsharp.Type_getDeducedType(this) : default;
4143

4244
public int Depth => clangsharp.Type_getDepth(this);
4345

44-
public CXType Desugar => (kind != CXTypeKind.CXType_Invalid) ? clangsharp.Type_desugar(this) : default;
46+
public CXType Desugar => (kind != CXType_Invalid) ? clangsharp.Type_desugar(this) : default;
4547

46-
public CXType ElementType => (kind != CXTypeKind.CXType_Invalid) ? clangsharp.Type_getElementType(this) :default;
48+
public CXType ElementType => (kind != CXType_Invalid) ? clangsharp.Type_getElementType(this) :default;
4749

48-
public CXType EquivalentType => (kind != CXTypeKind.CXType_Invalid) ? clangsharp.Type_getEquivalentType(this) : default;
50+
public CXType EquivalentType => (kind != CXType_Invalid) ? clangsharp.Type_getEquivalentType(this) : default;
4951

5052
public CXCursor_ExceptionSpecificationKind ExceptionSpecificationType => (CXCursor_ExceptionSpecificationKind)clang.getExceptionSpecificationType(this);
5153

5254
public CXCallingConv FunctionTypeCallingConv => clang.getFunctionTypeCallingConv(this);
5355

5456
public int Index => clangsharp.Type_getIndex(this);
5557

56-
public CXType InjectedSpecializationType => (kind != CXTypeKind.CXType_Invalid) ? clangsharp.Type_getInjectedSpecializationType(this) : default;
58+
public CXType InjectedSpecializationType => (kind != CXType_Invalid) ? clangsharp.Type_getInjectedSpecializationType(this) : default;
5759

58-
public CXType InjectedTST => (kind != CXTypeKind.CXType_Invalid) ? clangsharp.Type_getInjectedTST(this) : default;
60+
public CXType InjectedTST => (kind != CXType_Invalid) ? clangsharp.Type_getInjectedTST(this) : default;
5961

6062
public bool IsCanonical => Equals(CanonicalType);
6163

@@ -69,7 +71,7 @@ public unsafe partial struct CXType : IEquatable<CXType>
6971

7072
public bool IsSigned => clangsharp.Type_getIsSigned(this) != 0;
7173

72-
public bool IsSugared => (kind != CXTypeKind.CXType_Invalid) && clangsharp.Type_getIsSugared(this) != 0;
74+
public bool IsSugared => (kind != CXType_Invalid) && clangsharp.Type_getIsSugared(this) != 0;
7375

7476
public bool IsTransparentTagTypedef => clang.Type_isTransparentTagTypedef(this) != 0;
7577

@@ -109,21 +111,21 @@ public unsafe partial struct CXType : IEquatable<CXType>
109111

110112
public CXType ObjCObjectBaseType => clang.Type_getObjCObjectBaseType(this);
111113

112-
public CXType OriginalType => (kind != CXTypeKind.CXType_Invalid) ? clangsharp.Type_getOriginalType(this) : default;
114+
public CXType OriginalType => (kind != CXType_Invalid) ? clangsharp.Type_getOriginalType(this) : default;
113115

114-
public CXCursor OwnedTagDecl => (kind != CXTypeKind.CXType_Invalid) ? clangsharp.Type_getOwnedTagDecl(this) : default;
116+
public CXCursor OwnedTagDecl => (kind != CXType_Invalid) ? clangsharp.Type_getOwnedTagDecl(this) : default;
115117

116-
public CXType PointeeType => (kind != CXTypeKind.CXType_Invalid) ? clangsharp.Type_getPointeeType(this) : default;
118+
public CXType PointeeType => (kind != CXType_Invalid) ? clangsharp.Type_getPointeeType(this) : default;
117119

118120
public CXType ResultType => clang.getResultType(this);
119121

120-
public CXCursor RowExpr => (kind != CXTypeKind.CXType_Invalid) ? clangsharp.Type_getRowExpr(this) : default;
122+
public CXCursor RowExpr => (kind != CXType_Invalid) ? clangsharp.Type_getRowExpr(this) : default;
121123

122-
public CXCursor SizeExpr => (kind != CXTypeKind.CXType_Invalid) ? clangsharp.Type_getSizeExpr(this) : default;
124+
public CXCursor SizeExpr => (kind != CXType_Invalid) ? clangsharp.Type_getSizeExpr(this) : default;
123125

124126
public long SizeOf => clang.Type_getSizeOf(this);
125127

126-
public CXString Spelling => (kind != CXTypeKind.CXType_Invalid) ? clang.getTypeSpelling(this) : default;
128+
public CXString Spelling => (kind != CXType_Invalid) ? clang.getTypeSpelling(this) : default;
127129

128130
public CX_TemplateName TemplateName
129131
{
@@ -141,76 +143,76 @@ public string TypeClassSpelling
141143
{
142144
get
143145
{
144-
Debug.Assert(CX_TypeClass.CX_TypeClass_TypeLast == CX_TypeClass.CX_TypeClass_ExtVector);
145-
Debug.Assert(CX_TypeClass.CX_TypeClass_TagFirst == CX_TypeClass.CX_TypeClass_Record);
146-
Debug.Assert(CX_TypeClass.CX_TypeClass_TagLast == CX_TypeClass.CX_TypeClass_Enum);
146+
Debug.Assert(CX_TypeClass_TypeLast == CX_TypeClass_ExtVector);
147+
Debug.Assert(CX_TypeClass_TagFirst == CX_TypeClass_Record);
148+
Debug.Assert(CX_TypeClass_TagLast == CX_TypeClass_Enum);
147149

148150
return TypeClass switch {
149-
CX_TypeClass.CX_TypeClass_Invalid => "Invalid",
150-
CX_TypeClass.CX_TypeClass_Adjusted => "Adjusted",
151-
CX_TypeClass.CX_TypeClass_Decayed => "Decayed",
152-
CX_TypeClass.CX_TypeClass_ConstantArray => "ConstantArray",
153-
CX_TypeClass.CX_TypeClass_DependentSizedArray => "DependentSizedArray",
154-
CX_TypeClass.CX_TypeClass_IncompleteArray => "IncompleteArray",
155-
CX_TypeClass.CX_TypeClass_VariableArray => "VariableArray",
156-
CX_TypeClass.CX_TypeClass_Atomic => "Atomic",
157-
CX_TypeClass.CX_TypeClass_Attributed => "Attributed",
158-
CX_TypeClass.CX_TypeClass_BTFTagAttributed => "BTFTagAttributed",
159-
CX_TypeClass.CX_TypeClass_BitInt => "BitInt",
160-
CX_TypeClass.CX_TypeClass_BlockPointer => "BlockPointer",
161-
CX_TypeClass.CX_TypeClass_Builtin => "Builtin",
162-
CX_TypeClass.CX_TypeClass_Complex => "Complex",
163-
CX_TypeClass.CX_TypeClass_Decltype => "Decltype",
164-
CX_TypeClass.CX_TypeClass_Auto => "Auto",
165-
CX_TypeClass.CX_TypeClass_DeducedTemplateSpecialization => "DeducedTemplateSpecialization",
166-
CX_TypeClass.CX_TypeClass_DependentAddressSpace => "DependentAddressSpace",
167-
CX_TypeClass.CX_TypeClass_DependentBitInt => "DependentBitInt",
168-
CX_TypeClass.CX_TypeClass_DependentName => "DependentName",
169-
CX_TypeClass.CX_TypeClass_DependentSizedExtVector => "DependentSizedExtVector",
170-
CX_TypeClass.CX_TypeClass_DependentTemplateSpecialization => "DependentTemplateSpecialization",
171-
CX_TypeClass.CX_TypeClass_DependentVector => "DependentVector",
172-
CX_TypeClass.CX_TypeClass_Elaborated => "Elaborated",
173-
CX_TypeClass.CX_TypeClass_FunctionNoProto => "FunctionNoProto",
174-
CX_TypeClass.CX_TypeClass_FunctionProto => "FunctionProto",
175-
CX_TypeClass.CX_TypeClass_InjectedClassName => "InjectedClassName",
176-
CX_TypeClass.CX_TypeClass_MacroQualified => "MacroQualified",
177-
CX_TypeClass.CX_TypeClass_ConstantMatrix => "ConstantMatrix",
178-
CX_TypeClass.CX_TypeClass_DependentSizedMatrix => "DependentSizedMatrix",
179-
CX_TypeClass.CX_TypeClass_MemberPointer => "MemberPointer",
180-
CX_TypeClass.CX_TypeClass_ObjCObjectPointer => "ObjCObjectPointer",
181-
CX_TypeClass.CX_TypeClass_ObjCObject => "ObjCObject",
182-
CX_TypeClass.CX_TypeClass_ObjCInterface => "ObjCInterface",
183-
CX_TypeClass.CX_TypeClass_ObjCTypeParam => "ObjCTypeParam",
184-
CX_TypeClass.CX_TypeClass_PackExpansion => "PackExpansion",
185-
CX_TypeClass.CX_TypeClass_Paren => "Paren",
186-
CX_TypeClass.CX_TypeClass_Pipe => "Pipe",
187-
CX_TypeClass.CX_TypeClass_Pointer => "Pointer",
188-
CX_TypeClass.CX_TypeClass_LValueReference => "LValueReference",
189-
CX_TypeClass.CX_TypeClass_RValueReference => "RValueReference",
190-
CX_TypeClass.CX_TypeClass_SubstTemplateTypeParmPack => "SubstTemplateTypeParmPack",
191-
CX_TypeClass.CX_TypeClass_SubstTemplateTypeParm => "SubstTemplateTypeParm",
192-
CX_TypeClass.CX_TypeClass_Enum => "Enum",
193-
CX_TypeClass.CX_TypeClass_Record => "Record",
194-
CX_TypeClass.CX_TypeClass_TemplateSpecialization => "TemplateSpecialization",
195-
CX_TypeClass.CX_TypeClass_TemplateTypeParm => "TemplateTypeParm",
196-
CX_TypeClass.CX_TypeClass_TypeOfExpr => "TypeOfExpr",
197-
CX_TypeClass.CX_TypeClass_TypeOf => "TypeOf",
198-
CX_TypeClass.CX_TypeClass_Typedef => "Typedef",
199-
CX_TypeClass.CX_TypeClass_UnaryTransform => "UnaryTransform",
200-
CX_TypeClass.CX_TypeClass_UnresolvedUsing => "UnresolvedUsing",
201-
CX_TypeClass.CX_TypeClass_Using => "Using",
202-
CX_TypeClass.CX_TypeClass_Vector => "Vector",
203-
CX_TypeClass.CX_TypeClass_ExtVector => "ExtVector",
151+
CX_TypeClass_Invalid => "Invalid",
152+
CX_TypeClass_Adjusted => "Adjusted",
153+
CX_TypeClass_Decayed => "Decayed",
154+
CX_TypeClass_ConstantArray => "ConstantArray",
155+
CX_TypeClass_DependentSizedArray => "DependentSizedArray",
156+
CX_TypeClass_IncompleteArray => "IncompleteArray",
157+
CX_TypeClass_VariableArray => "VariableArray",
158+
CX_TypeClass_Atomic => "Atomic",
159+
CX_TypeClass_Attributed => "Attributed",
160+
CX_TypeClass_BTFTagAttributed => "BTFTagAttributed",
161+
CX_TypeClass_BitInt => "BitInt",
162+
CX_TypeClass_BlockPointer => "BlockPointer",
163+
CX_TypeClass_Builtin => "Builtin",
164+
CX_TypeClass_Complex => "Complex",
165+
CX_TypeClass_Decltype => "Decltype",
166+
CX_TypeClass_Auto => "Auto",
167+
CX_TypeClass_DeducedTemplateSpecialization => "DeducedTemplateSpecialization",
168+
CX_TypeClass_DependentAddressSpace => "DependentAddressSpace",
169+
CX_TypeClass_DependentBitInt => "DependentBitInt",
170+
CX_TypeClass_DependentName => "DependentName",
171+
CX_TypeClass_DependentSizedExtVector => "DependentSizedExtVector",
172+
CX_TypeClass_DependentTemplateSpecialization => "DependentTemplateSpecialization",
173+
CX_TypeClass_DependentVector => "DependentVector",
174+
CX_TypeClass_Elaborated => "Elaborated",
175+
CX_TypeClass_FunctionNoProto => "FunctionNoProto",
176+
CX_TypeClass_FunctionProto => "FunctionProto",
177+
CX_TypeClass_InjectedClassName => "InjectedClassName",
178+
CX_TypeClass_MacroQualified => "MacroQualified",
179+
CX_TypeClass_ConstantMatrix => "ConstantMatrix",
180+
CX_TypeClass_DependentSizedMatrix => "DependentSizedMatrix",
181+
CX_TypeClass_MemberPointer => "MemberPointer",
182+
CX_TypeClass_ObjCObjectPointer => "ObjCObjectPointer",
183+
CX_TypeClass_ObjCObject => "ObjCObject",
184+
CX_TypeClass_ObjCInterface => "ObjCInterface",
185+
CX_TypeClass_ObjCTypeParam => "ObjCTypeParam",
186+
CX_TypeClass_PackExpansion => "PackExpansion",
187+
CX_TypeClass_Paren => "Paren",
188+
CX_TypeClass_Pipe => "Pipe",
189+
CX_TypeClass_Pointer => "Pointer",
190+
CX_TypeClass_LValueReference => "LValueReference",
191+
CX_TypeClass_RValueReference => "RValueReference",
192+
CX_TypeClass_SubstTemplateTypeParmPack => "SubstTemplateTypeParmPack",
193+
CX_TypeClass_SubstTemplateTypeParm => "SubstTemplateTypeParm",
194+
CX_TypeClass_Enum => "Enum",
195+
CX_TypeClass_Record => "Record",
196+
CX_TypeClass_TemplateSpecialization => "TemplateSpecialization",
197+
CX_TypeClass_TemplateTypeParm => "TemplateTypeParm",
198+
CX_TypeClass_TypeOfExpr => "TypeOfExpr",
199+
CX_TypeClass_TypeOf => "TypeOf",
200+
CX_TypeClass_Typedef => "Typedef",
201+
CX_TypeClass_UnaryTransform => "UnaryTransform",
202+
CX_TypeClass_UnresolvedUsing => "UnresolvedUsing",
203+
CX_TypeClass_Using => "Using",
204+
CX_TypeClass_Vector => "Vector",
205+
CX_TypeClass_ExtVector => "ExtVector",
204206
_ => TypeClass.ToString()[13..],
205207
};
206208
}
207209
}
208210

209-
public CXString TypedefName => (kind != CXTypeKind.CXType_Invalid) ? clang.getTypedefName(this) : default;
211+
public CXString TypedefName => (kind != CXType_Invalid) ? clang.getTypedefName(this) : default;
210212

211-
public CXCursor UnderlyingExpr => (kind != CXTypeKind.CXType_Invalid) ? clangsharp.Type_getUnderlyingExpr(this) : default;
213+
public CXCursor UnderlyingExpr => (kind != CXType_Invalid) ? clangsharp.Type_getUnderlyingExpr(this) : default;
212214

213-
public CXType UnderlyingType => (kind != CXTypeKind.CXType_Invalid) ? clangsharp.Type_getUnderlyingType(this) : default;
215+
public CXType UnderlyingType => (kind != CXType_Invalid) ? clangsharp.Type_getUnderlyingType(this) : default;
214216

215217
public CXType ValueType => clang.Type_getValueType(this);
216218

File renamed without changes.
File renamed without changes.
File renamed without changes.

sources/ClangSharp.Interop/CXCodeCompleteResults.cs renamed to sources/ClangSharp.Interop/clang/CXCodeCompleteResults.cs

File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)