summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
diff options
context:
space:
mode:
authorAlexandre Ganea <alexandre.ganea@ubisoft.com>2019-05-21 19:40:28 +0000
committerAlexandre Ganea <alexandre.ganea@ubisoft.com>2019-05-21 19:40:28 +0000
commit047e65db77571bb586429a8094b3dfa43cecd449 (patch)
treef82cd9abcbd0023fe8625bd40a16ed05378ef404 /clang/lib/CodeGen
parentb07176666b8ec276902d207f8ee0f832323a2128 (diff)
downloadbcm5719-llvm-047e65db77571bb586429a8094b3dfa43cecd449.tar.gz
bcm5719-llvm-047e65db77571bb586429a8094b3dfa43cecd449.zip
[DebugInfo] Don't emit checksums when compiling a preprocessed CPP
Fixes PR41215 Differential Revision: https://reviews.llvm.org/D60283 llvm-svn: 361296
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r--clang/lib/CodeGen/CGDebugInfo.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp
index 4c43c00cd5e..f436cab16c4 100644
--- a/clang/lib/CodeGen/CGDebugInfo.cpp
+++ b/clang/lib/CodeGen/CGDebugInfo.cpp
@@ -422,8 +422,12 @@ llvm::DIFile *CGDebugInfo::getOrCreateFile(SourceLocation Loc) {
}
SmallString<32> Checksum;
+
+ // Compute the checksum if possible. If the location is affected by a #line
+ // directive that refers to a file, PLoc will have an invalid FileID, and we
+ // will correctly get no checksum.
Optional<llvm::DIFile::ChecksumKind> CSKind =
- computeChecksum(SM.getFileID(Loc), Checksum);
+ computeChecksum(PLoc.getFileID(), Checksum);
Optional<llvm::DIFile::ChecksumInfo<StringRef>> CSInfo;
if (CSKind)
CSInfo.emplace(*CSKind, Checksum);
OpenPOWER on IntegriCloud