aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Basic/SourceManager.cpp
diff options
context:
space:
mode:
authorkadir çetinkaya <kadircet@google.com>2024-08-30 11:57:37 +0200
committerGitHub <noreply@github.com>2024-08-30 11:57:37 +0200
commita2a93f02930e20930d5ef38464ca9c99eb00ff23 (patch)
treeb54e4c4e60867b9b089def3f0180e862c443efea /clang/lib/Basic/SourceManager.cpp
parent1b32c3e2985f89900030289eaa44e3d92cab85af (diff)
downloadllvm-a2a93f02930e20930d5ef38464ca9c99eb00ff23.zip
llvm-a2a93f02930e20930d5ef38464ca9c99eb00ff23.tar.gz
llvm-a2a93f02930e20930d5ef38464ca9c99eb00ff23.tar.bz2
[clang] Cleanup IncludeLocMap (#106241)
CompilerInstance can re-use same SourceManager across multiple frontendactions. During this process it calls `SourceManager::clearIDTables` to reset any caches based on FileIDs. It didn't reset IncludeLocMap, resulting in wrong include locations for workflows that triggered multiple frontend-actions through same CompilerInstance.
Diffstat (limited to 'clang/lib/Basic/SourceManager.cpp')
-rw-r--r--clang/lib/Basic/SourceManager.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/clang/lib/Basic/SourceManager.cpp b/clang/lib/Basic/SourceManager.cpp
index b0256a8c..d6ec26a 100644
--- a/clang/lib/Basic/SourceManager.cpp
+++ b/clang/lib/Basic/SourceManager.cpp
@@ -350,6 +350,7 @@ void SourceManager::clearIDTables() {
LastLineNoContentCache = nullptr;
LastFileIDLookup = FileID();
+ IncludedLocMap.clear();
if (LineTable)
LineTable->clear();