clang-tools 22.0.0git
clang::tidy::utils Namespace Reference

Namespaces

namespace  decl_ref_expr
namespace  fixit
namespace  lexer
namespace  options
namespace  type_traits

Classes

struct  BraceInsertionHints
 A provider of fix-it hints to insert opening and closing braces. More...
class  ExceptionAnalyzer
 This class analysis if a FunctionDecl can in principle throw an exception, either directly or indirectly. More...
class  ExceptionSpecAnalyzer
 This class analysis if a FunctionDecl has been declared implicitly through defaulting or explicitly as throwing or not and evaluates noexcept expressions if needed. More...
class  ExprSequence
 Provides information about the evaluation order of (sub-)expressions within a CFGBlock. More...
class  FormatStringConverter
 Convert a printf-style format string to a std::formatter-style one, and prepare any casts that are required to wrap the arguments to retain printf compatibility. More...
class  HeaderGuardCheck
 Finds and fixes header guards. More...
class  IncludeInserterCallback
class  NamespaceAliaser
class  StmtToBlockMap
 Maps Stmts to the CFGBlock that contains them. More...
class  TransformerClangTidyCheck
 A base class for defining a ClangTidy check based on a RewriteRule. More...
class  UseRangesCheck
 Base class for handling converting std iterator algorithms to a range equivalent. More...
class  UsingInserter

Functions

static bool isAccessForVar (const Stmt *S, const ValueDecl *Var)
 Return whether S is a reference to the declaration of Var.
static bool capturesByRef (const CXXRecordDecl *RD, const ValueDecl *Var)
static bool isPtrOrReferenceForVar (const Stmt *S, const ValueDecl *Var)
 Return whether Var has a pointer or reference in S.
static bool hasPtrOrReferenceInStmt (const Stmt *S, const ValueDecl *Var)
 Return whether Var has a pointer or reference in S.
static bool refersToEnclosingLambdaCaptureByRef (const Decl *Func, const ValueDecl *Var)
bool hasPtrOrReferenceInFunc (const Decl *Func, const ValueDecl *Var)
 Returns whether Var has a pointer or reference in Func.
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.
bool rangeIsEntirelyWithinMacroArgument (SourceRange Range, const SourceManager *SM)
bool rangeContainsMacroExpansion (SourceRange Range, const SourceManager *SM)
bool rangeCanBeFixed (SourceRange Range, const SourceManager *SM)
bool areStatementsIdentical (const Stmt *FirstStmt, const Stmt *SecondStmt, const ASTContext &Context, bool Canonical)
const IndirectFieldDecl * findOutermostIndirectFieldDeclForField (const FieldDecl *FD)
static tok::TokenKind getTokenKind (SourceLocation Loc, const SourceManager &SM, const LangOptions &LangOpts)
static SourceLocation findEndLocation (const Stmt &S, const SourceManager &SM, const LangOptions &LangOpts)
BraceInsertionHints getBraceInsertionsHints (const Stmt *const S, const LangOptions &LangOpts, const SourceManager &SM, SourceLocation StartLoc, SourceLocation EndLocHint=SourceLocation())
 Create fix-it hints for braces that wrap the given statement when applied.
llvm::DenseMap< SourceLocation, std::string > getUnwrittenDesignators (const InitListExpr *Syn)
llvm::DenseMap< clang::SourceLocation, std::string > getUnwrittenDesignators (const clang::InitListExpr *Syn)
 Get designators describing the elements of a (syntactic) init list.
static bool canThrow (const FunctionDecl *Func)
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.
bool isPresumedLocInHeaderFile (SourceLocation Loc, SourceManager &SM, const FileExtensionsSet &HeaderFileExtensions)
 Checks whether presumed location of Loc is in header file.
bool isSpellingLocInHeaderFile (SourceLocation Loc, SourceManager &SM, const FileExtensionsSet &HeaderFileExtensions)
 Checks whether spelling location of Loc is in header file.
bool parseFileExtensions (StringRef AllFileExtensions, FileExtensionsSet &FileExtensions, StringRef Delimiters)
 Parses header file extensions from a semicolon-separated list.
