[clang] [clang-scan-deps] Fix check for empty `Compilation` (PR #75545)
via cfe-commits
cfe-commits at lists.llvm.org
Thu Dec 14 15:59:58 PST 2023
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-clang
Author: Yaraslau (Yaraslaut)
<details>
<summary>Changes</summary>
Closes https://github.com/llvm/llvm-project/issues/64144
Instead of checking for `nullptr` we need to ensure that `JobList` is not empty to proceed
---
Full diff: https://github.com/llvm/llvm-project/pull/75545.diff
1 Files Affected:
- (modified) clang/tools/clang-scan-deps/ClangScanDeps.cpp (+1-1)
``````````diff
diff --git a/clang/tools/clang-scan-deps/ClangScanDeps.cpp b/clang/tools/clang-scan-deps/ClangScanDeps.cpp
index 75aa4ae97c618c..7253856f1a07b4 100644
--- a/clang/tools/clang-scan-deps/ClangScanDeps.cpp
+++ b/clang/tools/clang-scan-deps/ClangScanDeps.cpp
@@ -728,7 +728,7 @@ getCompilationDataBase(int argc, char **argv, std::string &ErrorMessage) {
*Diags);
std::unique_ptr<driver::Compilation> C(
TheDriver.BuildCompilation(CommandLine));
- if (!C)
+ if (C->getJobs().empty())
return nullptr;
auto Cmd = C->getJobs().begin();
``````````
</details>
https://github.com/llvm/llvm-project/pull/75545
More information about the cfe-commits
mailing list