[clang] Update Clang.cpp (PR #77882)
via cfe-commits
cfe-commits at lists.llvm.org
Thu Jan 11 23:21:02 PST 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-clang
@llvm/pr-subscribers-clang-driver
Author: hw-1 (hw-1)
<details>
<summary>Changes</summary>
fix error: .gch' was ignored because it is not a clang PCH file https://github.com/llvm/llvm-project/issues/76923
---
Full diff: https://github.com/llvm/llvm-project/pull/77882.diff
1 Files Affected:
- (modified) clang/lib/Driver/ToolChains/Clang.cpp (+1-1)
``````````diff
diff --git a/clang/lib/Driver/ToolChains/Clang.cpp b/clang/lib/Driver/ToolChains/Clang.cpp
index 1ee7ae602f3ce5..2c35b9b84ac959 100644
--- a/clang/lib/Driver/ToolChains/Clang.cpp
+++ b/clang/lib/Driver/ToolChains/Clang.cpp
@@ -951,7 +951,7 @@ static void handleAMDGPUCodeObjectVersionOptions(const Driver &D,
static bool hasClangPchSignature(const Driver &D, StringRef Path) {
if (llvm::ErrorOr<std::unique_ptr<llvm::MemoryBuffer>> MemBuf =
D.getVFS().getBufferForFile(Path))
- return (*MemBuf)->getBuffer().starts_with("CPCH");
+ return (*MemBuf)->getBuffer().contains("CPCH");
return false;
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/77882
More information about the cfe-commits
mailing list