Skip to content

Commit b871486

Browse files
authored
Fix/bootstrap update (#1904)
* Fix warning * Code cleanup * Add missing native project launch settings * Fix bootstrap generator Update bootstrap / parser gen lang version * Fix bug in `std::optional` mapping * Fix crash with null template * Use arm64 headers if available * Support some `std::optional/vector` methods * Add optional for csharp * Template type alias cast fix * Update generated bootstrap/parser bindings * Temp fix for build errors in bindings * Fix `IgnoreSystemDeclsPass` not visiting all declared overrides * Drop optional support for now I'm struck on `std::optional:<>:operator=(Ty&&)`, would need to add some code that handles by creating a function for default template arguments but this PR has already become way too large * Add formatting settings * Format all files
1 parent 9d1c484 commit b871486

Some content is hidden

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

58 files changed

+64828
-40971
lines changed

src/AST/Expr.cs

Lines changed: 519 additions & 262 deletions
Large diffs are not rendered by default.

src/AST/Function.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ public enum FunctionSynthKind
144144
DefaultValueOverload,
145145
InterfaceInstance,
146146
InterfaceDispose,
147-
FieldAcessor
147+
FieldAccessor
148148
}
149149

150150
public enum FriendKind
@@ -260,7 +260,7 @@ public QualifiedType OriginalReturnType
260260
}
261261

262262
public FunctionSynthKind SynthKind { get; set; }
263-
public bool IsSynthetized => SynthKind != FunctionSynthKind.None;
263+
public bool IsSynthesized => SynthKind != FunctionSynthKind.None;
264264
public bool IsNonMemberOperator { get; set; }
265265

266266
public Function OriginalFunction { get; set; }

src/AST/FunctionExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public static bool NeedsSymbol(this Method method)
9898
Class @class = (Class)(method.OriginalFunction ?? method).Namespace;
9999
// virtual functions cannot really be inlined and
100100
// we don't need their symbols anyway as we call them through the v-table
101-
return (!method.IsVirtual && !method.IsSynthetized &&
101+
return (!method.IsVirtual && !method.IsSynthesized &&
102102
!method.IsDefaultConstructor && !method.IsCopyConstructor && !method.IsDestructor) ||
103103
(method.IsDefaultConstructor && @class.HasNonTrivialDefaultConstructor) ||
104104
(method.IsCopyConstructor && @class.HasNonTrivialCopyConstructor) ||

src/AST/Method.cs

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -123,10 +123,11 @@ public Method(Function function)
123123
public bool IsExplicit { get; set; }
124124
public bool IsVolatile { get; set; }
125125

126+
private bool? isOverride;
126127
public bool IsOverride
127128
{
128-
get { return isOverride ?? OverriddenMethods.Any(); }
129-
set { isOverride = value; }
129+
get => isOverride ?? OverriddenMethods.Any();
130+
set => isOverride = value;
130131
}
131132

132133
public Method BaseMethod => OverriddenMethods.FirstOrDefault();
@@ -141,7 +142,7 @@ public bool IsOverride
141142
private CXXMethodKind kind;
142143
public CXXMethodKind Kind
143144
{
144-
get { return kind; }
145+
get => kind;
145146
set
146147
{
147148
if (kind != value)
@@ -153,15 +154,9 @@ public CXXMethodKind Kind
153154
}
154155
}
155156

156-
public bool IsConstructor
157-
{
158-
get { return Kind == CXXMethodKind.Constructor; }
159-
}
157+
public bool IsConstructor => Kind == CXXMethodKind.Constructor;
160158

161-
public bool IsDestructor
162-
{
163-
get { return Kind == CXXMethodKind.Destructor; }
164-
}
159+
public bool IsDestructor => Kind == CXXMethodKind.Destructor;
165160

166161
public bool IsDefaultConstructor;
167162
public bool IsCopyConstructor;
@@ -175,23 +170,21 @@ public bool IsDestructor
175170

176171
public int AdjustedOffset { get; set; }
177172

178-
public List<Method> OverriddenMethods { get; } = new List<Method>();
173+
public List<Method> OverriddenMethods { get; } = new();
179174

180175
public bool ConvertToProperty { get; set; }
181176

182177
public Method GetRootBaseMethod()
183178
{
184-
return BaseMethod == null || BaseMethod.BaseMethod == null ?
179+
return BaseMethod?.BaseMethod == null ?
185180
BaseMethod : BaseMethod.GetRootBaseMethod();
186181
}
187182

188183
public override T Visit<T>(IDeclVisitor<T> visitor)
189184
{
190185
return visitor.VisitMethodDecl(this);
191186
}
192-
193-
private bool? isOverride;
194-
187+
195188
public bool HasSameSignature(Method other)
196189
{
197190
return Parameters.SequenceEqual(other.Parameters, ParameterTypeComparer.Instance);

src/AST/Property.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ public Property(Property property)
7676
GetMethod is {OperatorKind: CXXOperatorKind.Subscript};
7777

7878
public bool IsSynthetized =>
79-
(GetMethod != null && GetMethod.IsSynthetized) ||
80-
(SetMethod != null && SetMethod.IsSynthetized);
79+
(GetMethod != null && GetMethod.IsSynthesized) ||
80+
(SetMethod != null && SetMethod.IsSynthesized);
8181

8282
public override T Visit<T>(IDeclVisitor<T> visitor)
8383
{

0 commit comments

Comments
 (0)