Skip to content

Commit 82819b8

Browse files
committed
Drop isOpen() check in ClangInternalState
Removing this distinction between `ParsedOpen` and `Parsed` will help us get rid of the clang patch: `Accessor to "is file opened"; this is crucial info for us.` This is only used in cling-tests and in `TCling::IsLoaded`, but the latter doesn't care about the distinction between `ParsedOpen` and `Parsed` After running all the clingtests, this codepath was also never taken in any of those tests.
1 parent e9d5c9d commit 82819b8

File tree

3 files changed

+3
-13
lines changed

3 files changed

+3
-13
lines changed

interpreter/cling/lib/Interpreter/ClangInternalState.cpp

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ namespace cling {
256256
const SourceManager& SM) {
257257
// FileInfos are stored as a mapping, and invalidating the cache
258258
// can change iteration order.
259-
std::vector<std::string> ParsedOpen, Parsed, AST;
259+
std::vector<std::string> Parsed, AST;
260260
for (clang::SourceManager::fileinfo_iterator I = SM.fileinfo_begin(),
261261
E = SM.fileinfo_end(); I != E; ++I) {
262262
const clang::FileEntryRef FE = I->first;
@@ -273,15 +273,7 @@ namespace cling {
273273
if (I->second->getBufferDataIfLoaded()) {
274274
// There is content - a memory buffer or a file.
275275
// We know it's a file because we started off the FileEntry.
276-
277-
// FIXME: LLVM will completely migrate to FileEntryRef.
278-
// We added `isOpen()` in our commit:
279-
// `Accessor to "is file opened"; this is crucial info for us.`
280-
// Move this logic to FileEntryRef or have a workaround.
281-
if (FE.getFileEntry().isOpen())
282-
ParsedOpen.emplace_back(std::move(fileName));
283-
else
284-
Parsed.emplace_back(std::move(fileName));
276+
Parsed.emplace_back(std::move(fileName));
285277
} else
286278
AST.emplace_back(std::move(fileName));
287279
}
@@ -294,7 +286,6 @@ namespace cling {
294286
for (auto&& FileName : Files)
295287
Out << " " << FileName << '\n';
296288
};
297-
DumpFiles("Parsed and open", ParsedOpen);
298289
DumpFiles("Parsed", Parsed);
299290
DumpFiles("From AST file", AST);
300291
}

interpreter/llvm-project/clang/include/clang/Basic/FileEntry.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,6 @@ class FileEntry {
327327
~FileEntry();
328328

329329
StringRef tryGetRealPathName() const { return RealPathName; }
330-
bool isOpen() const { return (bool)File; }
331330
off_t getSize() const { return Size; }
332331
// Size may increase due to potential z/OS EBCDIC -> UTF-8 conversion.
333332
void setSize(off_t NewSize) { Size = NewSize; }
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
ROOT-llvm20-20250925-01
1+
ROOT-llvm20-20251201-01

0 commit comments

Comments
 (0)