@@ -303,6 +303,10 @@ void CompilerInstance::createVirtualFileSystem(
303303 DiagnosticsEngine Diags (DiagnosticIDs::create (), DiagOpts, DC,
304304 /* ShouldOwnClient=*/ false );
305305
306+ std::tie (CAS, ActionCache) =
307+ getInvocation ().getCASOpts ().getOrCreateDatabases (
308+ Diags, /* CreateEmptyCASOnFailure=*/ false );
309+
306310 VFS = createVFSFromCompilerInvocation (getInvocation (), Diags,
307311 std::move (BaseFS), CAS);
308312 // FIXME: Should this go into createVFSFromCompilerInvocation?
@@ -974,7 +978,7 @@ llvm::vfs::OutputBackend &CompilerInstance::getOrCreateOutputBackend() {
974978
975979std::pair<std::shared_ptr<llvm::cas::ObjectStore>,
976980 std::shared_ptr<llvm::cas::ActionCache>>
977- CompilerInstance::createCASDatabases () {
981+ CompilerInstance::getOrCreateCASDatabases () {
978982 // Create a new CAS databases from the CompilerInvocation. Future calls to
979983 // createFileManager() will use the same CAS.
980984 std::tie (CAS, ActionCache) =
@@ -986,13 +990,13 @@ CompilerInstance::createCASDatabases() {
986990
987991llvm::cas::ObjectStore &CompilerInstance::getOrCreateObjectStore () {
988992 if (!CAS)
989- createCASDatabases ();
993+ getOrCreateCASDatabases ();
990994 return *CAS;
991995}
992996
993997llvm::cas::ActionCache &CompilerInstance::getOrCreateActionCache () {
994998 if (!ActionCache)
995- createCASDatabases ();
999+ getOrCreateCASDatabases ();
9961000 return *ActionCache;
9971001}
9981002
0 commit comments