std::optional< StringRef > getFileExtension (StringRef FileName, const FileExtensionsSet &FileExtensions)
 Decides whether a file has a header file extension.
bool isFileExtension (StringRef FileName, const FileExtensionsSet &FileExtensions)
 Decides whether a file has one of the specified file extensions.
StringRef defaultHeaderFileExtensions ()
 Returns recommended default value for the list of header file extensions.
StringRef defaultImplementationFileExtensions ()
 Returns recommended default value for the list of implementation file extensions.
StringRef defaultFileExtensionDelimiters ()
 Returns recommended default value for the list of file extension delimiters.
static bool isRealCharType (const clang::QualType &Ty)
 Is the passed type the actual "char" type, whether that be signed or unsigned, rather than explicit signed char or unsigned char types.
static std::optional< std::string > getCorrespondingSignedTypeName (const clang::QualType &QT)
 If possible, return the text name of the signed type that corresponds to the passed integer type.
static std::optional< std::string > getCorrespondingUnsignedTypeName (const clang::QualType &QT)
 If possible, return the text name of the unsigned type that corresponds to the passed integer type.
static std::optional< std::string > castTypeForArgument (ConversionSpecifier::Kind ArgKind, const clang::QualType &QT)
static bool isMatchingSignedness (ConversionSpecifier::Kind ArgKind, const clang::QualType &ArgType)
static bool castMismatchedIntegerTypes (const CallExpr *Call, bool StrictMode)
static std::string withoutCStrReplacement (const BoundNodes &CStrRemovalMatch, ASTContext &Context)
static std::string cleanPath (StringRef Path)
 canonicalize a path by removing ./ and ../ components.
std::optional< FixItHint > createMainFileIncludeInsertion (llvm::StringRef Header)
 Produces fixes to insert specified includes to source files, if not yet present.
IncludeSorter::IncludeStyle getStyle () const
 IncludeSorter (const SourceManager *SourceMgr, const FileID FileID, StringRef FileName, IncludeStyle Style)
 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.
std::optional< FixItHint > createIncludeInsertion (StringRef FileName, bool IsAngled)
 Creates a quoted inclusion directive in the right sort order.
static bool hasGenerator (const transformer::Generator< std::string > &G)
static void verifyRule (const RewriteRuleWith< std::string > &Rule)
static std::string escapeForDiagnostic (std::string ToEscape)
static std::string getFullPrefix (ArrayRef< UseRangesCheck::Indexes > Signature)
static auto makeExprMatcher (ast_matchers::internal::Matcher< Expr > ArgumentMatcher, ArrayRef< StringRef > MethodNames, ArrayRef< StringRef > FreeNames)
static ast_matchers::internal::Matcher< CallExpr > makeMatcherPair (StringRef State, const UseRangesCheck::Indexes &Indexes, ArrayRef< StringRef > BeginFreeNames, ArrayRef< StringRef > EndFreeNames, const std::optional< UseRangesCheck::ReverseIteratorDescriptor > &ReverseDescriptor)
static void removeFunctionArgs (DiagnosticBuilder &Diag, const CallExpr &Call, ArrayRef< unsigned > Indexes, const ASTContext &Ctx)
static StringRef getUnqualifiedName (StringRef QualifiedName)

Function Documentation

◆ areStatementsIdentical()

◆ canThrow()

bool clang::tidy::utils::canThrow ( const FunctionDecl * Func)
static

Definition at line 325 of file ExceptionAnalyzer.cpp.

◆ capturesByRef()

bool clang::tidy::utils::capturesByRef ( const CXXRecordDecl * RD,
const ValueDecl * Var )
static

Definition at line 24 of file Aliasing.cpp.

Referenced by isPtrOrReferenceForVar(), and refersToEnclosingLambdaCaptureByRef().

◆ castMismatchedIntegerTypes()

bool clang::tidy::utils::castMismatchedIntegerTypes ( const CallExpr * Call,
bool StrictMode )
static

