2121#include " swift/AST/EvaluatorDependencies.h"
2222#include " swift/AST/SimpleRequest.h"
2323#include " swift/AST/SourceFile.h"
24+ #include " swift/AST/TBDGenRequests.h"
2425#include " swift/SIL/SILDeclRef.h"
2526
2627namespace swift {
@@ -43,6 +44,8 @@ void reportEvaluatedRequest(UnifiedStatsReporter &stats,
4344
4445using SILRefsToEmit = llvm::SmallVector<SILDeclRef, 1 >;
4546
47+ using SymbolSources = llvm::SmallVector<SymbolSource, 1 >;
48+
4649// / Describes a file or module to be lowered to SIL.
4750struct ASTLoweringDescriptor {
4851 llvm::PointerUnion<FileUnit *, ModuleDecl *> context;
@@ -52,20 +55,17 @@ struct ASTLoweringDescriptor {
5255
5356 // / A specific set of SILDeclRefs to emit. If set, only these refs will be
5457 // / emitted. Otherwise the entire \c context will be emitted.
55- llvm::Optional<SILRefsToEmit> refsToEmit ;
58+ llvm::Optional<SymbolSources> SourcesToEmit ;
5659
5760 friend llvm::hash_code hash_value (const ASTLoweringDescriptor &owner) {
5861 return llvm::hash_combine (owner.context , (void *)&owner.conv ,
59- (void *)&owner.opts ,
60- owner.refsToEmit );
62+ (void *)&owner.opts , owner.SourcesToEmit );
6163 }
6264
6365 friend bool operator ==(const ASTLoweringDescriptor &lhs,
6466 const ASTLoweringDescriptor &rhs) {
65- return lhs.context == rhs.context &&
66- &lhs.conv == &rhs.conv &&
67- &lhs.opts == &rhs.opts &&
68- lhs.refsToEmit == rhs.refsToEmit ;
67+ return lhs.context == rhs.context && &lhs.conv == &rhs.conv &&
68+ &lhs.opts == &rhs.opts && lhs.SourcesToEmit == rhs.SourcesToEmit ;
6969 }
7070
7171 friend bool operator !=(const ASTLoweringDescriptor &lhs,
@@ -76,17 +76,19 @@ struct ASTLoweringDescriptor {
7676public:
7777 static ASTLoweringDescriptor
7878 forFile (FileUnit &sf, Lowering::TypeConverter &conv, const SILOptions &opts,
79- llvm::Optional<SILRefsToEmit> refsToEmit = llvm::None,
79+ llvm::Optional<SymbolSources> SourcesToEmit = llvm::None,
8080 const IRGenOptions *irgenOptions = nullptr ) {
81- return ASTLoweringDescriptor{&sf, conv, opts, irgenOptions, refsToEmit};
81+ return ASTLoweringDescriptor{&sf, conv, opts, irgenOptions,
82+ std::move (SourcesToEmit)};
8283 }
8384
8485 static ASTLoweringDescriptor
8586 forWholeModule (ModuleDecl *mod, Lowering::TypeConverter &conv,
8687 const SILOptions &opts,
87- llvm::Optional<SILRefsToEmit> refsToEmit = llvm::None,
88+ llvm::Optional<SymbolSources> SourcesToEmit = llvm::None,
8889 const IRGenOptions *irgenOptions = nullptr ) {
89- return ASTLoweringDescriptor{mod, conv, opts, irgenOptions, refsToEmit};
90+ return ASTLoweringDescriptor{mod, conv, opts, irgenOptions,
91+ std::move (SourcesToEmit)};
9092 }
9193
9294 // / Retrieves the files to generate SIL for. If the descriptor is configured
0 commit comments