diff options
author | Alexandre Ganea <alexandre.ganea@ubisoft.com> | 2019-05-21 19:40:28 +0000 |
---|---|---|
committer | Alexandre Ganea <alexandre.ganea@ubisoft.com> | 2019-05-21 19:40:28 +0000 |
commit | 047e65db77571bb586429a8094b3dfa43cecd449 (patch) | |
tree | f82cd9abcbd0023fe8625bd40a16ed05378ef404 /clang/lib/Basic/SourceManager.cpp | |
parent | b07176666b8ec276902d207f8ee0f832323a2128 (diff) | |
download | bcm5719-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/Basic/SourceManager.cpp')
-rw-r--r-- | clang/lib/Basic/SourceManager.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/clang/lib/Basic/SourceManager.cpp b/clang/lib/Basic/SourceManager.cpp index 712cbb0d0ea..e62cef7ec55 100644 --- a/clang/lib/Basic/SourceManager.cpp +++ b/clang/lib/Basic/SourceManager.cpp @@ -1430,6 +1430,7 @@ PresumedLoc SourceManager::getPresumedLoc(SourceLocation Loc, // To get the source name, first consult the FileEntry (if one exists) // before the MemBuffer as this will avoid unnecessarily paging in the // MemBuffer. + FileID FID = LocInfo.first; StringRef Filename; if (C->OrigEntry) Filename = C->OrigEntry->getName(); @@ -1453,8 +1454,12 @@ PresumedLoc SourceManager::getPresumedLoc(SourceLocation Loc, if (const LineEntry *Entry = LineTable->FindNearestLineEntry(LocInfo.first, LocInfo.second)) { // If the LineEntry indicates a filename, use it. - if (Entry->FilenameID != -1) + if (Entry->FilenameID != -1) { Filename = LineTable->getFilename(Entry->FilenameID); + // The contents of files referenced by #line are not in the + // SourceManager + FID = FileID::get(0); + } // Use the line number specified by the LineEntry. This line number may // be multiple lines down from the line entry. Add the difference in @@ -1473,7 +1478,7 @@ PresumedLoc SourceManager::getPresumedLoc(SourceLocation Loc, } } - return PresumedLoc(Filename.data(), LineNo, ColNo, IncludeLoc); + return PresumedLoc(Filename.data(), FID, LineNo, ColNo, IncludeLoc); } /// Returns whether the PresumedLoc for a given SourceLocation is |