clang-tools  5.0.0
Namespaces | Classes | Typedefs | Functions
clang::tidy::utils Namespace Reference

Namespaces

 decl_ref_expr
 
 fixit
 
 lexer
 
 options
 
 type_traits
 

Classes

class  ExprSequence
 Provides information about the evaluation order of (sub-)expressions within a CFGBlock. More...
 
class  StmtToBlockMap
 Maps Stmts to the CFGBlock that contains them. More...
 
class  HeaderGuardCheck
 Finds and fixes header guards. More...
 
class  IncludeInserterCallback
 
class  IncludeInserter
 Produces fixes to insert specified includes to source files, if not yet present. More...
 
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  UsingInserter
 

Typedefs

typedef llvm::SmallSet
< llvm::StringRef, 5 > 
HeaderFileExtensionsSet
 

Functions

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...
 
static SmallVector< const Stmt *, 1 > getParentStmts (const Stmt *S, ASTContext *Context)
 
bool isExpansionLocInHeaderFile (SourceLocation Loc, const SourceManager &SM, const HeaderFileExtensionsSet &HeaderFileExtensions)
 Checks whether expansion location of Loc is in header file. More...
 
bool isPresumedLocInHeaderFile (SourceLocation Loc, SourceManager &SM, const HeaderFileExtensionsSet &HeaderFileExtensions)
 Checks whether presumed location of Loc is in header file. More...
 
bool isSpellingLocInHeaderFile (SourceLocation Loc, SourceManager &SM, const HeaderFileExtensionsSet &HeaderFileExtensions)
 Checks whether spelling location of Loc is in header file. More...
 
bool parseHeaderFileExtensions (StringRef AllHeaderFileExtensions, HeaderFileExtensionsSet &HeaderFileExtensions, char delimiter)
 Parses header file extensions from a semicolon-separated list. More...
 
bool isHeaderFileExtension (StringRef FileName, const HeaderFileExtensionsSet &HeaderFileExtensions)
 Decides whether a file has a header file extension. 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 StringRef getUnqualifiedName (StringRef QualifiedName)
 

Typedef Documentation

typedef llvm::SmallSet<llvm::StringRef, 5> clang::tidy::utils::HeaderFileExtensionsSet

Definition at line 22 of file HeaderFileExtensionsUtils.h.

Function Documentation

clang::tidy::utils::AST_MATCHER_P ( NamespaceAliasDecl  ,
hasTargetNamespace  ,
ast_matchers::internal::Matcher< NamespaceDecl >  ,
innerMatcher   
)

Definition at line 25 of file NamespaceAliaser.cpp.

References Finder.

static std::string clang::tidy::utils::cleanPath ( StringRef  Path)
static

canonicalize a path by removing ./ and ../ components.

Definition at line 22 of file HeaderGuard.cpp.

References Path.

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 43 of file ASTUtils.cpp.

References LangOpts, and SM.

Referenced by clang::tidy::android::CloexecSocketCheck::check(), and clang::tidy::android::CloexecOpenCheck::check().

static SmallVector<const Stmt *, 1> clang::tidy::utils::getParentStmts ( const Stmt *  S,
ASTContext *  Context 
)
static
const FunctionDecl * clang::tidy::utils::getSurroundingFunction ( ASTContext &  Context,
const Stmt &  Statement 
)
static StringRef clang::tidy::utils::getUnqualifiedName ( StringRef  QualifiedName)
static
bool clang::tidy::utils::IsBinaryOrTernary ( const Expr *  E)
bool clang::tidy::utils::isExpansionLocInHeaderFile ( SourceLocation  Loc,
const SourceManager &  SM,
const HeaderFileExtensionsSet &  HeaderFileExtensions 
)

Checks whether expansion location of Loc is in header file.

Definition at line 18 of file HeaderFileExtensionsUtils.cpp.

References isHeaderFileExtension().

bool clang::tidy::utils::isHeaderFileExtension ( StringRef  FileName,
const HeaderFileExtensionsSet &  HeaderFileExtensions 
)
bool clang::tidy::utils::isPresumedLocInHeaderFile ( SourceLocation  Loc,
SourceManager &  SM,
const HeaderFileExtensionsSet &  HeaderFileExtensions 
)

Checks whether presumed location of Loc is in header file.

Definition at line 26 of file HeaderFileExtensionsUtils.cpp.

References isHeaderFileExtension().

Referenced by clang::tidy::google::build::UnnamedNamespaceInHeaderCheck::check().

bool clang::tidy::utils::isSpellingLocInHeaderFile ( SourceLocation  Loc,
SourceManager &  SM,
const HeaderFileExtensionsSet &  HeaderFileExtensions 
)

Checks whether spelling location of Loc is in header file.

Definition at line 34 of file HeaderFileExtensionsUtils.cpp.

References isHeaderFileExtension().

Referenced by clang::tidy::google::readability::GlobalNamesInHeadersCheck::check().

bool clang::tidy::utils::parseHeaderFileExtensions ( StringRef  AllHeaderFileExtensions,
HeaderFileExtensionsSet &  HeaderFileExtensions,
char  delimiter 
)