comparison clang-tools-extra/clang-tidy/modernize/DeprecatedHeadersCheck.cpp @ 252:1f2b6ac9f198 llvm-original

LLVM16-1
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Fri, 18 Aug 2023 09:04:13 +0900
parents c4bab56944e8
children
comparison
equal deleted inserted replaced
237:c80f45b162ad 252:1f2b6ac9f198
17 #include <algorithm> 17 #include <algorithm>
18 #include <vector> 18 #include <vector>
19 19
20 using IncludeMarker = 20 using IncludeMarker =
21 clang::tidy::modernize::DeprecatedHeadersCheck::IncludeMarker; 21 clang::tidy::modernize::DeprecatedHeadersCheck::IncludeMarker;
22 namespace clang { 22 namespace clang::tidy::modernize {
23 namespace tidy {
24 namespace modernize {
25 namespace { 23 namespace {
26 24
27 class IncludeModernizePPCallbacks : public PPCallbacks { 25 class IncludeModernizePPCallbacks : public PPCallbacks {
28 public: 26 public:
29 explicit IncludeModernizePPCallbacks( 27 explicit IncludeModernizePPCallbacks(
31 const SourceManager &SM, bool CheckHeaderFile); 29 const SourceManager &SM, bool CheckHeaderFile);
32 30
33 void InclusionDirective(SourceLocation HashLoc, const Token &IncludeTok, 31 void InclusionDirective(SourceLocation HashLoc, const Token &IncludeTok,
34 StringRef FileName, bool IsAngled, 32 StringRef FileName, bool IsAngled,
35 CharSourceRange FilenameRange, 33 CharSourceRange FilenameRange,
36 Optional<FileEntryRef> File, StringRef SearchPath, 34 OptionalFileEntryRef File, StringRef SearchPath,
37 StringRef RelativePath, const Module *Imported, 35 StringRef RelativePath, const Module *Imported,
38 SrcMgr::CharacteristicKind FileType) override; 36 SrcMgr::CharacteristicKind FileType) override;
39 37
40 private: 38 private:
41 std::vector<IncludeMarker> &IncludesToBeProcessed; 39 std::vector<IncludeMarker> &IncludesToBeProcessed;
177 } 175 }
178 } 176 }
179 177
180 void IncludeModernizePPCallbacks::InclusionDirective( 178 void IncludeModernizePPCallbacks::InclusionDirective(
181 SourceLocation HashLoc, const Token &IncludeTok, StringRef FileName, 179 SourceLocation HashLoc, const Token &IncludeTok, StringRef FileName,
182 bool IsAngled, CharSourceRange FilenameRange, Optional<FileEntryRef> File, 180 bool IsAngled, CharSourceRange FilenameRange, OptionalFileEntryRef File,
183 StringRef SearchPath, StringRef RelativePath, const Module *Imported, 181 StringRef SearchPath, StringRef RelativePath, const Module *Imported,
184 SrcMgr::CharacteristicKind FileType) { 182 SrcMgr::CharacteristicKind FileType) {
185 183
186 // If we don't want to warn for non-main file reports and this is one, skip 184 // If we don't want to warn for non-main file reports and this is one, skip
187 // it. 185 // it.
209 IncludeMarker{std::string{}, FileName, 207 IncludeMarker{std::string{}, FileName,
210 SourceRange{HashLoc, FilenameRange.getEnd()}, DiagLoc}); 208 SourceRange{HashLoc, FilenameRange.getEnd()}, DiagLoc});
211 } 209 }
212 } 210 }
213 211
214 } // namespace modernize 212 } // namespace clang::tidy::modernize
215 } // namespace tidy
216 } // namespace clang