[clang] Update Clang.cpp (PR #77031)
via cfe-commits
cfe-commits at lists.llvm.org
Thu Jan 4 17:17:20 PST 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-clang
Author: hw-1 (hw-1)
<details>
<summary>Changes</summary>
fix bug with PCH check failed, detail with https://github.com/llvm/llvm-project/issues/76923
---
Full diff: https://github.com/llvm/llvm-project/pull/77031.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 2d8ef841d4f6be..bb8b496dbfe5fc 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().substr(0x500,-1).starts_with("CPCH");
return false;
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/77031
More information about the cfe-commits
mailing list