[PATCH] D117312: [clang][lex] NFC: Simplify calls to `LookupFile`

Jan Svoboda via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 14 06:56:46 PST 2022


jansvoboda11 created this revision.
jansvoboda11 added a reviewer: ahoppen.
Herald added a subscriber: carlosgalvezp.
jansvoboda11 requested review of this revision.
Herald added projects: clang, clang-tools-extra.
Herald added a subscriber: cfe-commits.

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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D117312

Files:
  clang-tools-extra/clang-tidy/bugprone/SuspiciousIncludeCheck.cpp
  clang/include/clang/Lex/HeaderSearch.h
  clang/include/clang/Lex/Preprocessor.h
  clang/lib/Frontend/FrontendActions.cpp
  clang/lib/Frontend/VerifyDiagnosticConsumer.cpp
  clang/lib/Lex/HeaderSearch.cpp
  clang/lib/Lex/PPDirectives.cpp
  clang/lib/Lex/PPMacroExpansion.cpp
  clang/lib/Lex/Pragma.cpp
  clang/lib/Lex/Preprocessor.cpp
  clang/unittests/Lex/HeaderSearchTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D117312.399980.patch
Type: text/x-patch
Size: 11319 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220114/06fbd458/attachment-0001.bin>


More information about the cfe-commits mailing list