For printf-style functions, the signedness of the type printed is indicated by the corresponding type in the format string. std::print will determine the signedness from the type of the argument. This means that it is necessary to generate a cast in StrictMode to ensure that the exact behaviour is maintained. However, for templated functions like absl::PrintF and fmt::printf, the signedness of the type printed is also taken from the actual argument like std::print, so such casts are never necessary. printf-style functions are variadic, whereas templated ones aren't, so we can use that to distinguish between the two cases.

Definition at line 179 of file FormatStringConverter.cpp.

References FuncDecl.

Referenced by clang::tidy::utils::FormatStringConverter::FormatStringConverter().

◆ castTypeForArgument()

std::optional< std::string > clang::tidy::utils::castTypeForArgument ( ConversionSpecifier::Kind ArgKind,
const clang::QualType & QT )
static

◆ cleanPath()

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

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

Definition at line 18 of file HeaderGuard.cpp.

◆ createIncludeInsertion()

std::optional< FixItHint > clang::tidy::utils::IncludeSorter::createIncludeInsertion ( StringRef FileName,
bool IsAngled )

Creates a quoted inclusion directive in the right sort order.

Returns std::nullopt on error or if header inclusion directive for header already exists.

Definition at line 152 of file IncludeSorter.cpp.

◆ createMainFileIncludeInsertion()

std::optional< FixItHint > clang::tidy::utils::createMainFileIncludeInsertion ( llvm::StringRef Header)

Produces fixes to insert specified includes to source files, if not yet present.

IncludeInserter can be used in clang-tidy checks in the following way: /

/// #include "../ClangTidyCheck.h"
/// #include "../utils/IncludeInserter.h"
///
/// namespace clang {
/// namespace tidy {
///
/// class MyCheck : public ClangTidyCheck {
/// public:
/// void registerPPCallbacks(const SourceManager &SM, Preprocessor *PP,
/// Preprocessor *ModuleExpanderPP) override {
/// Inserter.registerPreprocessor(PP);
/// }
///
/// void registerMatchers(ast_matchers::MatchFinder* Finder) override { ... }
///
/// void check(
/// const ast_matchers::MatchFinder::MatchResult& Result) override {
/// ...
/// Inserter.createMainFileIncludeInsertion("path/to/Header.h");
/// ...
/// }
///
/// private:
/// utils::IncludeInserter Inserter{utils::IncludeSorter::IS_Google};
/// };
/// } // namespace tidy
/// } // namespace clang
///

