diff options
Diffstat (limited to 'clang/lib/CodeGen/CGDebugInfo.cpp')
| -rw-r--r-- | clang/lib/CodeGen/CGDebugInfo.cpp | 6 |
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); |

