Skip to content

Commit ab986c7

Browse files
committed
[clang] Cleanup IncludeLocMap
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.
1 parent ae58cc0 commit ab986c7

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

clang/lib/Basic/SourceManager.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,7 @@ void SourceManager::clearIDTables() {
350350
LastLineNoContentCache = nullptr;
351351
LastFileIDLookup = FileID();
352352

353+
IncludedLocMap.clear();
353354
if (LineTable)
354355
LineTable->clear();
355356

0 commit comments

Comments
 (0)