aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Lex/ModuleMap.cpp
diff options
context:
space:
mode:
authorJan Svoboda <jan_svoboda@apple.com>2023-05-25 14:13:15 -0700
committerJan Svoboda <jan_svoboda@apple.com>2023-05-30 13:54:06 -0700
commitd574e918dba31e670a87c46e7de281819b3c0ea9 (patch)
treea63da309187e6ab77370df8a0420ebc5d2a88e82 /clang/lib/Lex/ModuleMap.cpp
parent95279d7670cd54a50cf72d1fbc99701ef1faa72b (diff)
downloadllvm-d574e918dba31e670a87c46e7de281819b3c0ea9.zip
llvm-d574e918dba31e670a87c46e7de281819b3c0ea9.tar.gz
llvm-d574e918dba31e670a87c46e7de281819b3c0ea9.tar.bz2
[clang][lex] NFCI: Use DirectoryEntryRef in ModuleMap::parseModuleMapFile()
This patch changes the argument type of `ModuleMap::parseModuleMapFile()` from `const DirectoryEntry *` to `DirectoryEntryRef` in order to remove the deprecated uses of `DirectoryEntry::getName()`. Depends on D127648. Reviewed By: bnbarham Differential Revision: https://reviews.llvm.org/D127651
Diffstat (limited to 'clang/lib/Lex/ModuleMap.cpp')
-rw-r--r--clang/lib/Lex/ModuleMap.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/clang/lib/Lex/ModuleMap.cpp b/clang/lib/Lex/ModuleMap.cpp
index efe2df0..833287c 100644
--- a/clang/lib/Lex/ModuleMap.cpp
+++ b/clang/lib/Lex/ModuleMap.cpp
@@ -1518,7 +1518,7 @@ namespace clang {
/// The directory that file names in this module map file should
/// be resolved relative to.
- const DirectoryEntry *Directory;
+ DirectoryEntryRef Directory;
/// Whether this module map is in a system header directory.
bool IsSystem;
@@ -1584,7 +1584,7 @@ namespace clang {
explicit ModuleMapParser(Lexer &L, SourceManager &SourceMgr,
const TargetInfo *Target, DiagnosticsEngine &Diags,
ModuleMap &Map, const FileEntry *ModuleMapFile,
- const DirectoryEntry *Directory, bool IsSystem)
+ DirectoryEntryRef Directory, bool IsSystem)
: L(L), SourceMgr(SourceMgr), Target(Target), Diags(Diags), Map(Map),
ModuleMapFile(ModuleMapFile), Directory(Directory),
IsSystem(IsSystem) {
@@ -2254,16 +2254,16 @@ void ModuleMapParser::parseExternModuleDecl() {
StringRef FileNameRef = FileName;
SmallString<128> ModuleMapFileName;
if (llvm::sys::path::is_relative(FileNameRef)) {
- ModuleMapFileName += Directory->getName();
+ ModuleMapFileName += Directory.getName();
llvm::sys::path::append(ModuleMapFileName, FileName);
FileNameRef = ModuleMapFileName;
}
- if (auto File = SourceMgr.getFileManager().getFile(FileNameRef))
+ if (auto File = SourceMgr.getFileManager().getOptionalFileRef(FileNameRef))
Map.parseModuleMapFile(
*File, IsSystem,
Map.HeaderInfo.getHeaderSearchOpts().ModuleMapFileHomeIsCwd
? Directory
- : (*File)->getDir(),
+ : File->getDir(),
FileID(), nullptr, ExternLoc);
}
@@ -2518,7 +2518,7 @@ void ModuleMapParser::parseUmbrellaDirDecl(SourceLocation UmbrellaLoc) {
Dir = SourceMgr.getFileManager().getOptionalDirectoryRef(DirName);
} else {
SmallString<128> PathName;
- PathName = Directory->getName();
+ PathName = Directory.getName();
llvm::sys::path::append(PathName, DirName);
Dir = SourceMgr.getFileManager().getOptionalDirectoryRef(PathName);
}
@@ -3080,7 +3080,7 @@ bool ModuleMapParser::parseModuleMapFile() {
}
bool ModuleMap::parseModuleMapFile(const FileEntry *File, bool IsSystem,
- const DirectoryEntry *Dir, FileID ID,
+ DirectoryEntryRef Dir, FileID ID,
unsigned *Offset,
SourceLocation ExternModuleLoc) {
assert(Target && "Missing target information");