mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Revert "[Caching][NFC] Using llvm::cas::CASConfiguration"
This reverts commit 4f059033bb. The change
is actually not NFC since previously, there is a cache in the
CompilerInvocation that prevents the same CAS from the same CASOptions
from being initialized multiple times, which was relied upon when
running inside sub invocation. When switching to a non-caching simple
CASOption types, it causes every single sub instance will create its own
CAS, and it can consume too many file descriptors and causing errors
during dependency scanning.
rdar://164903080
This commit is contained in:
@@ -477,12 +477,12 @@ bool CompilerInstance::setupCASIfNeeded(ArrayRef<const char *> Args) {
|
||||
return false;
|
||||
|
||||
const auto &Opts = getInvocation().getCASOptions();
|
||||
if (Opts.Config.CASPath.empty() && Opts.Config.PluginPath.empty()) {
|
||||
if (Opts.CASOpts.CASPath.empty() && Opts.CASOpts.PluginPath.empty()) {
|
||||
Diagnostics.diagnose(SourceLoc(), diag::error_cas_initialization,
|
||||
"no CAS options provided");
|
||||
return true;
|
||||
}
|
||||
auto MaybeDB = Opts.Config.createDatabases();
|
||||
auto MaybeDB = Opts.CASOpts.getOrCreateDatabases();
|
||||
if (!MaybeDB) {
|
||||
Diagnostics.diagnose(SourceLoc(), diag::error_cas_initialization,
|
||||
toString(MaybeDB.takeError()));
|
||||
|
||||
Reference in New Issue
Block a user