@@ -43,7 +43,8 @@ public override TypePrinterResult VisitTagType(TagType tag, TypeQualifiers quals
43
43
return $ "{ qual } { tag . Declaration . Visit ( this ) } ";
44
44
}
45
45
46
- public override TypePrinterResult VisitArrayType ( ArrayType array , TypeQualifiers quals )
46
+ public override TypePrinterResult VisitArrayType ( ArrayType array ,
47
+ TypeQualifiers quals )
47
48
{
48
49
var arraySuffix = string . Empty ;
49
50
@@ -83,7 +84,8 @@ private static string ConvertModifierToString(PointerType.TypeModifier modifier)
83
84
return string . Empty ;
84
85
}
85
86
86
- public override TypePrinterResult VisitPointerType ( PointerType pointer , TypeQualifiers quals )
87
+ public override TypePrinterResult VisitPointerType ( PointerType pointer ,
88
+ TypeQualifiers quals )
87
89
{
88
90
var pointeeType = pointer . Pointee . Visit ( this , pointer . QualifiedPointee . Qualifiers ) ;
89
91
var mod = PrintTypeModifiers ? ConvertModifierToString ( pointer . Modifier ) : string . Empty ;
@@ -96,18 +98,21 @@ public override TypePrinterResult VisitPointerType(PointerType pointer, TypeQual
96
98
return pointeeType ;
97
99
}
98
100
99
- public override TypePrinterResult VisitMemberPointerType ( MemberPointerType member , TypeQualifiers quals )
101
+ public override TypePrinterResult VisitMemberPointerType ( MemberPointerType member ,
102
+ TypeQualifiers quals )
100
103
{
101
104
return string . Empty ;
102
105
}
103
106
104
- public override TypePrinterResult VisitBuiltinType ( BuiltinType builtin , TypeQualifiers quals )
107
+ public override TypePrinterResult VisitBuiltinType ( BuiltinType builtin ,
108
+ TypeQualifiers quals )
105
109
{
106
110
var qual = GetStringQuals ( quals ) ;
107
111
return $ "{ qual } { VisitPrimitiveType ( builtin . Type ) } ";
108
112
}
109
113
110
- public override TypePrinterResult VisitPrimitiveType ( PrimitiveType primitive , TypeQualifiers quals )
114
+ public override TypePrinterResult VisitPrimitiveType ( PrimitiveType primitive ,
115
+ TypeQualifiers quals )
111
116
{
112
117
var qual = GetStringQuals ( quals ) ;
113
118
return $ "{ qual } { VisitPrimitiveType ( primitive ) } ";
@@ -142,7 +147,9 @@ public virtual TypePrinterResult VisitPrimitiveType(PrimitiveType primitive)
142
147
case PrimitiveType . Float128 : return "__float128" ;
143
148
case PrimitiveType . IntPtr : return "void*" ;
144
149
case PrimitiveType . UIntPtr : return "uintptr_t" ;
145
- case PrimitiveType . Null : return PrintFlavorKind == CppTypePrintFlavorKind . Cpp ? "std::nullptr_t" : "NULL" ;
150
+ case PrimitiveType . Null :
151
+ return PrintFlavorKind == CppTypePrintFlavorKind . Cpp ?
152
+ "std::nullptr_t" : "NULL" ;
146
153
case PrimitiveType . String :
147
154
{
148
155
switch ( PrintFlavorKind )
@@ -175,7 +182,8 @@ public virtual TypePrinterResult VisitPrimitiveType(PrimitiveType primitive)
175
182
throw new NotSupportedException ( ) ;
176
183
}
177
184
178
- public override TypePrinterResult VisitTypedefType ( TypedefType typedef , TypeQualifiers quals )
185
+ public override TypePrinterResult VisitTypedefType ( TypedefType typedef ,
186
+ TypeQualifiers quals )
179
187
{
180
188
FunctionType func ;
181
189
var qual = GetStringQuals ( quals ) ;
@@ -187,17 +195,20 @@ public override TypePrinterResult VisitTypedefType(TypedefType typedef, TypeQual
187
195
return $ "{ qual } { typedef . Declaration . Visit ( this ) } ";
188
196
}
189
197
190
- public override TypePrinterResult VisitAttributedType ( AttributedType attributed , TypeQualifiers quals )
198
+ public override TypePrinterResult VisitAttributedType ( AttributedType attributed ,
199
+ TypeQualifiers quals )
191
200
{
192
201
return attributed . Modified . Visit ( this ) ;
193
202
}
194
203
195
- public override TypePrinterResult VisitDecayedType ( DecayedType decayed , TypeQualifiers quals )
204
+ public override TypePrinterResult VisitDecayedType ( DecayedType decayed ,
205
+ TypeQualifiers quals )
196
206
{
197
207
return decayed . Decayed . Visit ( this ) ;
198
208
}
199
209
200
- public override TypePrinterResult VisitTemplateSpecializationType ( TemplateSpecializationType template , TypeQualifiers quals )
210
+ public override TypePrinterResult VisitTemplateSpecializationType (
211
+ TemplateSpecializationType template , TypeQualifiers quals )
201
212
{
202
213
var specialization = template . GetClassTemplateSpecialization ( ) ;
203
214
if ( specialization == null )
@@ -215,7 +226,8 @@ public override TypePrinterResult VisitDependentTemplateSpecializationType(
215
226
return string . Empty ;
216
227
}
217
228
218
- public override TypePrinterResult VisitTemplateParameterType ( TemplateParameterType param , TypeQualifiers quals )
229
+ public override TypePrinterResult VisitTemplateParameterType (
230
+ TemplateParameterType param , TypeQualifiers quals )
219
231
{
220
232
if ( param . Parameter == null || param . Parameter . Name == null )
221
233
return string . Empty ;
@@ -229,29 +241,35 @@ public override TypePrinterResult VisitTemplateParameterSubstitutionType(
229
241
return param . Replacement . Type . Visit ( this , quals ) ;
230
242
}
231
243
232
- public override TypePrinterResult VisitInjectedClassNameType ( InjectedClassNameType injected , TypeQualifiers quals )
244
+ public override TypePrinterResult VisitInjectedClassNameType (
245
+ InjectedClassNameType injected , TypeQualifiers quals )
233
246
{
234
247
return injected . Class . Visit ( this ) ;
235
248
}
236
249
237
- public override TypePrinterResult VisitDependentNameType ( DependentNameType dependent , TypeQualifiers quals )
250
+ public override TypePrinterResult VisitDependentNameType (
251
+ DependentNameType dependent , TypeQualifiers quals )
238
252
{
239
- return dependent . Qualifier . Type != null ? dependent . Qualifier . Visit ( this ) . Type : string . Empty ;
253
+ return dependent . Qualifier . Type != null ?
254
+ dependent . Qualifier . Visit ( this ) . Type : string . Empty ;
240
255
}
241
256
242
- public override TypePrinterResult VisitPackExpansionType ( PackExpansionType packExpansionType , TypeQualifiers quals )
257
+ public override TypePrinterResult VisitPackExpansionType (
258
+ PackExpansionType packExpansionType , TypeQualifiers quals )
243
259
{
244
260
return string . Empty ;
245
261
}
246
262
247
- public override TypePrinterResult VisitUnaryTransformType ( UnaryTransformType unaryTransformType , TypeQualifiers quals )
263
+ public override TypePrinterResult VisitUnaryTransformType (
264
+ UnaryTransformType unaryTransformType , TypeQualifiers quals )
248
265
{
249
266
if ( unaryTransformType . Desugared . Type != null )
250
267
return unaryTransformType . Desugared . Visit ( this ) ;
251
268
return unaryTransformType . BaseType . Visit ( this ) ;
252
269
}
253
270
254
- public override TypePrinterResult VisitVectorType ( VectorType vectorType , TypeQualifiers quals )
271
+ public override TypePrinterResult VisitVectorType ( VectorType vectorType ,
272
+ TypeQualifiers quals )
255
273
{
256
274
// an incomplete implementation but we'd hardly need anything better
257
275
return "__attribute__()" ;
@@ -293,17 +311,20 @@ public override TypePrinterResult VisitCILType(CILType type, TypeQualifiers qual
293
311
return "void*" ;
294
312
}
295
313
296
- public override TypePrinterResult VisitUnsupportedType ( UnsupportedType type , TypeQualifiers quals )
314
+ public override TypePrinterResult VisitUnsupportedType ( UnsupportedType type ,
315
+ TypeQualifiers quals )
297
316
{
298
317
return string . Empty ;
299
318
}
300
319
301
- public override TypePrinterResult VisitDeclaration ( Declaration decl , TypeQualifiers quals )
320
+ public override TypePrinterResult VisitDeclaration ( Declaration decl ,
321
+ TypeQualifiers quals )
302
322
{
303
323
return VisitDeclaration ( decl ) ;
304
324
}
305
325
306
- public override TypePrinterResult VisitFunctionType ( FunctionType function , TypeQualifiers quals )
326
+ public override TypePrinterResult VisitFunctionType ( FunctionType function ,
327
+ TypeQualifiers quals )
307
328
{
308
329
var arguments = function . Parameters ;
309
330
var returnType = function . ReturnType ;
@@ -336,7 +357,8 @@ public override TypePrinterResult VisitParameters(IEnumerable<Parameter> @params
336
357
return string . Join ( ", " , args ) ;
337
358
}
338
359
339
- public override TypePrinterResult VisitParameter ( Parameter param , bool hasName = true )
360
+ public override TypePrinterResult VisitParameter ( Parameter param ,
361
+ bool hasName = true )
340
362
{
341
363
var result = param . Type . Visit ( this , param . QualifiedType . Qualifiers ) ;
342
364
@@ -358,7 +380,8 @@ public override TypePrinterResult VisitDelegate(FunctionType function)
358
380
throw new NotImplementedException ( ) ;
359
381
}
360
382
361
- public TypePrinterResult GetDeclName ( Declaration declaration , TypePrintScopeKind scope )
383
+ public TypePrinterResult GetDeclName ( Declaration declaration ,
384
+ TypePrintScopeKind scope )
362
385
{
363
386
switch ( scope )
364
387
{
@@ -403,7 +426,8 @@ public override TypePrinterResult VisitClassDecl(Class @class)
403
426
return VisitDeclaration ( @class ) ;
404
427
}
405
428
406
- public override TypePrinterResult VisitClassTemplateSpecializationDecl ( ClassTemplateSpecialization specialization )
429
+ public override TypePrinterResult VisitClassTemplateSpecializationDecl (
430
+ ClassTemplateSpecialization specialization )
407
431
{
408
432
return string . Format ( "{0}<{1}>" , specialization . TemplatedDecl . Visit ( this ) ,
409
433
string . Join ( ", " ,
@@ -424,7 +448,8 @@ public override TypePrinterResult VisitFunctionDecl(Function function)
424
448
425
449
public override TypePrinterResult VisitMethodDecl ( Method method )
426
450
{
427
- // HACK: this should never happen but there's an inexplicable crash with the 32-bit Windows CI - I have no time to fix it right now
451
+ // HACK: this should never happen but there's an inexplicable crash
452
+ // with the 32-bit Windows CI - needs investigation.
428
453
var functionType = method . FunctionType . Type . Desugar ( ) as FunctionType ;
429
454
if ( functionType == null )
430
455
return string . Empty ;
@@ -539,20 +564,23 @@ public override string ToString(CppSharp.AST.Type type)
539
564
return type . Visit ( this ) ;
540
565
}
541
566
542
- public override TypePrinterResult VisitTemplateTemplateParameterDecl ( TemplateTemplateParameter templateTemplateParameter )
567
+ public override TypePrinterResult VisitTemplateTemplateParameterDecl (
568
+ TemplateTemplateParameter templateTemplateParameter )
543
569
{
544
570
return templateTemplateParameter . Name ;
545
571
}
546
572
547
- public override TypePrinterResult VisitTemplateParameterDecl ( TypeTemplateParameter templateParameter )
573
+ public override TypePrinterResult VisitTemplateParameterDecl (
574
+ TypeTemplateParameter templateParameter )
548
575
{
549
576
if ( templateParameter . DefaultArgument . Type == null )
550
577
return templateParameter . Name ;
551
578
552
579
return $ "{ templateParameter . Name } = { templateParameter . DefaultArgument . Visit ( this ) } ";
553
580
}
554
581
555
- public override TypePrinterResult VisitNonTypeTemplateParameterDecl ( NonTypeTemplateParameter nonTypeTemplateParameter )
582
+ public override TypePrinterResult VisitNonTypeTemplateParameterDecl (
583
+ NonTypeTemplateParameter nonTypeTemplateParameter )
556
584
{
557
585
if ( nonTypeTemplateParameter . DefaultArgument == null )
558
586
return nonTypeTemplateParameter . Name ;
@@ -570,7 +598,8 @@ public override TypePrinterResult VisitTypeAliasTemplateDecl(TypeAliasTemplate t
570
598
throw new NotImplementedException ( ) ;
571
599
}
572
600
573
- public override TypePrinterResult VisitFunctionTemplateSpecializationDecl ( FunctionTemplateSpecialization specialization )
601
+ public override TypePrinterResult VisitFunctionTemplateSpecializationDecl (
602
+ FunctionTemplateSpecialization specialization )
574
603
{
575
604
throw new NotImplementedException ( ) ;
576
605
}
@@ -580,7 +609,8 @@ public override TypePrinterResult VisitVarTemplateDecl(VarTemplate template)
580
609
return VisitDeclaration ( template ) ;
581
610
}
582
611
583
- public override TypePrinterResult VisitVarTemplateSpecializationDecl ( VarTemplateSpecialization template )
612
+ public override TypePrinterResult VisitVarTemplateSpecializationDecl (
613
+ VarTemplateSpecialization template )
584
614
{
585
615
throw new NotImplementedException ( ) ;
586
616
}
0 commit comments