clang-tools  6.0.0svn
Classes | Enumerations | Functions | Variables
clang::tidy::readability Namespace Reference


class  AvoidConstParamsInDecls
class  BracesAroundStatementsCheck
 Checks that bodies of if statements and loops (for, range-for, do-while, and while) are inside braces. More...
class  ContainerSizeEmptyCheck
 Checks whether a call to the size() method can be replaced with a call to empty(). More...
class  DeletedDefaultCheck
 Checks when a constructor or an assignment operator is marked as '= default' but is actually deleted by the compiler. More...
class  DeleteNullPointerCheck
 Check whether the 'if' statement is unnecessary before calling 'delete' on a pointer. More...
class  ElseAfterReturnCheck
 Flags the usages of else after return. More...
class  FunctionSizeCheck
 Checks for large functions based on various metrics. More...
class  IdentifierNamingCheck
 Checks for identifiers naming style mismatch. More...
class  ImplicitBoolConversionCheck
 Checks for use of implicit bool conversions in expressions. More...
class  InconsistentDeclarationParameterNameCheck
 Checks for declarations of functions which differ in parameter names. More...
class  MisleadingIndentationCheck
 Checks the code for dangling else, and possible misleading indentations due to missing braces. More...
class  MisplacedArrayIndexCheck
 Warn about unusual array index syntax (index[array] instead of array[index]). More...
class  NamedParameterCheck
 Find functions with unnamed arguments. More...
class  NamespaceCommentCheck
 Checks that long namespaces have a closing comment. More...
class  NonConstParameterCheck
 Warn when a pointer function parameter can be const. More...
class  ReadabilityModule
class  RedundantControlFlowCheck
 Eliminates redundant return statements at the end of a function that returns void. More...
class  RedundantDeclarationCheck
 Find redundant variable declarations. More...
class  RedundantFunctionPtrDereferenceCheck
 Eliminate redundant dereferences of a function pointer. More...
class  RedundantMemberInitCheck
 Finds member initializations that are unnecessary because the same default constructor would be called if they were not present. More...
class  RedundantSmartptrGetCheck
 Find and remove redundant calls to smart pointer's .get() method. More...
class  RedundantStringCStrCheck
 Finds unnecessary calls to std::string::c_str(). More...
class  RedundantStringInitCheck
 Finds unnecessary string initializations. More...
class  SimplifyBooleanExprCheck
 Looks for boolean expressions involving boolean constants and simplifies them to use the appropriate boolean expression directly. More...
class  StaticAccessedThroughInstanceCheck
 @brief Checks for member expressions that access static members through instances and replaces them with uses of the appropriate qualified-id. More...
class  StaticDefinitionInAnonymousNamespaceCheck
 Finds static function and variable definitions in anonymous namespace. More...
class  UniqueptrDeleteReleaseCheck
 Flags statements of the form delete <unique_ptr expr>.release(); and replaces them with: <unique_ptr expr> = nullptr; More...


enum  StyleKind { SK_Count, SK_Invalid }


static llvm::Optional< Token > ConstTok (CharSourceRange Range, const MatchFinder::MatchResult &Result)
static bool matchesStyle (StringRef Name, IdentifierNamingCheck::NamingStyle Style)
static std::string fixupWithCase (StringRef Name, IdentifierNamingCheck::CaseType Case)
static std::string fixupWithStyle (StringRef Name, const IdentifierNamingCheck::NamingStyle &Style)
static StyleKind findStyleKind (const NamedDecl *D, const std::vector< llvm::Optional< IdentifierNamingCheck::NamingStyle >> &NamingStyles)
static void addUsage (IdentifierNamingCheck::NamingCheckFailureMap &Failures, const IdentifierNamingCheck::NamingCheckId &Decl, SourceRange Range, SourceManager *SourceMgr=nullptr)
static void addUsage (IdentifierNamingCheck::NamingCheckFailureMap &Failures, const NamedDecl *Decl, SourceRange Range, SourceManager *SourceMgr=nullptr)
 Convenience method when the usage to be added is a NamedDecl. More...
