summaryrefslogtreecommitdiff
path: root/llvm/lib/IR/DebugInfoMetadata.cpp
diff options
context:
space:
mode:
authorArlo Siemsen <arsiem@microsoft.com>2020-03-12 16:25:01 -0700
committerReid Kleckner <rnk@google.com>2020-03-12 16:32:05 -0700
commit1478ed69d3dfc177a77e799af13075dd4474bcd0 (patch)
tree8b94fc4e13985a8259f6e853fddb50941ddd83b8 /llvm/lib/IR/DebugInfoMetadata.cpp
parent03f5f6bebd48ee2131fb15d10eb1cea9fe38724f (diff)
Add support for SHA256 source file checksums in debug info
LLVM currently supports CSK_MD5 and CSK_SHA1 source file checksums in debug info. This change adds support for CSK_SHA256 checksums. The SHA256 checksums are supported by the CodeView debug format. Reviewed By: aprantl Differential Revision: https://reviews.llvm.org/D75785
Diffstat (limited to 'llvm/lib/IR/DebugInfoMetadata.cpp')
-rw-r--r--llvm/lib/IR/DebugInfoMetadata.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/IR/DebugInfoMetadata.cpp b/llvm/lib/IR/DebugInfoMetadata.cpp
index 0c0ea50dde70..289d4159683b 100644
--- a/llvm/lib/IR/DebugInfoMetadata.cpp
+++ b/llvm/lib/IR/DebugInfoMetadata.cpp
@@ -479,8 +479,9 @@ DISubroutineType *DISubroutineType::getImpl(LLVMContext &Context, DIFlags Flags,
// FIXME: Implement this string-enum correspondence with a .def file and macros,
// so that the association is explicit rather than implied.
static const char *ChecksumKindName[DIFile::CSK_Last] = {
- "CSK_MD5",
- "CSK_SHA1"
+ "CSK_MD5",
+ "CSK_SHA1",
+ "CSK_SHA256",
};
StringRef DIFile::getChecksumKindAsString(ChecksumKind CSKind) {
@@ -495,6 +496,7 @@ Optional<DIFile::ChecksumKind> DIFile::getChecksumKind(StringRef CSKindStr) {
return StringSwitch<Optional<DIFile::ChecksumKind>>(CSKindStr)
.Case("CSK_MD5", DIFile::CSK_MD5)
.Case("CSK_SHA1", DIFile::CSK_SHA1)
+ .Case("CSK_SHA256", DIFile::CSK_SHA256)
.Default(None);
}