aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CGDebugInfo.cpp
diff options
context:
space:
mode:
authorJeremy Morse <jeremy.morse@sony.com>2025-07-14 20:48:41 +0100
committerGitHub <noreply@github.com>2025-07-14 20:48:41 +0100
commit641ff6db383d0730ae2587c86aa59b6b3cf8341d (patch)
treef5424132cac221276e3234245b4c9634a64f8778 /clang/lib/CodeGen/CGDebugInfo.cpp
parentdb15c23a5734da141bf4d8b9fc16d193502a7f92 (diff)
downloadllvm-641ff6db383d0730ae2587c86aa59b6b3cf8341d.zip
llvm-641ff6db383d0730ae2587c86aa59b6b3cf8341d.tar.gz
llvm-641ff6db383d0730ae2587c86aa59b6b3cf8341d.tar.bz2
[DebugInfo] Add option for producing no source-file hash (#148657)
Clang can chose which sort of source-file hash is attached to a DIFile metadata node. However, whenever hashing is possible, we /always/ attach a hash. This patch permits users who want DWARF5 but don't want the file hashes to opt out, by adding a "none" option to the -gsrc-hash option that skips hash computation.
Diffstat (limited to 'clang/lib/CodeGen/CGDebugInfo.cpp')
-rw-r--r--clang/lib/CodeGen/CGDebugInfo.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp
index 5240853..f97c7b6 100644
--- a/clang/lib/CodeGen/CGDebugInfo.cpp
+++ b/clang/lib/CodeGen/CGDebugInfo.cpp
@@ -514,6 +514,8 @@ CGDebugInfo::computeChecksum(FileID FID, SmallString<64> &Checksum) const {
case clang::CodeGenOptions::DSH_SHA256:
llvm::toHex(llvm::SHA256::hash(Data), /*LowerCase=*/true, Checksum);
return llvm::DIFile::CSK_SHA256;
+ case clang::CodeGenOptions::DSH_NONE:
+ return std::nullopt;
}
llvm_unreachable("Unhandled DebugSrcHashKind enum");
}