clang-tools 19.0.0git
Classes | Enumerations | Functions
clang::tidy::misc Namespace Reference

Classes

class  ConfusableIdentifierCheck
 Finds symbol which have confusable identifiers, i.e. More...
 
class  ConstCorrectnessCheck
 This check warns on variables which could be declared const but are not. More...
 
class  CoroutineHostileRAIICheck
 Detects when objects of certain hostile RAII types persists across suspension points in a coroutine. More...
 
class  DefinitionsInHeadersCheck
 Finds non-extern non-inline function and variable definitions in header files, which can lead to potential ODR violations. More...
 
class  HeaderIncludeCycleCheck
 Check detects cyclic #include dependencies between user-defined headers. More...
 
class  IncludeCleanerCheck
 Checks for unused and missing includes. More...
 
class  MiscModule
 
class  MisleadingBidirectionalCheck
 
class  MisleadingIdentifierCheck
 
class  MisplacedConstCheck
 This check diagnoses when a const qualifier is applied to a typedef to a pointer type rather than to the pointee. More...
 
class  NewDeleteOverloadsCheck
 
class  NonCopyableObjectsCheck
 The check flags dereferences and non-pointer declarations of objects that are not meant to be passed by value, such as C FILE objects. More...
 
class  NonPrivateMemberVariablesInClassesCheck
 This checker finds classes that not only contain the data (non-static member variables), but also have logic (non-static member functions), and diagnoses all member variables that have any other scope other than private. More...
 
