From d79ad2f1dbc2db63121620f55d6cfa915f2733ac Mon Sep 17 00:00:00 2001 From: Jan Svoboda Date: Mon, 11 Apr 2022 12:10:05 +0200 Subject: [clang][lex] NFCI: Use FileEntryRef in PPCallbacks::InclusionDirective() This patch changes type of the `File` parameter in `PPCallbacks::InclusionDirective()` from `const FileEntry *` to `Optional`. With the API change in place, this patch then removes some uses of the deprecated `FileEntry::getName()` (e.g. in `DependencyGraph.cpp` and `ModuleDependencyCollector.cpp`). Reviewed By: dexonsmith, bnbarham Differential Revision: https://reviews.llvm.org/D123574 --- .../clang-tidy/readability/DuplicateIncludeCheck.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'clang-tools-extra/clang-tidy/readability/DuplicateIncludeCheck.cpp') diff --git a/clang-tools-extra/clang-tidy/readability/DuplicateIncludeCheck.cpp b/clang-tools-extra/clang-tidy/readability/DuplicateIncludeCheck.cpp index a6e4943..9815952 100644 --- a/clang-tools-extra/clang-tidy/readability/DuplicateIncludeCheck.cpp +++ b/clang-tools-extra/clang-tidy/readability/DuplicateIncludeCheck.cpp @@ -47,9 +47,9 @@ public: void InclusionDirective(SourceLocation HashLoc, const Token &IncludeTok, StringRef FileName, bool IsAngled, - CharSourceRange FilenameRange, const FileEntry *File, - StringRef SearchPath, StringRef RelativePath, - const Module *Imported, + CharSourceRange FilenameRange, + Optional File, StringRef SearchPath, + StringRef RelativePath, const Module *Imported, SrcMgr::CharacteristicKind FileType) override; void MacroDefined(const Token &MacroNameTok, @@ -77,7 +77,7 @@ void DuplicateIncludeCallbacks::FileChanged(SourceLocation Loc, void DuplicateIncludeCallbacks::InclusionDirective( SourceLocation HashLoc, const Token &IncludeTok, StringRef FileName, - bool IsAngled, CharSourceRange FilenameRange, const FileEntry *File, + bool IsAngled, CharSourceRange FilenameRange, Optional File, StringRef SearchPath, StringRef RelativePath, const Module *Imported, SrcMgr::CharacteristicKind FileType) { if (llvm::find(Files.back(), FileName) != Files.back().end()) { -- cgit v1.1