@@ -293,6 +293,10 @@ void CompilerInstance::createVirtualFileSystem(
293293  DiagnosticsEngine Diags (new  DiagnosticIDs, DiagOpts, DC,
294294                          /* ShouldOwnClient=*/ false );
295295
296+   std::tie (CAS, ActionCache) =
297+       getInvocation ().getCASOpts ().getOrCreateDatabases (
298+           Diags, /* CreateEmptyCASOnFailure=*/ false );
299+ 
296300  VFS = createVFSFromCompilerInvocation (getInvocation (), Diags,
297301                                        std::move (BaseFS), CAS);
298302  //  FIXME: Should this go into createVFSFromCompilerInvocation?
@@ -964,7 +968,7 @@ llvm::vfs::OutputBackend &CompilerInstance::getOrCreateOutputBackend() {
964968
965969std::pair<std::shared_ptr<llvm::cas::ObjectStore>,
966970          std::shared_ptr<llvm::cas::ActionCache>>
967- CompilerInstance::createCASDatabases  () {
971+ CompilerInstance::getOrCreateCASDatabases  () {
968972  //  Create a new CAS databases from the CompilerInvocation. Future calls to
969973  //  createFileManager() will use the same CAS.
970974  std::tie (CAS, ActionCache) =
@@ -976,13 +980,13 @@ CompilerInstance::createCASDatabases() {
976980
977981llvm::cas::ObjectStore &CompilerInstance::getOrCreateObjectStore () {
978982  if  (!CAS)
979-     createCASDatabases ();
983+     getOrCreateCASDatabases ();
980984  return  *CAS;
981985}
982986
983987llvm::cas::ActionCache &CompilerInstance::getOrCreateActionCache () {
984988  if  (!ActionCache)
985-     createCASDatabases ();
989+     getOrCreateCASDatabases ();
986990  return  *ActionCache;
987991}
988992
0 commit comments