class  NoRecursionCheck
 Finds strongly connected functions (by analyzing call graph for SCC's that are loops), diagnoses each function in the cycle, and displays one example of possible call graph loop (recursion). More...
 
class  RedundantExpressionCheck
 The checker detects expressions that are redundant, because they contain ineffective, useless parts. More...
 
class  StaticAssertCheck
 Replaces assert() with static_assert() if the condition is evaluatable at compile time. More...
 
class  ThrowByValueCatchByReferenceCheck
 checks for locations that do not throw by value More...
 
class  UnconventionalAssignOperatorCheck
 Finds declarations of assignment operators with the wrong return and/or argument types and definitions with good return type but wrong return statements. More...
 
class  UniqueptrResetReleaseCheck
 Find and replace unique_ptr::reset(release()) with std::move(). More...
 
class  UnusedAliasDeclsCheck
 Finds unused namespace alias declarations. More...
 
class  UnusedParametersCheck
 Finds unused parameters and fixes them, so that -Wunused-parameter can be turned on. More...
 
class  UnusedUsingDeclsCheck
 Finds unused using declarations. More...
 
class  UseAnonymousNamespaceCheck
 Warns when using 'static' functions or variables at global scope, and suggests moving them to an anonymous namespace. More...
 

Enumerations

enum class  VariableCategory { Value , Reference , Pointer }
 Classify for a variable in what the Const-Check is interested. More...
 

Functions

static llvm::SmallString< 64U > skeleton (StringRef Name)
 
static bool mayShadowImpl (const DeclContext *DC0, const DeclContext *DC1)
 
static bool mayShadowImpl (const NamedDecl *ND0, const NamedDecl *ND1)
 
static bool isMemberOf (const ConfusableIdentifierCheck::ContextInfo *DC0, const ConfusableIdentifierCheck::ContextInfo *DC1)
 
static bool enclosesContext (const ConfusableIdentifierCheck::ContextInfo *DC0, const ConfusableIdentifierCheck::ContextInfo *DC1)
 
static bool mayShadow (const NamedDecl *ND0, const ConfusableIdentifierCheck::ContextInfo *DC0, const NamedDecl *ND1, const ConfusableIdentifierCheck::ContextInfo *DC1)
 
static bool isUnassignedAL (llvm::UTF32 CP)
 
static bool isUnassignedR (llvm::UTF32 CP)
 
static bool isR (llvm::UTF32 CP)
 
static bool hasRTLCharacters (StringRef Buffer)
 
static QualType guessAlternateQualification (ASTContext &Context, QualType QT)
 
static bool exprEvaluatesToZero (BinaryOperatorKind Opcode, APSInt Value)
 
static bool exprEvaluatesToBitwiseNegatedZero (BinaryOperatorKind Opcode, APSInt Value)
 
static bool exprEvaluatesToSymbolic (BinaryOperatorKind Opcode, APSInt Value)
 
template<typename T >
static CharSourceRange removeNode (const MatchFinder::MatchResult &Result, const T *PrevNode, const T *Node, const T *NextNode)
 
static FixItHint removeParameter (const MatchFinder::MatchResult &Result, const FunctionDecl *Function, unsigned Index)
 
static FixItHint removeArgument (const MatchFinder::MatchResult &Result, const CallExpr *Call, unsigned Index)
 
static bool shouldCheckDecl (const Decl *TargetDecl)
 

Enumeration Type Documentation

◆ VariableCategory

Classify for a variable in what the Const-Check is interested.

Enumerator
Value 
Reference 
Pointer 

Definition at line 109 of file ConstCorrectnessCheck.cpp.

Function Documentation

◆ enclosesContext()

static bool clang::tidy::misc::enclosesContext ( const ConfusableIdentifierCheck::ContextInfo DC0,
const ConfusableIdentifierCheck::ContextInfo DC1 
)
static

◆ exprEvaluatesToBitwiseNegatedZero()

static bool clang::tidy::misc::exprEvaluatesToBitwiseNegatedZero ( BinaryOperatorKind  Opcode,
APSInt  Value 
)
static

Definition at line 1088 of file RedundantExpressionCheck.cpp.

◆ exprEvaluatesToSymbolic()

static bool clang::tidy::misc::exprEvaluatesToSymbolic ( BinaryOperatorKind  Opcode,
APSInt  Value 
)
static

Definition at line 1093 of file RedundantExpressionCheck.cpp.

References Value.

◆ exprEvaluatesToZero()

static bool clang::tidy::misc::exprEvaluatesToZero ( BinaryOperatorKind  Opcode,
APSInt  Value 
)
static

Definition at line 1084 of file RedundantExpressionCheck.cpp.

References Value.

◆ guessAlternateQualification()

static QualType clang::tidy::misc::guessAlternateQualification ( ASTContext &  Context,
QualType  QT 
)
static

◆ hasRTLCharacters()

static bool clang::tidy::misc::hasRTLCharacters ( StringRef  Buffer)
static

◆ isMemberOf()

static bool clang::tidy::misc::isMemberOf ( const ConfusableIdentifierCheck::ContextInfo DC0,
const ConfusableIdentifierCheck::ContextInfo DC1 
)
static

◆ isR()

static bool clang::tidy::misc::isR ( llvm::UTF32  CP)
static

Definition at line 42 of file MisleadingIdentifier.cpp.

Referenced by hasRTLCharacters().

◆ isUnassignedAL()

static bool clang::tidy::misc::isUnassignedAL ( llvm::UTF32  CP)
static

Definition at line 17 of file MisleadingIdentifier.cpp.

Referenced by hasRTLCharacters().

◆ isUnassignedR()

static bool clang::tidy::misc::isUnassignedR ( llvm::UTF32  CP)
static

Definition at line 29 of file MisleadingIdentifier.cpp.

Referenced by hasRTLCharacters().

◆ mayShadow()

static bool clang::tidy::misc::mayShadow ( const NamedDecl *  ND0,
const ConfusableIdentifierCheck::ContextInfo DC0,
const NamedDecl *  ND1,
const ConfusableIdentifierCheck::ContextInfo DC1 
)
static

◆ mayShadowImpl() [1/2]

static bool clang::tidy::misc::mayShadowImpl ( const DeclContext *  DC0,
const DeclContext *  DC1 
)
static

Definition at line 92 of file ConfusableIdentifierCheck.cpp.

Referenced by mayShadow().

◆ mayShadowImpl() [2/2]

static bool clang::tidy::misc::mayShadowImpl ( const NamedDecl *  ND0,
const NamedDecl *  ND1 
)
static

Definition at line 96 of file ConfusableIdentifierCheck.cpp.

◆ removeArgument()

static FixItHint clang::tidy::misc::removeArgument ( const MatchFinder::MatchResult &  Result,
const CallExpr *  Call,
unsigned  Index 
)
static

Definition at line 66 of file UnusedParametersCheck.cpp.

References removeNode().

◆ removeNode()

template<typename T >
static CharSourceRange clang::tidy::misc::removeNode ( const MatchFinder::MatchResult &  Result,
const T *  PrevNode,
const T *  Node,
const T *  NextNode 
)
static

Definition at line 40 of file UnusedParametersCheck.cpp.

References Node.

Referenced by removeArgument(), and removeParameter().

◆ removeParameter()

static FixItHint clang::tidy::misc::removeParameter ( const MatchFinder::MatchResult &  Result,
const FunctionDecl *  Function,
unsigned  Index 
)
static

Definition at line 57 of file UnusedParametersCheck.cpp.

References removeNode().

◆ shouldCheckDecl()

static bool clang::tidy::misc::shouldCheckDecl ( const Decl TargetDecl)
static

◆ skeleton()

static llvm::SmallString< 64U > clang::tidy::misc::skeleton ( StringRef  Name)
static

Definition at line 49 of file ConfusableIdentifierCheck.cpp.

References Name, and Where.

Referenced by clang::tidy::misc::ConfusableIdentifierCheck::check().