Skip to content

Commit 61e7f5b

Browse files
devajithvsRoot Persona
authored andcommitted
Ensure HeaderFileInfo exists during incremental parsing
When registering incremental inputs as virtual files, we need to ensure that the `HeaderSearch` is aware of the `FileEntry`. This prevents assertions in `HeaderSearch::LookupFile` where it expects file info to exist. This will help revert one of our LLVM patches that was added when upgrading to LLVM20.
1 parent c3c36b1 commit 61e7f5b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/Interpreter/IncrementalParser.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -898,6 +898,11 @@ namespace cling {
898898
SM.getFileManager().getVirtualFileRef(source_name.str(), InputSize,
899899
0 /* mod time*/);
900900
SM.overrideFileContents(FE, std::move(MB));
901+
902+
// Ensure HeaderFileInfo exists before lookup to prevent assertion
903+
HeaderSearch& HS = PP.getHeaderSearchInfo();
904+
HS.getFileInfo(FE);
905+
901906
FID = SM.createFileID(FE, NewLoc, SrcMgr::C_User);
902907

903908
// NewLoc only used for diags.

0 commit comments

Comments
 (0)