diff options
author | Arlo Siemsen <arsiem@microsoft.com> | 2020-03-12 16:25:01 -0700 |
---|---|---|
committer | Reid Kleckner <rnk@google.com> | 2020-03-12 16:32:05 -0700 |
commit | 1478ed69d3dfc177a77e799af13075dd4474bcd0 (patch) | |
tree | 8b94fc4e13985a8259f6e853fddb50941ddd83b8 /llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp | |
parent | 03f5f6bebd48ee2131fb15d10eb1cea9fe38724f (diff) | |
download | llvm-1478ed69d3dfc177a77e799af13075dd4474bcd0.zip llvm-1478ed69d3dfc177a77e799af13075dd4474bcd0.tar.gz llvm-1478ed69d3dfc177a77e799af13075dd4474bcd0.tar.bz2 |
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/CodeGen/AsmPrinter/CodeViewDebug.cpp')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp index 6dc6fde..814273c 100644 --- a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp @@ -250,8 +250,15 @@ unsigned CodeViewDebug::maybeRecordFile(const DIFile *F) { ChecksumAsBytes = ArrayRef<uint8_t>( reinterpret_cast<const uint8_t *>(CKMem), Checksum.size()); switch (F->getChecksum()->Kind) { - case DIFile::CSK_MD5: CSKind = FileChecksumKind::MD5; break; - case DIFile::CSK_SHA1: CSKind = FileChecksumKind::SHA1; break; + case DIFile::CSK_MD5: + CSKind = FileChecksumKind::MD5; + break; + case DIFile::CSK_SHA1: + CSKind = FileChecksumKind::SHA1; + break; + case DIFile::CSK_SHA256: + CSKind = FileChecksumKind::SHA256; + break; } } bool Success = OS.EmitCVFileDirective(NextId, FullPath, ChecksumAsBytes, |