clang-tools  3.9.0
HeaderFileExtensionsUtils.h
Go to the documentation of this file.
1 //===--- HeaderFileExtensionsUtils.h - clang-tidy----------------*- C++ -*-===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 
10 #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_UTILS_HEADER_FILE_EXTENSIONS_UTILS_H
11 #define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_UTILS_HEADER_FILE_EXTENSIONS_UTILS_H
12 
13 #include "clang/Basic/SourceLocation.h"
14 #include "clang/Basic/SourceManager.h"
15 #include "llvm/ADT/StringRef.h"
16 #include "llvm/ADT/SmallSet.h"
17 
18 namespace clang {
19 namespace tidy {
20 namespace utils {
21 
22 typedef llvm::SmallSet<llvm::StringRef, 5> HeaderFileExtensionsSet;
23 
24 /// \brief Checks whether expansion location of \p Loc is in header file.
26  SourceLocation Loc, const SourceManager &SM,
27  const HeaderFileExtensionsSet &HeaderFileExtensions);
28 
29 /// \brief Checks whether presumed location of \p Loc is in header file.
31  SourceLocation Loc, SourceManager &SM,
32  const HeaderFileExtensionsSet &HeaderFileExtensions);
33 
34 /// \brief Checks whether spelling location of \p Loc is in header file.
36  SourceLocation Loc, SourceManager &SM,
37  const HeaderFileExtensionsSet &HeaderFileExtensions);
38 
39 /// \brief Parses header file extensions from a semicolon-separated list.
40 bool parseHeaderFileExtensions(StringRef AllHeaderFileExtensions,
41  HeaderFileExtensionsSet &HeaderFileExtensions,
42  char delimiter);
43 
44 } // namespace utils
45 } // namespace tidy
46 } // namespace clang
47 
48 #endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_UTILS_HEADER_FILE_EXTENSIONS_UTILS_H
SourceLocation Loc
'#' location in the include directive
bool parseHeaderFileExtensions(StringRef AllHeaderFileExtensions, HeaderFileExtensionsSet &HeaderFileExtensions, char delimiter)
Parses header file extensions from a semicolon-separated list.
bool isSpellingLocInHeaderFile(SourceLocation Loc, SourceManager &SM, const HeaderFileExtensionsSet &HeaderFileExtensions)
Checks whether spelling location of Loc is in header file.
bool isPresumedLocInHeaderFile(SourceLocation Loc, SourceManager &SM, const HeaderFileExtensionsSet &HeaderFileExtensions)
Checks whether presumed location of Loc is in header file.
bool isExpansionLocInHeaderFile(SourceLocation Loc, const SourceManager &SM, const HeaderFileExtensionsSet &HeaderFileExtensions)
Checks whether expansion location of Loc is in header file.
SourceManager & SM
llvm::SmallSet< llvm::StringRef, 5 > HeaderFileExtensionsSet