@@ -40,38 +40,39 @@ template<typename Request>
4040void reportEvaluatedRequest (UnifiedStatsReporter &stats,
4141 const Request &request);
4242
43- struct SILGenDescriptor {
43+ // / Describes a file or module to be lowered to SIL.
44+ struct ASTLoweringDescriptor {
4445 llvm::PointerUnion<FileUnit *, ModuleDecl *> context;
4546 Lowering::TypeConverter &conv;
4647 const SILOptions &opts;
4748
48- friend llvm::hash_code hash_value (const SILGenDescriptor &owner) {
49+ friend llvm::hash_code hash_value (const ASTLoweringDescriptor &owner) {
4950 return llvm::hash_combine (owner.context , (void *)&owner.conv ,
5051 (void *)&owner.opts );
5152 }
5253
53- friend bool operator ==(const SILGenDescriptor &lhs,
54- const SILGenDescriptor &rhs) {
54+ friend bool operator ==(const ASTLoweringDescriptor &lhs,
55+ const ASTLoweringDescriptor &rhs) {
5556 return lhs.context == rhs.context &&
5657 &lhs.conv == &rhs.conv &&
5758 &lhs.opts == &rhs.opts ;
5859 }
5960
60- friend bool operator !=(const SILGenDescriptor &lhs,
61- const SILGenDescriptor &rhs) {
61+ friend bool operator !=(const ASTLoweringDescriptor &lhs,
62+ const ASTLoweringDescriptor &rhs) {
6263 return !(lhs == rhs);
6364 }
6465
6566public:
66- static SILGenDescriptor forFile (FileUnit &sf, Lowering::TypeConverter &conv,
67- const SILOptions &opts) {
68- return SILGenDescriptor {&sf, conv, opts};
67+ static ASTLoweringDescriptor
68+ forFile (FileUnit &sf, Lowering::TypeConverter &conv, const SILOptions &opts) {
69+ return ASTLoweringDescriptor {&sf, conv, opts};
6970 }
7071
71- static SILGenDescriptor forWholeModule (ModuleDecl *mod,
72- Lowering::TypeConverter &conv,
73- const SILOptions &opts) {
74- return SILGenDescriptor {mod, conv, opts};
72+ static ASTLoweringDescriptor forWholeModule (ModuleDecl *mod,
73+ Lowering::TypeConverter &conv,
74+ const SILOptions &opts) {
75+ return ASTLoweringDescriptor {mod, conv, opts};
7576 }
7677
7778 // / For a single file input, returns a single element array containing that
@@ -83,13 +84,17 @@ struct SILGenDescriptor {
8384 SourceFile *getSourceFileToParse () const ;
8485};
8586
86- void simple_display (llvm::raw_ostream &out, const SILGenDescriptor &d);
87+ void simple_display (llvm::raw_ostream &out, const ASTLoweringDescriptor &d);
8788
88- SourceLoc extractNearestSourceLoc (const SILGenDescriptor &desc);
89+ SourceLoc extractNearestSourceLoc (const ASTLoweringDescriptor &desc);
8990
90- class SILGenerationRequest
91+ // / Lowers a file or module to SIL. In most cases this involves transforming
92+ // / a file's AST into SIL, through SILGen. However it can also handle files
93+ // / containing SIL in textual or binary form, which will be parsed or
94+ // / deserialized as needed.
95+ class ASTLoweringRequest
9196 : public SimpleRequest<
92- SILGenerationRequest , std::unique_ptr<SILModule>(SILGenDescriptor ),
97+ ASTLoweringRequest , std::unique_ptr<SILModule>(ASTLoweringDescriptor ),
9398 RequestFlags::Uncached | RequestFlags::DependencySource> {
9499public:
95100 using SimpleRequest::SimpleRequest;
@@ -98,8 +103,8 @@ class SILGenerationRequest
98103 friend SimpleRequest;
99104
100105 // Evaluation.
101- std::unique_ptr<SILModule>
102- evaluate (Evaluator &evaluator, SILGenDescriptor desc) const ;
106+ std::unique_ptr<SILModule> evaluate (Evaluator &evaluator,
107+ ASTLoweringDescriptor desc) const ;
103108
104109public:
105110 // Incremental dependencies.
@@ -110,7 +115,7 @@ class SILGenerationRequest
110115// / Parses a .sil file into a SILModule.
111116class ParseSILModuleRequest
112117 : public SimpleRequest<ParseSILModuleRequest,
113- std::unique_ptr<SILModule>(SILGenDescriptor ),
118+ std::unique_ptr<SILModule>(ASTLoweringDescriptor ),
114119 RequestFlags::Uncached> {
115120public:
116121 using SimpleRequest::SimpleRequest;
@@ -119,8 +124,8 @@ class ParseSILModuleRequest
119124 friend SimpleRequest;
120125
121126 // Evaluation.
122- std::unique_ptr<SILModule>
123- evaluate (Evaluator &evaluator, SILGenDescriptor desc) const ;
127+ std::unique_ptr<SILModule> evaluate (Evaluator &evaluator,
128+ ASTLoweringDescriptor desc) const ;
124129};
125130
126131// / The zone number for SILGen.
0 commit comments