File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -400,17 +400,17 @@ class alignas(1 << TypeAlignInBits) TypeBase {
400
400
bool hasCanonicalTypeComputed () const { return !CanonicalType.isNull (); }
401
401
402
402
private:
403
- void computeCanonicalType ();
403
+ CanType computeCanonicalType ();
404
404
405
405
public:
406
406
// / getCanonicalType - Return the canonical version of this type, which has
407
407
// / sugar from all levels stripped off.
408
408
CanType getCanonicalType () {
409
409
if (isCanonical ())
410
410
return CanType (this );
411
- if (! hasCanonicalTypeComputed ())
412
- computeCanonicalType ( );
413
- return CanType (CanonicalType. get <TypeBase*>() );
411
+ if (hasCanonicalTypeComputed ())
412
+ return CanType (CanonicalType. get <TypeBase*>() );
413
+ return computeCanonicalType ( );
414
414
}
415
415
416
416
// / getCanonicalType - Stronger canonicalization which folds away equivalent
Original file line number Diff line number Diff line change @@ -1045,7 +1045,7 @@ getCanonicalInputType(AnyFunctionType *funcType,
1045
1045
return inputType;
1046
1046
}
1047
1047
1048
- void TypeBase::computeCanonicalType () {
1048
+ CanType TypeBase::computeCanonicalType () {
1049
1049
assert (!hasCanonicalTypeComputed () && " called unnecessarily" );
1050
1050
1051
1051
TypeBase *Result = nullptr ;
@@ -1223,6 +1223,7 @@ void TypeBase::computeCanonicalType() {
1223
1223
// Cache the canonical type for future queries.
1224
1224
assert (Result && " Case not implemented!" );
1225
1225
CanonicalType = Result;
1226
+ return CanType (Result);
1226
1227
}
1227
1228
1228
1229
CanType TypeBase::getCanonicalType (GenericSignature *sig) {
You can’t perform that action at this time.
0 commit comments