This patch changes the return/argument types of ModuleMap::{load,lookup}ModuleMap() from const FileEntry * to FileEntryRef in order to remove uses of the deprecated DirectoryEntry::getName().
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Few small comments, LGTM otherwise.
clang/include/clang/Lex/HeaderSearch.h | ||
---|---|---|
639–640 | ||
clang/lib/Frontend/FrontendAction.cpp | ||
450–451 | The empty case isn't checked as far as I can tell. The null case wasn't either, but seems like we should just return true? | |
clang/lib/Lex/HeaderSearch.cpp | ||
1757 | Nitpick: could just return F directly in the 3 ifs here. |
clang/lib/Frontend/FrontendAction.cpp | ||
---|---|---|
450–451 | Good point. I think the entry for MainFileID always exists, so I'll add an assert here. |
The failure here is likely due to the hack in FileManager::getFileRef:
// FIXME: This hack ensures that `getDir()` will use the path that was // used to lookup this file, even if we found a file by different path // first. This is required in order to find a module's structure when its // headers/module map are mapped in the VFS.
So the directory returned from the FileEntry is the *lookup* directory, but the FileEntryRef will be giving back the directory from the external path (if it has been remapped).