@@ -3374,6 +3374,10 @@ enum class CustomAttrTypeKind {
3374
3374
// / Global actors are represented as custom type attributes. They don't
3375
3375
// / have any particularly interesting semantics.
3376
3376
GlobalActor,
3377
+
3378
+ // / Attributes that are discoverable/constructable at runtime given a name.
3379
+ // / They allow unbound generic types.
3380
+ RuntimeMetadata,
3377
3381
};
3378
3382
3379
3383
void simple_display (llvm::raw_ostream &out, CustomAttrTypeKind value);
@@ -3792,6 +3796,57 @@ class MacroDefinitionRequest
3792
3796
bool isCached () const { return true ; }
3793
3797
};
3794
3798
3799
+ class GetRuntimeDiscoverableAttributes
3800
+ : public SimpleRequest<GetRuntimeDiscoverableAttributes,
3801
+ ArrayRef<CustomAttr *>(ValueDecl *),
3802
+ RequestFlags::Cached> {
3803
+ public:
3804
+ using SimpleRequest::SimpleRequest;
3805
+
3806
+ private:
3807
+ friend SimpleRequest;
3808
+
3809
+ ArrayRef<CustomAttr *> evaluate (Evaluator &evaluator, ValueDecl *decl) const ;
3810
+
3811
+ public:
3812
+ bool isCached () const { return true ; }
3813
+ };
3814
+
3815
+ class SynthesizeRuntimeMetadataAttrGenerator
3816
+ : public SimpleRequest<SynthesizeRuntimeMetadataAttrGenerator,
3817
+ Expr *(CustomAttr *, ValueDecl *),
3818
+ RequestFlags::Cached> {
3819
+
3820
+ public:
3821
+ using SimpleRequest::SimpleRequest;
3822
+
3823
+ private:
3824
+ friend SimpleRequest;
3825
+
3826
+ Expr *evaluate (Evaluator &evaluator, CustomAttr *attr,
3827
+ ValueDecl *attachedTo) const ;
3828
+
3829
+ public:
3830
+ bool isCached () const { return true ; }
3831
+ };
3832
+
3833
+ class SynthesizeRuntimeMetadataAttrGeneratorBody
3834
+ : public SimpleRequest<SynthesizeRuntimeMetadataAttrGeneratorBody,
3835
+ BraceStmt *(CustomAttr *, ValueDecl *),
3836
+ RequestFlags::Cached> {
3837
+ public:
3838
+ using SimpleRequest::SimpleRequest;
3839
+
3840
+ private:
3841
+ friend SimpleRequest;
3842
+
3843
+ BraceStmt *evaluate (Evaluator &evaluator, CustomAttr *attr,
3844
+ ValueDecl *attachedTo) const ;
3845
+
3846
+ public:
3847
+ bool isCached () const { return true ; }
3848
+ };
3849
+
3795
3850
// / Compute the local discriminators for the given declaration context.
3796
3851
// /
3797
3852
// / This is a state-changing operation for closures within the context, which
0 commit comments