clang-tools
11.0.0
|
Namespaces | |
decl_ref_expr | |
fixit | |
lexer | |
options | |
type_traits | |
Classes | |
class | ExceptionAnalyzer |
This class analysis if a FunctionDecl can in principle throw an exception, either directly or indirectly. More... | |
class | ExprSequence |
Provides information about the evaluation order of (sub-)expressions within a CFGBlock . More... | |
class | HeaderGuardCheck |
Finds and fixes header guards. More... | |
class | IncludeInserter |
Produces fixes to insert specified includes to source files, if not yet present. More... | |
class | IncludeInserterCallback |
class | IncludeSorter |
Class used by IncludeInserterCallback to record the names of the inclusions in a given source file being processed and generate the necessary commands to sort the inclusions according to the precedence encoded in IncludeKinds . More... | |
class | NamespaceAliaser |
class | StmtToBlockMap |
Maps Stmt s to the CFGBlock that contains them. More... | |
class | TransformerClangTidyCheck |
class | UsingInserter |
Typedefs | |
typedef llvm::SmallSet< llvm::StringRef, 5 > | FileExtensionsSet |
Functions | |
static bool | isAccessForVar (const Stmt *S, const VarDecl *Var) |
Return whether S is a reference to the declaration of Var . More... | |
static bool | isPtrOrReferenceForVar (const Stmt *S, const VarDecl *Var) |
Return whether Var has a pointer or reference in S . More... | |
static bool | hasPtrOrReferenceInStmt (const Stmt *S, const VarDecl *Var) |
Return whether Var has a pointer or reference in S . More... | |
bool | hasPtrOrReferenceInFunc (const FunctionDecl *Func, const VarDecl *Var) |
Returns whether Var has a pointer or reference in Func . More... | |
const FunctionDecl * | getSurroundingFunction (ASTContext &Context, const Stmt &Statement) |
bool | IsBinaryOrTernary (const Expr *E) |
bool | exprHasBitFlagWithSpelling (const Expr *Flags, const SourceManager &SM, const LangOptions &LangOpts, StringRef FlagName) |
Checks whether a macro flag is present in the given argument. More... | |
bool | rangeIsEntirelyWithinMacroArgument (SourceRange Range, const SourceManager *SM) |
bool | rangeContainsMacroExpansion (SourceRange Range, const SourceManager *SM) |
bool | rangeCanBeFixed (SourceRange Range, const SourceManager *SM) |
static bool | isBaseOf (const Type *DerivedType, const Type *BaseType) |
static SmallVector< const Stmt *, 1 > | getParentStmts (const Stmt *S, ASTContext *Context) |
bool | isExpansionLocInHeaderFile (SourceLocation Loc, const SourceManager &SM, const FileExtensionsSet &HeaderFileExtensions) |
Checks whether expansion location of Loc is in header file. More... | |
bool | isPresumedLocInHeaderFile (SourceLocation Loc, SourceManager &SM, const FileExtensionsSet &HeaderFileExtensions) |
Checks whether presumed location of Loc is in header file. More... | |
bool | isSpellingLocInHeaderFile (SourceLocation Loc, SourceManager &SM, const FileExtensionsSet &HeaderFileExtensions) |
Checks whether spelling location of Loc is in header file. More... | |
bool | parseFileExtensions (StringRef AllFileExtensions, FileExtensionsSet &FileExtensions, StringRef Delimiters) |
Parses header file extensions from a semicolon-separated list. More... | |
llvm::Optional< StringRef > | getFileExtension (StringRef FileName, const FileExtensionsSet &FileExtensions) |
Decides whether a file has a header file extension. More... | |
bool | isFileExtension (StringRef FileName, const FileExtensionsSet &FileExtensions) |
Decides whether a file has one of the specified file extensions. More... | |
StringRef | defaultHeaderFileExtensions () |
Returns recommended default value for the list of header file extensions. More... | |
StringRef | defaultImplementationFileExtensions () |
Returns recommended default value for the list of implementation file extensions. More... | |
StringRef | defaultFileExtensionDelimiters () |
Returns recommended default value for the list of file extension delimiters. More... | |
static std::string | cleanPath (StringRef Path) |
canonicalize a path by removing ./ and ../ components. More... | |
AST_MATCHER_P (NamespaceAliasDecl, hasTargetNamespace, ast_matchers::internal::Matcher< NamespaceDecl >, innerMatcher) | |
static bool | hasExplanation (const RewriteRule::Case &C) |
static StringRef | getUnqualifiedName (StringRef QualifiedName) |
typedef llvm::SmallSet<llvm::StringRef, 5> clang::tidy::utils::FileExtensionsSet |
Definition at line 22 of file FileExtensionsUtils.h.
clang::tidy::utils::AST_MATCHER_P | ( | NamespaceAliasDecl | , |
hasTargetNamespace | , | ||
ast_matchers::internal::Matcher< NamespaceDecl > | , | ||
innerMatcher | |||
) |
Definition at line 24 of file NamespaceAliaser.cpp.
|
static |
canonicalize a path by removing ./ and ../ components.
Definition at line 21 of file HeaderGuard.cpp.
|
inline |
Returns recommended default value for the list of file extension delimiters.
Definition at line 48 of file FileExtensionsUtils.h.
Referenced by clang::tidy::utils::HeaderGuardCheck::HeaderGuardCheck().
|
inline |
Returns recommended default value for the list of header file extensions.
Definition at line 38 of file FileExtensionsUtils.h.
|
inline |
Returns recommended default value for the list of implementation file extensions.
Definition at line 42 of file FileExtensionsUtils.h.
bool clang::tidy::utils::exprHasBitFlagWithSpelling | ( | const Expr * | Flags, |
const SourceManager & | SM, | ||
const LangOptions & | LangOpts, | ||
StringRef | FlagName | ||
) |
Checks whether a macro flag is present in the given argument.
Only considers cases of single match or match in a binary OR expression. For example, <needed-flag> or <flag> | <needed-flag> | ...
Definition at line 42 of file ASTUtils.cpp.
llvm::Optional< StringRef > clang::tidy::utils::getFileExtension | ( | StringRef | FileName, |
const FileExtensionsSet & | FileExtensions | ||
) |
Decides whether a file has a header file extension.
Returns the file extension, if included in the provided set.
Definition at line 57 of file FileExtensionsUtils.cpp.
References FileName.
Referenced by isFileExtension().
|
static |
Definition at line 28 of file ExprSequence.cpp.
Referenced by clang::tidy::utils::StmtToBlockMap::blockContainingStmt(), and clang::tidy::utils::ExprSequence::inSequence().
const FunctionDecl * clang::tidy::utils::getSurroundingFunction | ( | ASTContext & | Context, |
const Stmt & | Statement | ||
) |
Definition at line 20 of file ASTUtils.cpp.
|
static |
Definition at line 22 of file UsingInserter.cpp.
|
static |
Definition at line 19 of file TransformerClangTidyCheck.cpp.
bool clang::tidy::utils::hasPtrOrReferenceInFunc | ( | const FunctionDecl * | Func, |
const VarDecl * | Var | ||
) |
Returns whether Var
has a pointer or reference in Func
.
Example: void f() { int n; ... int *p = }
For f()
and n
the function returns true
because p
is a pointer to n
created in f()
.
Definition at line 59 of file Aliasing.cpp.
References hasPtrOrReferenceInStmt().
|
static |
Return whether Var
has a pointer or reference in S
.
Definition at line 44 of file Aliasing.cpp.
References isPtrOrReferenceForVar().
Referenced by hasPtrOrReferenceInFunc().
|
static |
Return whether S
is a reference to the declaration of Var
.
Definition at line 18 of file Aliasing.cpp.
Referenced by isPtrOrReferenceForVar().
Definition at line 49 of file ExceptionAnalyzer.cpp.
Referenced by clang::tidy::utils::ExceptionAnalyzer::ExceptionInfo::filterByCatch().
bool clang::tidy::utils::IsBinaryOrTernary | ( | const Expr * | E | ) |
Definition at line 27 of file ASTUtils.cpp.
bool clang::tidy::utils::isExpansionLocInHeaderFile | ( | SourceLocation | Loc, |
const SourceManager & | SM, | ||
const FileExtensionsSet & | HeaderFileExtensions | ||
) |
Checks whether expansion location of Loc
is in header file.
Definition at line 17 of file FileExtensionsUtils.cpp.
bool clang::tidy::utils::isFileExtension | ( | StringRef | FileName, |
const FileExtensionsSet & | FileExtensions | ||
) |
Decides whether a file has one of the specified file extensions.
Definition at line 67 of file FileExtensionsUtils.cpp.
References FileName, and getFileExtension().
Referenced by clang::tidy::utils::HeaderGuardCheck::shouldSuggestEndifComment(), and clang::tidy::utils::HeaderGuardCheck::shouldSuggestToAddHeaderGuard().
bool clang::tidy::utils::isPresumedLocInHeaderFile | ( | SourceLocation | Loc, |
SourceManager & | SM, | ||
const FileExtensionsSet & | HeaderFileExtensions | ||
) |
Checks whether presumed location of Loc
is in header file.
Definition at line 23 of file FileExtensionsUtils.cpp.
|
static |
Return whether Var
has a pointer or reference in S
.
Definition at line 26 of file Aliasing.cpp.
References Decl, and isAccessForVar().
Referenced by hasPtrOrReferenceInStmt().
bool clang::tidy::utils::isSpellingLocInHeaderFile | ( | SourceLocation | Loc, |
SourceManager & | SM, | ||
const FileExtensionsSet & | HeaderFileExtensions | ||
) |
Checks whether spelling location of Loc
is in header file.
Definition at line 29 of file FileExtensionsUtils.cpp.
bool clang::tidy::utils::parseFileExtensions | ( | StringRef | AllFileExtensions, |
FileExtensionsSet & | FileExtensions, | ||
StringRef | Delimiters | ||
) |
Parses header file extensions from a semicolon-separated list.
Definition at line 35 of file FileExtensionsUtils.cpp.
References Suffix, and Suffixes.
Referenced by clang::tidy::utils::HeaderGuardCheck::HeaderGuardCheck().
bool clang::tidy::utils::rangeCanBeFixed | ( | SourceRange | Range, |
const SourceManager * | SM | ||
) |
Definition at line 90 of file ASTUtils.cpp.
Referenced by clang::tidy::RenamerClangTidyCheck::addUsage().
bool clang::tidy::utils::rangeContainsMacroExpansion | ( | SourceRange | Range, |
const SourceManager * | SM | ||
) |
Definition at line 85 of file ASTUtils.cpp.
bool clang::tidy::utils::rangeIsEntirelyWithinMacroArgument | ( | SourceRange | Range, |
const SourceManager * | SM | ||
) |
Definition at line 69 of file ASTUtils.cpp.