Skip to content

Commit 06cbfee

Browse files
committed
createCASDatabases -> getOrCreateCASDatabases
1 parent 59ca873 commit 06cbfee

File tree

3 files changed

+5
-12
lines changed

3 files changed

+5
-12
lines changed

clang/include/clang/Frontend/CompilerInstance.h

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -530,12 +530,6 @@ class CompilerInstance : public ModuleLoader {
530530
/// Get the CAS, or create it using the configuration in CompilerInvocation.
531531
llvm::cas::ObjectStore &getOrCreateObjectStore();
532532
llvm::cas::ActionCache &getOrCreateActionCache();
533-
std::shared_ptr<llvm::cas::ObjectStore> getObjectStorePtr() const {
534-
return CAS;
535-
}
536-
std::shared_ptr<llvm::cas::ActionCache> getActionCachePtr() const {
537-
return ActionCache;
538-
}
539533

540534
/// @}
541535
/// @name Source Manager
@@ -1046,7 +1040,7 @@ class CompilerInstance : public ModuleLoader {
10461040

10471041
std::pair<std::shared_ptr<llvm::cas::ObjectStore>,
10481042
std::shared_ptr<llvm::cas::ActionCache>>
1049-
createCASDatabases();
1043+
getOrCreateCASDatabases();
10501044
};
10511045

10521046
} // end namespace clang

clang/lib/Frontend/CompileJobCache.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,8 +296,7 @@ std::optional<int> CompileJobCache::initialize(CompilerInstance &Clang) {
296296
if (!CacheCompileJob)
297297
return std::nullopt;
298298

299-
CAS = Clang.getObjectStorePtr();
300-
Cache = Clang.getActionCachePtr();
299+
std::tie(CAS, Cache) = Clang.getOrCreateCASDatabases();
301300
if (!CAS || !Cache)
302301
return 1; // Exit with error!
303302

clang/lib/Frontend/CompilerInstance.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -974,7 +974,7 @@ llvm::vfs::OutputBackend &CompilerInstance::getOrCreateOutputManager() {
974974

975975
std::pair<std::shared_ptr<llvm::cas::ObjectStore>,
976976
std::shared_ptr<llvm::cas::ActionCache>>
977-
CompilerInstance::createCASDatabases() {
977+
CompilerInstance::getOrCreateCASDatabases() {
978978
// Create a new CAS databases from the CompilerInvocation. Future calls to
979979
// createFileManager() will use the same CAS.
980980
std::tie(CAS, ActionCache) =
@@ -986,13 +986,13 @@ CompilerInstance::createCASDatabases() {
986986

987987
llvm::cas::ObjectStore &CompilerInstance::getOrCreateObjectStore() {
988988
if (!CAS)
989-
createCASDatabases();
989+
getOrCreateCASDatabases();
990990
return *CAS;
991991
}
992992

993993
llvm::cas::ActionCache &CompilerInstance::getOrCreateActionCache() {
994994
if (!ActionCache)
995-
createCASDatabases();
995+
getOrCreateCASDatabases();
996996
return *ActionCache;
997997
}
998998

0 commit comments

Comments
 (0)