Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -245,8 +245,17 @@ DependencyScanningWorker::computeDependenciesByNameWithContextOrError(

llvm::Error
DependencyScanningWorker::finalizeCompilerInstanceWithContextOrError() {
bool Success = finalizeCompilerInstance();
return CIWithContext->handleReturnStatus(Success);
// TODO: this finalization interface is not ideal. Finalizing the
// CIWithContext should happen automatically for successful scans, and
// when errors occur.
if (CIWithContext) {
bool Success = finalizeCompilerInstance();
return CIWithContext->handleReturnStatus(Success);
}

// There is nothing to finalize, so the finalization should not report an
// error.
return llvm::Error::success();
}

bool DependencyScanningWorker::initializeCompilerInstanceWithContext(
Expand All @@ -265,5 +274,6 @@ bool DependencyScanningWorker::computeDependenciesByNameWithContext(
}

bool DependencyScanningWorker::finalizeCompilerInstance() {
assert(CIWithContext && "Should not finalize without a CIWithContext");
return CIWithContext->finalize();
}