aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/FrontendActions.cpp
diff options
context:
space:
mode:
authorJan Svoboda <jan_svoboda@apple.com>2022-01-18 15:44:24 +0100
committerJan Svoboda <jan_svoboda@apple.com>2022-01-18 16:02:18 +0100
commit105c913156e94163c937d812992fe3a56210998c (patch)
treef3a0cf2d96865b2d55987b7fedbc17bb74182cc0 /clang/lib/Frontend/FrontendActions.cpp
parent8b21e074dbdf79062505f28b700bd4502acf3096 (diff)
downloadllvm-105c913156e94163c937d812992fe3a56210998c.zip
llvm-105c913156e94163c937d812992fe3a56210998c.tar.gz
llvm-105c913156e94163c937d812992fe3a56210998c.tar.bz2
[clang][lex] NFC: Simplify calls to `LookupFile`
The `{HeaderSearch,Preprocessor}::LookupFile()` functions take an out-parameter `const DirectoryLookup *&`. Most callers end up creating a `const DirectoryLookup *` variable that's otherwise unused. This patch changes the out-parameter from reference to a pointer, making it possible to simply pass `nullptr` to the function without the ceremony. Reviewed By: ahoppen Differential Revision: https://reviews.llvm.org/D117312
Diffstat (limited to 'clang/lib/Frontend/FrontendActions.cpp')
-rw-r--r--clang/lib/Frontend/FrontendActions.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/clang/lib/Frontend/FrontendActions.cpp b/clang/lib/Frontend/FrontendActions.cpp
index fb8132a..5b77c3e 100644
--- a/clang/lib/Frontend/FrontendActions.cpp
+++ b/clang/lib/Frontend/FrontendActions.cpp
@@ -310,9 +310,8 @@ bool GenerateHeaderModuleAction::BeginSourceFileAction(
auto &HS = CI.getPreprocessor().getHeaderSearchInfo();
SmallVector<Module::Header, 16> Headers;
for (StringRef Name : ModuleHeaders) {
- const DirectoryLookup *CurDir = nullptr;
Optional<FileEntryRef> FE = HS.LookupFile(
- Name, SourceLocation(), /*Angled*/ false, nullptr, CurDir, None,
+ Name, SourceLocation(), /*Angled*/ false, nullptr, nullptr, None,
nullptr, nullptr, nullptr, nullptr, nullptr, nullptr);
if (!FE) {
CI.getDiagnostics().Report(diag::err_module_header_file_not_found)