This patch changes the argument type to HeaderSearch::LookupFile() from const DirectoryEntry * to DirectoryEntryRef in order to remove some calls to the deprecated DirectoryEntry::getName().
Depends on D127660.
Paths
| Differential D127663
[clang][lex] NFCI: Use DirectoryEntryRef in HeaderSearch::LookupFile ClosedPublic Authored by jansvoboda11 on Jun 13 2022, 8:49 AM.
Details Summary This patch changes the argument type to HeaderSearch::LookupFile() from const DirectoryEntry * to DirectoryEntryRef in order to remove some calls to the deprecated DirectoryEntry::getName(). Depends on D127660.
Diff Detail
Event Timelinebnbarham added inline comments.
This revision is now accepted and ready to land.Jun 13 2022, 11:15 AM Comment Actions Failing test seems to be because . is turned into the full path at some point. It's possible that this is because getFileRef returns the absolute path (see the massive FIXME there). If that's the case we could fix that by fixing clang-apply-replacements and then change the Status.getName() == Filename to only check whether it's an externally mapped path. Comment Actions The failing test was a fun one to debug. It didn't test what it intended to. It wanted to check that header referenced from module map is found via a search path, but the command line was constructed in such way that the header was found relative to the includer. The test relied on the FileManager hackery that mutates FileEntry objects. Now that we call SourceMgr.getFileEntryRefForID(), we don't see effects of this hack. I ended up only fixing the test, since removing the FileManager hack safely probably requires us to remove all remaining {File,Directory}Entry::getName() usages. LMK if you have more feedback.
bnbarham added inline comments.
This revision was landed with ongoing or failed builds.May 30 2023, 9:42 PM Closed by commit rG3473f728b36e: [clang][lex] NFCI: Use DirectoryEntryRef in HeaderSearch::LookupFile (authored by jansvoboda11). · Explain Why This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 526893 clang/include/clang/Lex/HeaderSearch.h
clang/lib/Frontend/FrontendAction.cpp
clang/lib/Lex/HeaderSearch.cpp
clang/lib/Lex/PPDirectives.cpp
clang/test/Modules/filename.cpp
|
Worth adding an assert here? It'd be nice to cleanup the CWD handling in FileManager at some point.