@@ -33,6 +33,10 @@ class SILOptions;
3333struct TBDGenOptions ;
3434class TBDGenDescriptor ;
3535
36+ namespace cas {
37+ class SwiftCASOutputBackend ;
38+ }
39+
3640namespace irgen {
3741 class IRGenModule ;
3842}
@@ -149,12 +153,15 @@ struct IRGenDescriptor {
149153
150154 StringRef ModuleName;
151155 const PrimarySpecificPaths &PSPs;
156+ std::shared_ptr<llvm::cas::ObjectStore> CAS;
152157 StringRef PrivateDiscriminator;
153158 ArrayRef<std::string> parallelOutputFilenames;
154159 ArrayRef<std::string> parallelIROutputFilenames;
155160 llvm::GlobalVariable **outModuleHash;
161+ swift::cas::SwiftCASOutputBackend *casBackend = nullptr ;
156162 llvm::raw_pwrite_stream *out = nullptr ;
157163
164+
158165 friend llvm::hash_code hash_value (const IRGenDescriptor &owner) {
159166 return llvm::hash_combine (owner.Ctx , owner.SymbolsToEmit , owner.SILMod );
160167 }
@@ -176,8 +183,10 @@ struct IRGenDescriptor {
176183 const TBDGenOptions &TBDOpts, const SILOptions &SILOpts,
177184 Lowering::TypeConverter &Conv, std::unique_ptr<SILModule> &&SILMod,
178185 StringRef ModuleName, const PrimarySpecificPaths &PSPs,
186+ std::shared_ptr<llvm::cas::ObjectStore> CAS,
179187 StringRef PrivateDiscriminator, SymsToEmit symsToEmit = std::nullopt ,
180- llvm::GlobalVariable **outModuleHash = nullptr ) {
188+ llvm::GlobalVariable **outModuleHash = nullptr ,
189+ cas::SwiftCASOutputBackend *casBackend = nullptr ) {
181190 return IRGenDescriptor{file,
182191 symsToEmit,
183192 Opts,
@@ -187,20 +196,26 @@ struct IRGenDescriptor {
187196 SILMod.release (),
188197 ModuleName,
189198 PSPs,
199+ std::move (CAS),
190200 PrivateDiscriminator,
191201 {},
192202 {},
193- outModuleHash};
203+ outModuleHash,
204+ casBackend};
194205 }
195206
196- static IRGenDescriptor forWholeModule (
197- ModuleDecl *M, const IRGenOptions &Opts, const TBDGenOptions &TBDOpts,
198- const SILOptions &SILOpts, Lowering::TypeConverter &Conv,
199- std::unique_ptr<SILModule> &&SILMod, StringRef ModuleName,
200- const PrimarySpecificPaths &PSPs, SymsToEmit symsToEmit = std::nullopt ,
201- ArrayRef<std::string> parallelOutputFilenames = {},
202- ArrayRef<std::string> parallelIROutputFilenames = {},
203- llvm::GlobalVariable **outModuleHash = nullptr ) {
207+ static IRGenDescriptor
208+ forWholeModule (ModuleDecl *M, const IRGenOptions &Opts,
209+ const TBDGenOptions &TBDOpts, const SILOptions &SILOpts,
210+ Lowering::TypeConverter &Conv,
211+ std::unique_ptr<SILModule> &&SILMod, StringRef ModuleName,
212+ const PrimarySpecificPaths &PSPs,
213+ std::shared_ptr<llvm::cas::ObjectStore> CAS,
214+ SymsToEmit symsToEmit = std::nullopt ,
215+ ArrayRef<std::string> parallelOutputFilenames = {},
216+ ArrayRef<std::string> parallelIROutputFilenames = {},
217+ llvm::GlobalVariable **outModuleHash = nullptr ,
218+ cas::SwiftCASOutputBackend *casBackend = nullptr ) {
204219 return IRGenDescriptor{M,
205220 symsToEmit,
206221 Opts,
@@ -210,10 +225,12 @@ struct IRGenDescriptor {
210225 SILMod.release (),
211226 ModuleName,
212227 PSPs,
228+ std::move (CAS),
213229 " " ,
214230 parallelOutputFilenames,
215231 parallelIROutputFilenames,
216- outModuleHash};
232+ outModuleHash,
233+ casBackend};
217234 }
218235
219236 // / Retrieves the files to perform IR generation for. If the descriptor is
0 commit comments