static const IfStmt * getPrecedingIf (const SourceManager &SM, ASTContext *Context, const IfStmt *If)
static bool locationsInSameFile (const SourceManager &Sources, SourceLocation Loc1, SourceLocation Loc2)
static std::string getNamespaceComment (const NamespaceDecl *ND, bool InsertLineBreak)
static ClangTidyModuleRegistry::Add< ReadabilityModuleX ("readability-module", "Adds readability-related checks.")
bool containsBoolLiteral (const Expr *E)
static unsigned getNameSpecifierNestingLevel (const QualType &QType)


static StringRef const StyleNames []

Enumeration Type Documentation

◆ StyleKind


Definition at line 113 of file IdentifierNamingCheck.cpp.

Function Documentation

◆ addUsage() [1/2]

static void clang::tidy::readability::addUsage ( IdentifierNamingCheck::NamingCheckFailureMap Failures,
const IdentifierNamingCheck::NamingCheckId Decl,
SourceRange  Range,
SourceManager *  SourceMgr = nullptr 

◆ addUsage() [2/2]

static void clang::tidy::readability::addUsage ( IdentifierNamingCheck::NamingCheckFailureMap Failures,
const NamedDecl *  Decl,
SourceRange  Range,
SourceManager *  SourceMgr = nullptr 

Convenience method when the usage to be added is a NamedDecl.

Definition at line 677 of file IdentifierNamingCheck.cpp.

◆ ConstTok()

static llvm::Optional<Token> clang::tidy::readability::ConstTok ( CharSourceRange  Range,
const MatchFinder::MatchResult &  Result 

Definition at line 51 of file AvoidConstParamsInDecls.cpp.

References File, and Info.

Referenced by clang::tidy::readability::AvoidConstParamsInDecls::check().

◆ containsBoolLiteral()

bool clang::tidy::readability::containsBoolLiteral ( const Expr *  E)

Definition at line 344 of file SimplifyBooleanExprCheck.cpp.

References Range.

◆ findStyleKind()

static StyleKind clang::tidy::readability::findStyleKind ( const NamedDecl *  D,
const std::vector< llvm::Optional< IdentifierNamingCheck::NamingStyle >> &  NamingStyles 

◆ fixupWithCase()

static std::string clang::tidy::readability::fixupWithCase ( StringRef  Name,
IdentifierNamingCheck::CaseType  Case 

◆ fixupWithStyle()

static std::string clang::tidy::readability::fixupWithStyle ( StringRef  Name,
const IdentifierNamingCheck::NamingStyle Style 

◆ getNamespaceComment()

static std::string clang::tidy::readability::getNamespaceComment ( const NamespaceDecl *  ND,
bool  InsertLineBreak 

Definition at line 49 of file NamespaceCommentCheck.cpp.

References Fix().

Referenced by clang::tidy::readability::NamespaceCommentCheck::check().

◆ getNameSpecifierNestingLevel()

static unsigned clang::tidy::readability::getNameSpecifierNestingLevel ( const QualType &  QType)

◆ getPrecedingIf()

static const IfStmt* clang::tidy::readability::getPrecedingIf ( const SourceManager &  SM,
ASTContext *  Context,
const IfStmt *  If 

Definition at line 20 of file MisleadingIndentationCheck.cpp.

◆ locationsInSameFile()

static bool clang::tidy::readability::locationsInSameFile ( const SourceManager &  Sources,
SourceLocation  Loc1,
SourceLocation  Loc2 

◆ matchesStyle()

static bool clang::tidy::readability::matchesStyle ( StringRef  Name,
IdentifierNamingCheck::NamingStyle  Style 

◆ X()

static ClangTidyModuleRegistry::Add<ReadabilityModule> clang::tidy::readability::X ( "readability-module"  ,
"Adds readability-related checks."   

Variable Documentation

◆ StyleNames

StringRef const clang::tidy::readability::StyleNames[]
Initial value:
= {
#define STRINGIZE(v)

Definition at line 121 of file IdentifierNamingCheck.cpp.