summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
diff options
context:
space:
mode:
authorPaul Robinson <paul.robinson@sony.com>2018-05-25 22:35:59 +0000
committerPaul Robinson <paul.robinson@sony.com>2018-05-25 22:35:59 +0000
commit76178632a2029b6e4d6d543d3321d953ea86ece5 (patch)
tree9f177114a2b097bd7629e16c21bc03f665a9b190 /clang/lib/CodeGen
parent91bdddc30021d23d78e27ad02f88e5847e7c8362 (diff)
downloadbcm5719-llvm-76178632a2029b6e4d6d543d3321d953ea86ece5.tar.gz
bcm5719-llvm-76178632a2029b6e4d6d543d3321d953ea86ece5.zip
Revert "[DebugInfo] Don't bother with MD5 checksums of preprocessed files."
This reverts commit d734f2aa3f76fbf355ecd2bbe081d0c1f49867ab. Also known as r333311. A very small but nonzero number of bots fail. llvm-svn: 333319
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r--clang/lib/CodeGen/CGDebugInfo.cpp16
-rw-r--r--clang/lib/CodeGen/CGDebugInfo.h1
2 files changed, 4 insertions, 13 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp
index 8cf37f48a27..9e99a646b0b 100644
--- a/clang/lib/CodeGen/CGDebugInfo.cpp
+++ b/clang/lib/CodeGen/CGDebugInfo.cpp
@@ -67,8 +67,6 @@ CGDebugInfo::CGDebugInfo(CodeGenModule &CGM)
DBuilder(CGM.getModule()) {
for (const auto &KV : CGM.getCodeGenOpts().DebugPrefixMap)
DebugPrefixMap[KV.first] = KV.second;
- EmitFileChecksums = CGM.getCodeGenOpts().EmitCodeView ||
- CGM.getCodeGenOpts().DwarfVersion >= 5;
CreateCompileUnit();
}
@@ -367,21 +365,15 @@ Optional<llvm::DIFile::ChecksumKind>
CGDebugInfo::computeChecksum(FileID FID, SmallString<32> &Checksum) const {
Checksum.clear();
- if (!EmitFileChecksums)
+ if (!CGM.getCodeGenOpts().EmitCodeView &&
+ CGM.getCodeGenOpts().DwarfVersion < 5)
return None;
SourceManager &SM = CGM.getContext().getSourceManager();
bool Invalid;
- const SrcMgr::SLocEntry &Entry = SM.getSLocEntry(FID, &Invalid);
- if (Invalid || !Entry.isFile())
+ llvm::MemoryBuffer *MemBuffer = SM.getBuffer(FID, &Invalid);
+ if (Invalid)
return None;
- if (Entry.getFile().hasLineDirectives()) {
- // This must be a preprocessed file; its content won't match the original
- // source; therefore checksumming the text we have is pointless or wrong.
- EmitFileChecksums = false;
- return None;
- }
- llvm::MemoryBuffer *MemBuffer = SM.getBuffer(FID);
llvm::MD5 Hash;
llvm::MD5::MD5Result Result;
diff --git a/clang/lib/CodeGen/CGDebugInfo.h b/clang/lib/CodeGen/CGDebugInfo.h
index ec7b046c8f3..a692babef53 100644
--- a/clang/lib/CodeGen/CGDebugInfo.h
+++ b/clang/lib/CodeGen/CGDebugInfo.h
@@ -57,7 +57,6 @@ class CGDebugInfo {
CodeGenModule &CGM;
const codegenoptions::DebugInfoKind DebugKind;
bool DebugTypeExtRefs;
- mutable bool EmitFileChecksums;
llvm::DIBuilder DBuilder;
llvm::DICompileUnit *TheCU = nullptr;
ModuleMap *ClangModuleMap = nullptr;
OpenPOWER on IntegriCloud