@@ -71,7 +71,7 @@ - (id)debugQuickLookObject;
71
71
// really matter yet since we don't have any special mirror behavior for
72
72
// concrete metatypes yet.
73
73
while (T->getKind () == MetadataKind::Existential) {
74
- auto existential
74
+ auto * existential
75
75
= static_cast <const ExistentialTypeMetadata *>(T);
76
76
77
77
// Unwrap the existential container.
@@ -94,8 +94,8 @@ static bool loadSpecialReferenceStorage(OpaqueValue *fieldData,
94
94
auto type = fieldType.getType ();
95
95
assert (type->getKind () == MetadataKind::Optional);
96
96
97
- auto weakField = reinterpret_cast <WeakReference *>(fieldData);
98
- auto strongValue = swift_unknownWeakLoadStrong (weakField);
97
+ auto * weakField = reinterpret_cast <WeakReference *>(fieldData);
98
+ auto * strongValue = swift_unknownWeakLoadStrong (weakField);
99
99
100
100
// Now that we have a strong reference, we need to create a temporary buffer
101
101
// from which to copy the whole value, which might be a native class-bound
@@ -108,15 +108,15 @@ static bool loadSpecialReferenceStorage(OpaqueValue *fieldData,
108
108
// - the witness table for Protocol1
109
109
// - the witness table for Protocol2
110
110
111
- auto weakContainer =
111
+ auto * weakContainer =
112
112
reinterpret_cast <WeakClassExistentialContainer *>(fieldData);
113
113
114
114
// Create a temporary existential where we can put the strong reference.
115
115
// The allocateBuffer value witness requires a ValueBuffer to own the
116
116
// allocated storage.
117
117
ValueBuffer temporaryBuffer;
118
118
119
- auto temporaryValue = reinterpret_cast <ClassExistentialContainer *>(
119
+ auto * temporaryValue = reinterpret_cast <ClassExistentialContainer *>(
120
120
type->allocateBufferIn (&temporaryBuffer));
121
121
122
122
// Now copy the entire value out of the parent, which will include the
@@ -170,19 +170,19 @@ virtual AnyReturn subscript(intptr_t index, const char **outName,
170
170
171
171
172
172
// Implementation for tuples.
173
- struct TupleImpl : ReflectionMirrorImpl {
173
+ struct TupleImpl : ReflectionMirrorImpl {
174
174
char displayStyle () {
175
175
return ' t' ;
176
176
}
177
177
178
178
intptr_t count () {
179
- auto Tuple = static_cast <const TupleTypeMetadata *>(type);
179
+ auto * Tuple = static_cast <const TupleTypeMetadata *>(type);
180
180
return Tuple->NumElements ;
181
181
}
182
182
183
183
AnyReturn subscript (intptr_t i, const char **outName,
184
184
void (**outFreeFunc)(const char *)) {
185
- auto Tuple = static_cast <const TupleTypeMetadata *>(type);
185
+ auto * Tuple = static_cast <const TupleTypeMetadata *>(type);
186
186
187
187
if (i < 0 || (size_t )i > Tuple->NumElements )
188
188
swift::crash (" Swift mirror subscript bounds check failure" );
@@ -214,8 +214,8 @@ AnyReturn subscript(intptr_t i, const char **outName,
214
214
215
215
// Get the nth element.
216
216
auto &elt = Tuple->getElement (i);
217
- auto bytes = reinterpret_cast <const char *>(value);
218
- auto eltData = reinterpret_cast <const OpaqueValue *>(bytes + elt.Offset );
217
+ auto * bytes = reinterpret_cast <const char *>(value);
218
+ auto * eltData = reinterpret_cast <const OpaqueValue *>(bytes + elt.Offset );
219
219
220
220
Any result;
221
221
@@ -230,19 +230,19 @@ AnyReturn subscript(intptr_t i, const char **outName,
230
230
231
231
232
232
// Implementation for structs.
233
- struct StructImpl : ReflectionMirrorImpl {
233
+ struct StructImpl : ReflectionMirrorImpl {
234
234
char displayStyle () {
235
235
return ' s' ;
236
236
}
237
237
238
238
intptr_t count () {
239
- auto Struct = static_cast <const StructMetadata *>(type);
239
+ auto * Struct = static_cast <const StructMetadata *>(type);
240
240
return Struct->Description ->Struct .NumFields ;
241
241
}
242
242
243
243
AnyReturn subscript (intptr_t i, const char **outName,
244
244
void (**outFreeFunc)(const char *)) {
245
- auto Struct = static_cast <const StructMetadata *>(type);
245
+ auto * Struct = static_cast <const StructMetadata *>(type);
246
246
247
247
if (i < 0 || (size_t )i > Struct->Description ->Struct .NumFields )
248
248
swift::crash (" Swift mirror subscript bounds check failure" );
@@ -251,8 +251,8 @@ AnyReturn subscript(intptr_t i, const char **outName,
251
251
auto fieldType = Struct->getFieldTypes ()[i];
252
252
auto fieldOffset = Struct->getFieldOffsets ()[i];
253
253
254
- auto bytes = reinterpret_cast <char *>(value);
255
- auto fieldData = reinterpret_cast <OpaqueValue *>(bytes + fieldOffset);
254
+ auto * bytes = reinterpret_cast <char *>(value);
255
+ auto * fieldData = reinterpret_cast <OpaqueValue *>(bytes + fieldOffset);
256
256
257
257
*outName = getFieldName (Struct->Description ->Struct .FieldNames , i);
258
258
*outFreeFunc = nullptr ;
@@ -273,9 +273,9 @@ AnyReturn subscript(intptr_t i, const char **outName,
273
273
274
274
275
275
// Implementation for enums.
276
- struct EnumImpl : ReflectionMirrorImpl {
276
+ struct EnumImpl : ReflectionMirrorImpl {
277
277
bool isReflectable () {
278
- const auto Enum = static_cast <const EnumMetadata *>(type);
278
+ const auto * Enum = static_cast <const EnumMetadata *>(type);
279
279
const auto &Description = Enum->Description ->Enum ;
280
280
281
281
// No metadata for C and @objc enums yet
@@ -286,7 +286,7 @@ bool isReflectable() {
286
286
}
287
287
288
288
void getInfo (unsigned *tagPtr, const Metadata **payloadTypePtr, bool *indirectPtr) {
289
- const auto Enum = static_cast <const EnumMetadata *>(type);
289
+ const auto * Enum = static_cast <const EnumMetadata *>(type);
290
290
const auto &Description = Enum->Description ->Enum ;
291
291
292
292
unsigned payloadCases = Description.getNumPayloadCases ();
@@ -330,7 +330,7 @@ intptr_t count() {
330
330
331
331
AnyReturn subscript (intptr_t i, const char **outName,
332
332
void (**outFreeFunc)(const char *)) {
333
- const auto Enum = static_cast <const EnumMetadata *>(type);
333
+ const auto * Enum = static_cast <const EnumMetadata *>(type);
334
334
const auto &Description = Enum->Description ->Enum ;
335
335
336
336
unsigned tag;
@@ -375,7 +375,7 @@ AnyReturn subscript(intptr_t i, const char **outName,
375
375
return nullptr ;
376
376
}
377
377
378
- const auto Enum = static_cast <const EnumMetadata *>(type);
378
+ const auto * Enum = static_cast <const EnumMetadata *>(type);
379
379
const auto &Description = Enum->Description ->Enum ;
380
380
381
381
unsigned tag;
@@ -388,21 +388,21 @@ AnyReturn subscript(intptr_t i, const char **outName,
388
388
389
389
390
390
// Implementation for classes.
391
- struct ClassImpl : ReflectionMirrorImpl {
391
+ struct ClassImpl : ReflectionMirrorImpl {
392
392
char displayStyle () {
393
393
return ' c' ;
394
394
}
395
395
396
396
intptr_t count () {
397
- auto Clas = static_cast <const ClassMetadata*>(type);
397
+ auto * Clas = static_cast <const ClassMetadata*>(type);
398
398
auto count = Clas->getDescription ()->Class .NumFields ;
399
399
400
400
return count;
401
401
}
402
402
403
403
AnyReturn subscript (intptr_t i, const char **outName,
404
404
void (**outFreeFunc)(const char *)) {
405
- auto Clas = static_cast <const ClassMetadata*>(type);
405
+ auto * Clas = static_cast <const ClassMetadata*>(type);
406
406
407
407
if (i < 0 || (size_t )i > Clas->getDescription ()->Class .NumFields )
408
408
swift::crash (" Swift mirror subscript bounds check failure" );
@@ -428,8 +428,8 @@ AnyReturn subscript(intptr_t i, const char **outName,
428
428
#endif
429
429
}
430
430
431
- auto bytes = *reinterpret_cast <char * const *>(value);
432
- auto fieldData = reinterpret_cast <OpaqueValue *>(bytes + fieldOffset);
431
+ auto * bytes = *reinterpret_cast <char * const *>(value);
432
+ auto * fieldData = reinterpret_cast <OpaqueValue *>(bytes + fieldOffset);
433
433
434
434
*outName = getFieldName (Clas->getDescription ()->Class .FieldNames , i);
435
435
*outFreeFunc = nullptr ;
@@ -464,7 +464,7 @@ id quickLookObject() {
464
464
465
465
#if SWIFT_OBJC_INTEROP
466
466
// Implementation for ObjC classes.
467
- struct ObjCClassImpl : ClassImpl {
467
+ struct ObjCClassImpl : ClassImpl {
468
468
intptr_t count () {
469
469
// ObjC makes no guarantees about the state of ivars, so we can't safely
470
470
// introspect them in the general case.
@@ -480,7 +480,7 @@ AnyReturn subscript(intptr_t i, const char **outName,
480
480
481
481
482
482
// Implementation for metatypes.
483
- struct MetatypeImpl : ReflectionMirrorImpl {
483
+ struct MetatypeImpl : ReflectionMirrorImpl {
484
484
char displayStyle () {
485
485
return ' \0 ' ;
486
486
}
@@ -497,7 +497,7 @@ AnyReturn subscript(intptr_t i, const char **outName,
497
497
498
498
499
499
// Implementation for opaque types.
500
- struct OpaqueImpl : ReflectionMirrorImpl {
500
+ struct OpaqueImpl : ReflectionMirrorImpl {
501
501
char displayStyle () {
502
502
return ' \0 ' ;
503
503
}
@@ -549,7 +549,7 @@ auto call(OpaqueValue *passedValue, const Metadata *T, const Metadata *passedTyp
549
549
#if SWIFT_OBJC_INTEROP
550
550
// If this is a pure ObjC class, reflect it using ObjC's runtime facilities.
551
551
// ForeignClass (e.g. CF classes) manifests as a NULL class object.
552
- auto classObject = passedType->getClassObject ();
552
+ auto * classObject = passedType->getClassObject ();
553
553
if (classObject == nullptr || !classObject->isTypeMetadata ()) {
554
554
ObjCClassImpl impl;
555
555
return call (&impl);
@@ -644,8 +644,9 @@ auto call(OpaqueValue *passedValue, const Metadata *T, const Metadata *passedTyp
644
644
intptr_t swift_reflectionMirror_count(OpaqueValue *value,
645
645
const Metadata *type,
646
646
const Metadata *T) {
647
- auto c = call (value, T, type, [](ReflectionMirrorImpl *impl) { return impl->count (); });
648
- return c;
647
+ return call (value, T, type, [](ReflectionMirrorImpl *impl) {
648
+ return impl->count ();
649
+ });
649
650
}
650
651
651
652
// We intentionally use a non-POD return type with this entry point to give
0 commit comments