aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Svoboda <jan_svoboda@apple.com>2022-04-20 19:02:03 +0200
committerJan Svoboda <jan_svoboda@apple.com>2022-04-20 20:27:13 +0200
commit99cfccdcb371cd6769169538098c3c3539cf9498 (patch)
tree6bed10226849841eb1ae054d0a04b3a603b6897f
parent8a9b4fb4aa6d2dde026d9ae08459aa9e7a1edb05 (diff)
downloadllvm-99cfccdcb371cd6769169538098c3c3539cf9498.zip
llvm-99cfccdcb371cd6769169538098c3c3539cf9498.tar.gz
llvm-99cfccdcb371cd6769169538098c3c3539cf9498.tar.bz2
[clang][lex] NFCI: Use FileEntryRef in ModuleMap::diagnoseHeaderInclusion()
This patch removes uses of the deprecated `DirectoryEntry::getName()` from the `ModuleMap::diagnoseHeaderInclusion()` function by using `{File,Directory}EntryRef` instead. Reviewed By: bnbarham Differential Revision: https://reviews.llvm.org/D123856
-rw-r--r--clang/include/clang/Lex/ModuleMap.h2
-rw-r--r--clang/lib/Lex/ModuleMap.cpp5
-rw-r--r--clang/lib/Lex/PPDirectives.cpp6
3 files changed, 6 insertions, 7 deletions
diff --git a/clang/include/clang/Lex/ModuleMap.h b/clang/include/clang/Lex/ModuleMap.h
index 3e14009..20da9eb 100644
--- a/clang/include/clang/Lex/ModuleMap.h
+++ b/clang/include/clang/Lex/ModuleMap.h
@@ -479,7 +479,7 @@ public:
void diagnoseHeaderInclusion(Module *RequestingModule,
bool RequestingModuleIsModuleInterface,
SourceLocation FilenameLoc, StringRef Filename,
- const FileEntry *File);
+ FileEntryRef File);
/// Determine whether the given header is part of a module
/// marked 'unavailable'.
diff --git a/clang/lib/Lex/ModuleMap.cpp b/clang/lib/Lex/ModuleMap.cpp
index 75a0e6b..c791e3e 100644
--- a/clang/lib/Lex/ModuleMap.cpp
+++ b/clang/lib/Lex/ModuleMap.cpp
@@ -473,8 +473,7 @@ static Module *getTopLevelOrNull(Module *M) {
void ModuleMap::diagnoseHeaderInclusion(Module *RequestingModule,
bool RequestingModuleIsModuleInterface,
SourceLocation FilenameLoc,
- StringRef Filename,
- const FileEntry *File) {
+ StringRef Filename, FileEntryRef File) {
// No errors for indirect modules. This may be a bit of a problem for modules
// with no source files.
if (getTopLevelOrNull(RequestingModule) != getTopLevelOrNull(SourceModule))
@@ -542,7 +541,7 @@ void ModuleMap::diagnoseHeaderInclusion(Module *RequestingModule,
diag::warn_non_modular_include_in_framework_module :
diag::warn_non_modular_include_in_module;
Diags.Report(FilenameLoc, DiagID) << RequestingModule->getFullModuleName()
- << File->getName();
+ << File.getName();
}
}
diff --git a/clang/lib/Lex/PPDirectives.cpp b/clang/lib/Lex/PPDirectives.cpp
index fbc9466..0ac3bec 100644
--- a/clang/lib/Lex/PPDirectives.cpp
+++ b/clang/lib/Lex/PPDirectives.cpp
@@ -905,7 +905,7 @@ Optional<FileEntryRef> Preprocessor::LookupFile(
if (SuggestedModule && !LangOpts.AsmPreprocessor)
HeaderInfo.getModuleMap().diagnoseHeaderInclusion(
RequestingModule, RequestingModuleIsModuleInterface, FilenameLoc,
- Filename, &FE->getFileEntry());
+ Filename, *FE);
return FE;
}
@@ -921,7 +921,7 @@ Optional<FileEntryRef> Preprocessor::LookupFile(
if (SuggestedModule && !LangOpts.AsmPreprocessor)
HeaderInfo.getModuleMap().diagnoseHeaderInclusion(
RequestingModule, RequestingModuleIsModuleInterface, FilenameLoc,
- Filename, &FE->getFileEntry());
+ Filename, *FE);
return FE;
}
}
@@ -936,7 +936,7 @@ Optional<FileEntryRef> Preprocessor::LookupFile(
if (SuggestedModule && !LangOpts.AsmPreprocessor)
HeaderInfo.getModuleMap().diagnoseHeaderInclusion(
RequestingModule, RequestingModuleIsModuleInterface,
- FilenameLoc, Filename, &FE->getFileEntry());
+ FilenameLoc, Filename, *FE);
return FE;
}
}