@@ -208,7 +208,11 @@ struct InterfaceSubContextDelegateImpl: InterfaceSubContextDelegate {
208
208
private:
209
209
SourceManager &SM;
210
210
DiagnosticEngine &Diags;
211
+ llvm::BumpPtrAllocator Allocator;
212
+ llvm::StringSaver ArgSaver;
213
+ std::vector<StringRef> GenericArgs;
211
214
CompilerInvocation subInvocation;
215
+ std::vector<SupplementaryOutputPaths> ModuleOutputPaths;
212
216
213
217
template <typename ...ArgTypes>
214
218
InFlightDiagnostic diagnose (StringRef interfacePath,
@@ -222,45 +226,43 @@ struct InterfaceSubContextDelegateImpl: InterfaceSubContextDelegate {
222
226
}
223
227
return Diags.diagnose (loc, ID, std::move (Args)...);
224
228
}
225
-
226
- bool extractSwiftInterfaceVersionAndArgs (llvm::StringSaver &SubArgSaver,
227
- SmallVectorImpl<const char *> &SubArgs,
229
+ void inheritOptionsForBuildingInterface ( const SearchPathOptions &SearchPathOpts,
230
+ const LangOptions &LangOpts);
231
+ bool extractSwiftInterfaceVersionAndArgs ( SmallVectorImpl<const char *> &SubArgs,
228
232
std::string &CompilerVersion,
229
233
StringRef interfacePath,
230
234
SourceLoc diagnosticLoc);
231
- SubCompilerInstanceInfo createInstance (StringRef moduleName,
232
- StringRef interfacePath,
233
- StringRef outputPath,
234
- SourceLoc diagLoc);
235
235
public:
236
236
InterfaceSubContextDelegateImpl (SourceManager &SM,
237
237
DiagnosticEngine &Diags,
238
238
const SearchPathOptions &searchPathOpts,
239
239
const LangOptions &langOpts,
240
- ClangModuleLoader *clangImporter = nullptr ,
241
- StringRef moduleCachePath = StringRef(),
242
- StringRef prebuiltCachePath = StringRef(),
243
- bool serializeDependencyHashes = false ,
244
- bool trackSystemDependencies = false ,
245
- bool remarkOnRebuildFromInterface = false ,
246
- bool disableInterfaceFileLock = false );
240
+ ClangModuleLoader *clangImporter,
241
+ bool buildModuleCacheDirIfAbsent,
242
+ StringRef moduleCachePath,
243
+ StringRef prebuiltCachePath,
244
+ bool serializeDependencyHashes,
245
+ bool trackSystemDependencies,
246
+ bool remarkOnRebuildFromInterface,
247
+ bool disableInterfaceFileLock);
247
248
bool runInSubContext (StringRef moduleName,
248
249
StringRef interfacePath,
249
250
StringRef outputPath,
250
251
SourceLoc diagLoc,
251
- llvm::function_ref<bool (ASTContext&)> action) override ;
252
+ llvm::function_ref<bool (ASTContext&, ArrayRef<StringRef>, StringRef )> action) override ;
252
253
bool runInSubCompilerInstance (StringRef moduleName,
253
254
StringRef interfacePath,
254
255
StringRef outputPath,
255
256
SourceLoc diagLoc,
256
- llvm::function_ref<bool (SubCompilerInstanceInfo&)> action) override ;
257
+ llvm::function_ref<bool (SubCompilerInstanceInfo&)> action) override ;
257
258
258
259
~InterfaceSubContextDelegateImpl () = default ;
259
260
260
261
// / includes a hash of relevant key data.
261
- void computeCachedOutputPath (StringRef moduleName,
262
- StringRef UseInterfacePath,
263
- llvm::SmallString<256 > &OutPath);
262
+ StringRef computeCachedOutputPath (StringRef moduleName,
263
+ StringRef UseInterfacePath,
264
+ llvm::SmallString<256 > &OutPath,
265
+ StringRef &CacheHash);
264
266
std::string getCacheHash (StringRef useInterfacePath);
265
267
};
266
268
}
0 commit comments