Commit 2d5b04e
committed
AST: Don't canonicalize GenericFunctionTypes in TypeBase::getASTContext()
A TypeBase stores either an ASTContext if its canonical, or its canonical
type if it is not.
getASTContext() will then canonicalize the type if its not canonical.
While this is very clever, in the case of a GenericFunctionType, it
triggers the rather expensive creation of a GenericSignatureBuilder.
Avoid this by special-casing GenericFunctionType here and getting the
ASTContext from a structural sub-component that is known to exist
instead.1 parent 398d07f commit 2d5b04e
1 file changed
+17
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
492 | 492 | | |
493 | 493 | | |
494 | 494 | | |
495 | | - | |
496 | | - | |
497 | | - | |
498 | | - | |
499 | | - | |
500 | | - | |
501 | | - | |
| 495 | + | |
502 | 496 | | |
503 | 497 | | |
504 | 498 | | |
| |||
5994 | 5988 | | |
5995 | 5989 | | |
5996 | 5990 | | |
| 5991 | + | |
| 5992 | + | |
| 5993 | + | |
| 5994 | + | |
| 5995 | + | |
| 5996 | + | |
| 5997 | + | |
| 5998 | + | |
| 5999 | + | |
| 6000 | + | |
| 6001 | + | |
| 6002 | + | |
| 6003 | + | |
| 6004 | + | |
| 6005 | + | |
| 6006 | + | |
5997 | 6007 | | |
5998 | 6008 | | |
5999 | 6009 | | |
| |||
0 commit comments