class IncludeInserter { public: / Initializes the IncludeInserter using the IncludeStyle Style. / In most cases the Style will be retrieved from the ClangTidyOptions / using

/// Options.getLocalOrGlobal("IncludeStyle", <DefaultStyle>)
///

explicit IncludeInserter(IncludeSorter::IncludeStyle Style, bool SelfContainedDiags);

/ Registers this with the Preprocessor PP, must be called before this / class is used. void registerPreprocessor(Preprocessor *PP);

/ Creates a Header inclusion directive fixit in the File FileID. / When Header is enclosed in angle brackets, uses angle brackets in the / inclusion directive, otherwise uses quotes. / Returns std::nullopt on error or if the inclusion directive already / exists. std::optional<FixItHint> createIncludeInsertion(FileID FileID, llvm::StringRef Header);

/ Creates a Header inclusion directive fixit in the main file. / When Header is enclosed in angle brackets, uses angle brackets in the / inclusion directive, otherwise uses quotes. / Returns std::nullopt on error or if the inclusion directive already exists.

References createMainFileIncludeInsertion().

Referenced by createMainFileIncludeInsertion().

◆ defaultFileExtensionDelimiters()

StringRef clang::tidy::utils::defaultFileExtensionDelimiters ( )
inline

Returns recommended default value for the list of file extension delimiters.

Definition at line 45 of file FileExtensionsUtils.h.

◆ defaultHeaderFileExtensions()

StringRef clang::tidy::utils::defaultHeaderFileExtensions ( )
inline

Returns recommended default value for the list of header file extensions.

Definition at line 35 of file FileExtensionsUtils.h.

◆ defaultImplementationFileExtensions()

StringRef clang::tidy::utils::defaultImplementationFileExtensions ( )
inline

Returns recommended default value for the list of implementation file extensions.

Definition at line 39 of file FileExtensionsUtils.h.

◆ escapeForDiagnostic()

std::string clang::tidy::utils::escapeForDiagnostic ( std::string ToEscape)
static

◆ exprHasBitFlagWithSpelling()

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

References exprHasBitFlagWithSpelling().

Referenced by exprHasBitFlagWithSpelling(), and clang::tidy::android::CloexecCheck::insertMacroFlag().

◆ findEndLocation()

SourceLocation clang::tidy::utils::findEndLocation ( const Stmt & S,
const SourceManager & SM,
const LangOptions & LangOpts )
static

◆ findOutermostIndirectFieldDeclForField()

const IndirectFieldDecl * clang::tidy::utils::findOutermostIndirectFieldDeclForField ( const FieldDecl * FD)

Definition at line 117 of file ASTUtils.cpp.

◆ getBraceInsertionsHints()

BraceInsertionHints clang::tidy::utils::getBraceInsertionsHints ( const Stmt *const S,
const LangOptions & LangOpts,
const SourceManager & SM,
SourceLocation StartLoc,
SourceLocation EndLocHint = SourceLocation() )

Create fix-it hints for braces that wrap the given statement when applied.

The algorithm computing them respects comment before and after the statement and adds line breaks before the braces accordingly.

Definition at line 102 of file BracesAroundStatement.cpp.

References findEndLocation(), and getTokenKind().

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

◆ getCorrespondingSignedTypeName()

std::optional< std::string > clang::tidy::utils::getCorrespondingSignedTypeName ( const clang::QualType & QT)
static

If possible, return the text name of the signed type that corresponds to the passed integer type.

If the passed type is already signed then its name is just returned. Only supports BuiltinTypes.

Definition at line 47 of file FormatStringConverter.cpp.

Referenced by castTypeForArgument().

◆ getCorrespondingUnsignedTypeName()

std::optional< std::string > clang::tidy::utils::getCorrespondingUnsignedTypeName ( const clang::QualType & QT)
static

If possible, return the text name of the unsigned type that corresponds to the passed integer type.

If the passed type is already unsigned then its name is just returned. Only supports BuiltinTypes.

Definition at line 99 of file FormatStringConverter.cpp.

Referenced by castTypeForArgument().

◆ getFileExtension()

std::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 56 of file FileExtensionsUtils.cpp.

Referenced by isFileExtension().

◆ getFullPrefix()

std::string clang::tidy::utils::getFullPrefix ( ArrayRef< UseRangesCheck::Indexes > Signature)
static

◆ getParentStmts()

SmallVector< const Stmt *, 1 > clang::tidy::utils::getParentStmts ( const Stmt * S,
ASTContext * Context )
static

◆ getStyle()

IncludeSorter::IncludeStyle clang::tidy::utils::getStyle ( ) const

Definition at line 85 of file IncludeInserter.h.

References getStyle().

Referenced by getStyle().

◆ getSurroundingFunction()

const FunctionDecl * clang::tidy::utils::getSurroundingFunction ( ASTContext & Context,
const Stmt & Statement )

◆ getTokenKind()

tok::TokenKind clang::tidy::utils::getTokenKind ( SourceLocation Loc,
const SourceManager & SM,
const LangOptions & LangOpts )
static

Definition at line 48 of file BracesAroundStatement.cpp.

Referenced by findEndLocation(), and getBraceInsertionsHints().

◆ getUnqualifiedName()

StringRef clang::tidy::utils::getUnqualifiedName ( StringRef QualifiedName)
static

◆ getUnwrittenDesignators() [1/2]

llvm::DenseMap< clang::SourceLocation, std::string > clang::tidy::utils::getUnwrittenDesignators ( const clang::InitListExpr * Syn)

Get designators describing the elements of a (syntactic) init list.

Given for example the type

struct S { int i, j; };

and the definition

S s{1, 2};

calling getUnwrittenDesignators for the initializer list expression {1, 2} would produce the map {loc(1): ".i", loc(2): ".j"}.

It does not produce designators for any explicitly-written nested lists, e.g. {1, .j=2} would only return {loc(1): ".i"}.

It also considers structs with fields of record types like struct T { S s; };. In this case, there would be designators of the form .s.i and .s.j in the returned map.

◆ getUnwrittenDesignators() [2/2]

llvm::DenseMap< SourceLocation, std::string > clang::tidy::utils::getUnwrittenDesignators ( const InitListExpr * Syn)

Definition at line 176 of file DesignatedInitializers.cpp.

◆ hasGenerator()

bool clang::tidy::utils::hasGenerator ( const transformer::Generator< std::string > & G)
static

Definition at line 19 of file TransformerClangTidyCheck.cpp.

Referenced by verifyRule().

◆ hasPtrOrReferenceInFunc()

bool clang::tidy::utils::hasPtrOrReferenceInFunc ( const Decl * Func,
const ValueDecl * Var )

Returns whether Var has a pointer or reference in Func.

Example: void f() { int n; ... int *p = &n; }

For f() and n the function returns true because p is a / pointer to n created in f().

Definition at line 92 of file Aliasing.cpp.

References hasPtrOrReferenceInStmt(), and refersToEnclosingLambdaCaptureByRef().

◆ hasPtrOrReferenceInStmt()

bool clang::tidy::utils::hasPtrOrReferenceInStmt ( const Stmt * S,
const ValueDecl * Var )
static

Return whether Var has a pointer or reference in S.

Definition at line 64 of file Aliasing.cpp.

References hasPtrOrReferenceInStmt(), and isPtrOrReferenceForVar().

Referenced by hasPtrOrReferenceInFunc(), and hasPtrOrReferenceInStmt().

◆ IncludeSorter()

clang::tidy::utils::IncludeSorter::IncludeSorter ( const SourceManager * SourceMgr,
const FileID FileID,
StringRef FileName,
IncludeStyle Style )

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.

class IncludeSorter { public: / Supported include styles. enum IncludeStyle { IS_LLVM = 0, IS_Google = 1, IS_Google_ObjC };

/ The classifications of inclusions, in the order they should be sorted. enum IncludeKinds { IK_MainTUInclude = 0, ///< e.g. #include "foo.h" when editing foo.cc IK_CSystemInclude = 1, ///< e.g. #include <stdio.h> IK_CXXSystemInclude = 2, ///< e.g. #include <vector> IK_NonSystemInclude = 3, ///< e.g. #include "bar.h" IK_GeneratedInclude = 4, ///< e.g. #include "bar.proto.h" IK_InvalidInclude = 5 ///< total number of valid IncludeKinds };

/ IncludeSorter constructor; takes the FileID and name of the file to be processed by the sorter.

Definition at line 123 of file IncludeSorter.cpp.

Referenced by clang::tidy::utils::TransformerClangTidyCheck::TransformerClangTidyCheck(), and clang::tidy::utils::UseRangesCheck::UseRangesCheck().

◆ isAccessForVar()

bool clang::tidy::utils::isAccessForVar ( const Stmt * S,
const ValueDecl * Var )
static

Return whether S is a reference to the declaration of Var.

Definition at line 17 of file Aliasing.cpp.

Referenced by isPtrOrReferenceForVar().

◆ isBinaryOrTernary()

bool clang::tidy::utils::isBinaryOrTernary ( const Expr * E)

Definition at line 25 of file ASTUtils.cpp.

◆ isExpansionLocInHeaderFile()

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 16 of file FileExtensionsUtils.cpp.

References isFileExtension().

◆ isFileExtension()

bool clang::tidy::utils::isFileExtension ( StringRef FileName,
const FileExtensionsSet & FileExtensions )

Decides whether a file has one of the specified file extensions.

Definition at line 66 of file FileExtensionsUtils.cpp.

References getFileExtension().

Referenced by isExpansionLocInHeaderFile(), isPresumedLocInHeaderFile(), isSpellingLocInHeaderFile(), and clang::tidy::misc::UnusedUsingDeclsCheck::registerMatchers().

◆ isMatchingSignedness()

bool clang::tidy::utils::isMatchingSignedness ( ConversionSpecifier::Kind ArgKind,
const clang::QualType & ArgType )
static

Definition at line 157 of file FormatStringConverter.cpp.

◆ isPresumedLocInHeaderFile()

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 22 of file FileExtensionsUtils.cpp.

References isFileExtension().

Referenced by clang::tidy::bugprone::DynamicStaticInitializersCheck::check(), and clang::tidy::google::build::UnnamedNamespaceInHeaderCheck::check().

◆ isPtrOrReferenceForVar()

bool clang::tidy::utils::isPtrOrReferenceForVar ( const Stmt * S,
const ValueDecl * Var )
static

Return whether Var has a pointer or reference in S.

Definition at line 32 of file Aliasing.cpp.

References capturesByRef(), and isAccessForVar().

Referenced by hasPtrOrReferenceInStmt().

◆ isRealCharType()

bool clang::tidy::utils::isRealCharType ( const clang::QualType & Ty)
static

Is the passed type the actual "char" type, whether that be signed or unsigned, rather than explicit signed char or unsigned char types.

Definition at line 34 of file FormatStringConverter.cpp.

◆ isSpellingLocInHeaderFile()

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 28 of file FileExtensionsUtils.cpp.

References isFileExtension().

Referenced by clang::tidy::google::readability::GlobalNamesInHeadersCheck::check(), and clang::tidy::llvm_libc::InlineFunctionDeclCheck::check().

◆ makeExprMatcher()

auto clang::tidy::utils::makeExprMatcher ( ast_matchers::internal::Matcher< Expr > ArgumentMatcher,
ArrayRef< StringRef > MethodNames,
ArrayRef< StringRef > FreeNames )
static

Definition at line 58 of file utils/UseRangesCheck.cpp.

Referenced by makeMatcherPair().

◆ makeMatcherPair()

ast_matchers::internal::Matcher< CallExpr > clang::tidy::utils::makeMatcherPair ( StringRef State,
const UseRangesCheck::Indexes & Indexes,
ArrayRef< StringRef > BeginFreeNames,
ArrayRef< StringRef > EndFreeNames,
const std::optional< UseRangesCheck::ReverseIteratorDescriptor > & ReverseDescriptor )
static

◆ parseFileExtensions()

bool clang::tidy::utils::parseFileExtensions ( StringRef AllFileExtensions,
FileExtensionsSet & FileExtensions,
StringRef Delimiters )

Parses header file extensions from a semicolon-separated list.

Definition at line 34 of file FileExtensionsUtils.cpp.

◆ rangeCanBeFixed()

bool clang::tidy::utils::rangeCanBeFixed ( SourceRange Range,
const SourceManager * SM )

◆ rangeContainsMacroExpansion()

bool clang::tidy::utils::rangeContainsMacroExpansion ( SourceRange Range,
const SourceManager * SM )

Definition at line 81 of file ASTUtils.cpp.

References rangeIsEntirelyWithinMacroArgument().

Referenced by rangeCanBeFixed().

◆ rangeIsEntirelyWithinMacroArgument()

bool clang::tidy::utils::rangeIsEntirelyWithinMacroArgument ( SourceRange Range,
const SourceManager * SM )

Definition at line 65 of file ASTUtils.cpp.

Referenced by rangeCanBeFixed(), and rangeContainsMacroExpansion().

◆ refersToEnclosingLambdaCaptureByRef()

bool clang::tidy::utils::refersToEnclosingLambdaCaptureByRef ( const Decl * Func,
const ValueDecl * Var )
static

Definition at line 79 of file Aliasing.cpp.

References capturesByRef().

Referenced by hasPtrOrReferenceInFunc().

◆ removeFunctionArgs()

void clang::tidy::utils::removeFunctionArgs ( DiagnosticBuilder & Diag,
const CallExpr & Call,
ArrayRef< unsigned > Indexes,
const ASTContext & Ctx )
static

Definition at line 163 of file utils/UseRangesCheck.cpp.

Referenced by clang::tidy::utils::UseRangesCheck::check().

◆ verifyRule()

void clang::tidy::utils::verifyRule ( const RewriteRuleWith< std::string > & Rule)
static

◆ withoutCStrReplacement()

std::string clang::tidy::utils::withoutCStrReplacement ( const BoundNodes & CStrRemovalMatch,
ASTContext & Context )
static