From baf72beaf06fc78895fcbcfc1143053bb467dd1d Mon Sep 17 00:00:00 2001 From: Paul Robinson Date: Fri, 12 Jan 2018 22:19:03 +0000 Subject: [PATCH] [DWARFv5] Have -gdwarf-5 generate MD5 checksums Differential Revision: https://reviews.llvm.org/D42011 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@322413 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CGDebugInfo.cpp | 3 ++- test/CodeGen/debug-info-file-checksum.c | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp index cb15c76122..d29e0791fb 100644 --- a/lib/CodeGen/CGDebugInfo.cpp +++ b/lib/CodeGen/CGDebugInfo.cpp @@ -365,7 +365,8 @@ llvm::DIFile::ChecksumKind CGDebugInfo::computeChecksum(FileID FID, SmallString<32> &Checksum) const { Checksum.clear(); - if (!CGM.getCodeGenOpts().EmitCodeView) + if (!CGM.getCodeGenOpts().EmitCodeView && + CGM.getCodeGenOpts().DwarfVersion < 5) return llvm::DIFile::CSK_None; SourceManager &SM = CGM.getContext().getSourceManager(); diff --git a/test/CodeGen/debug-info-file-checksum.c b/test/CodeGen/debug-info-file-checksum.c index 2750800d41..d644aac061 100644 --- a/test/CodeGen/debug-info-file-checksum.c +++ b/test/CodeGen/debug-info-file-checksum.c @@ -1,4 +1,5 @@ // RUN: %clang -emit-llvm -S -g -gcodeview -x c %S/Inputs/debug-info-file-checksum.c -o - | FileCheck %s +// RUN: %clang -emit-llvm -S -gdwarf-5 -x c %S/Inputs/debug-info-file-checksum.c -o - | FileCheck %s // Check that "checksum" is created correctly for the compiled file. -- 2.50.1