about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm
diff options
context:
space:
mode:
authorArlo Siemsen <arsiem@microsoft.com>2020-10-13 08:41:06 -0700
committerArlo Siemsen <arsiem@microsoft.com>2020-10-14 15:09:51 -0700
commit3296d5ca7b41154359eaec76d9f77310816c9913 (patch)
tree705c0b0854d1a9526e74b5c6c3bf566be3719677 /compiler/rustc_codegen_llvm
parent5565241f65cf402c3dbcb55dd492f172c473d4ce (diff)
downloadrust-3296d5ca7b41154359eaec76d9f77310816c9913.tar.gz
rust-3296d5ca7b41154359eaec76d9f77310816c9913.zip
Add support for SHA256 source file hashing for LLVM 11+.
Diffstat (limited to 'compiler/rustc_codegen_llvm')
-rw-r--r--compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs1
-rw-r--r--compiler/rustc_codegen_llvm/src/llvm/ffi.rs1
2 files changed, 2 insertions, 0 deletions
diff --git a/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs b/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs
index 987149cb4c2..caf941f8c45 100644
--- a/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs
+++ b/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs
@@ -805,6 +805,7 @@ fn file_metadata_raw(
                     let kind = match hash.kind {
                         rustc_span::SourceFileHashAlgorithm::Md5 => llvm::ChecksumKind::MD5,
                         rustc_span::SourceFileHashAlgorithm::Sha1 => llvm::ChecksumKind::SHA1,
+                        rustc_span::SourceFileHashAlgorithm::Sha256 => llvm::ChecksumKind::SHA256,
                     };
                     (kind, hex_encode(hash.hash_bytes()))
                 }
diff --git a/compiler/rustc_codegen_llvm/src/llvm/ffi.rs b/compiler/rustc_codegen_llvm/src/llvm/ffi.rs
index 4c1fee0106a..d3663ced24b 100644
--- a/compiler/rustc_codegen_llvm/src/llvm/ffi.rs
+++ b/compiler/rustc_codegen_llvm/src/llvm/ffi.rs
@@ -557,6 +557,7 @@ pub enum ChecksumKind {
     None,
     MD5,
     SHA1,
+    SHA256,
 }
 
 extern "C" {