@@ -3241,6 +3241,10 @@ class ValueDecl : public Decl {
3241
3241
// / Get the decl for this value's opaque result type, if it has one.
3242
3242
OpaqueTypeDecl *getOpaqueResultTypeDecl () const ;
3243
3243
3244
+ // / Gets the decl for this value's opaque result type if it has already been
3245
+ // / computed, or `nullopt` otherwise. This should only be used for dumping.
3246
+ std::optional<OpaqueTypeDecl *> getCachedOpaqueResultTypeDecl () const ;
3247
+
3244
3248
// / Get the representative for this value's opaque result type, if it has one.
3245
3249
// / Returns a `TypeRepr` instead of an `OpaqueReturnTypeRepr` because 'some'
3246
3250
// / types might appear in one or more structural positions, e.g. (some P,
@@ -7657,6 +7661,10 @@ class AbstractFunctionDecl : public GenericContext, public ValueDecl {
7657
7661
// / Retrieves the thrown interface type.
7658
7662
Type getThrownInterfaceType () const ;
7659
7663
7664
+ // / Returns the thrown interface type of this function if it has already been
7665
+ // / computed, otherwise `nullopt`. This should only be used for dumping.
7666
+ std::optional<Type> getCachedThrownInterfaceType () const ;
7667
+
7660
7668
// / Retrieve the "effective" thrown interface type, or std::nullopt if
7661
7669
// / this function cannot throw.
7662
7670
// /
@@ -8217,6 +8225,10 @@ class FuncDecl : public AbstractFunctionDecl {
8217
8225
// / Retrieve the result interface type of this function.
8218
8226
Type getResultInterfaceType () const ;
8219
8227
8228
+ // / Returns the result interface type of this function if it has already been
8229
+ // / computed, otherwise `nullopt`. This should only be used for dumping.
8230
+ std::optional<Type> getCachedResultInterfaceType () const ;
8231
+
8220
8232
// / isUnaryOperator - Determine whether this is a unary operator
8221
8233
// / implementation. This check is a syntactic rather than type-based check,
8222
8234
// / which looks at the number of parameters specified, in order to allow
@@ -9417,6 +9429,10 @@ class MacroDecl : public GenericContext, public ValueDecl {
9417
9429
// / Retrieve the interface type produced when expanding this macro.
9418
9430
Type getResultInterfaceType () const ;
9419
9431
9432
+ // / Returns the result interface type of this macro if it has already been
9433
+ // / computed, otherwise `nullopt`. This should only be used for dumping.
9434
+ std::optional<Type> getCachedResultInterfaceType () const ;
9435
+
9420
9436
// / Determine the contexts in which this macro can be applied.
9421
9437
MacroRoles getMacroRoles () const ;
9422
9438
0 commit comments