@@ -3326,6 +3326,10 @@ class ValueDecl : public Decl {
3326
3326
// / Get the decl for this value's opaque result type, if it has one.
3327
3327
OpaqueTypeDecl *getOpaqueResultTypeDecl () const ;
3328
3328
3329
+ // / Gets the decl for this value's opaque result type if it has already been
3330
+ // / computed, or `nullopt` otherwise. This should only be used for dumping.
3331
+ std::optional<OpaqueTypeDecl *> getCachedOpaqueResultTypeDecl () const ;
3332
+
3329
3333
// / Get the representative for this value's opaque result type, if it has one.
3330
3334
// / Returns a `TypeRepr` instead of an `OpaqueReturnTypeRepr` because 'some'
3331
3335
// / types might appear in one or more structural positions, e.g. (some P,
@@ -7769,6 +7773,10 @@ class AbstractFunctionDecl : public GenericContext, public ValueDecl {
7769
7773
// / Retrieves the thrown interface type.
7770
7774
Type getThrownInterfaceType () const ;
7771
7775
7776
+ // / Returns the thrown interface type of this function if it has already been
7777
+ // / computed, otherwise `nullopt`. This should only be used for dumping.
7778
+ std::optional<Type> getCachedThrownInterfaceType () const ;
7779
+
7772
7780
// / Retrieve the "effective" thrown interface type, or std::nullopt if
7773
7781
// / this function cannot throw.
7774
7782
// /
@@ -8329,6 +8337,10 @@ class FuncDecl : public AbstractFunctionDecl {
8329
8337
// / Retrieve the result interface type of this function.
8330
8338
Type getResultInterfaceType () const ;
8331
8339
8340
+ // / Returns the result interface type of this function if it has already been
8341
+ // / computed, otherwise `nullopt`. This should only be used for dumping.
8342
+ std::optional<Type> getCachedResultInterfaceType () const ;
8343
+
8332
8344
// / isUnaryOperator - Determine whether this is a unary operator
8333
8345
// / implementation. This check is a syntactic rather than type-based check,
8334
8346
// / which looks at the number of parameters specified, in order to allow
@@ -9529,6 +9541,10 @@ class MacroDecl : public GenericContext, public ValueDecl {
9529
9541
// / Retrieve the interface type produced when expanding this macro.
9530
9542
Type getResultInterfaceType () const ;
9531
9543
9544
+ // / Returns the result interface type of this macro if it has already been
9545
+ // / computed, otherwise `nullopt`. This should only be used for dumping.
9546
+ std::optional<Type> getCachedResultInterfaceType () const ;
9547
+
9532
9548
// / Determine the contexts in which this macro can be applied.
9533
9549
MacroRoles getMacroRoles () const ;
9534
9550
0 commit comments