[all-commits] [llvm/llvm-project] 8b21e0: [clang] NFC: Remove unused `DirectoryLookup`

Jan Svoboda via All-commits all-commits at lists.llvm.org
Tue Jan 18 07:02:35 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 8b21e074dbdf79062505f28b700bd4502acf3096
      https://github.com/llvm/llvm-project/commit/8b21e074dbdf79062505f28b700bd4502acf3096
  Author: Jan Svoboda <jan_svoboda at apple.com>
  Date:   2022-01-18 (Tue, 18 Jan 2022)

  Changed paths:
    M clang/lib/Frontend/Rewrite/InclusionRewriter.cpp

  Log Message:
  -----------
  [clang] NFC: Remove unused `DirectoryLookup`

This patch removes bitrotten/dead uses of `DirectoryLookup` in `InclusionRewriter.cpp`.

Reviewed By: ahoppen

Differential Revision: https://reviews.llvm.org/D117309


  Commit: 105c913156e94163c937d812992fe3a56210998c
      https://github.com/llvm/llvm-project/commit/105c913156e94163c937d812992fe3a56210998c
  Author: Jan Svoboda <jan_svoboda at apple.com>
  Date:   2022-01-18 (Tue, 18 Jan 2022)

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

  Log Message:
  -----------
  [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


Compare: https://github.com/llvm/llvm-project/compare/10ed1eca241f...105c913156e9


More information about the All-commits mailing list