clang-tools  12.0.0git
Namespaces | Enumerations | Functions
AvoidBindCheck.cpp File Reference
#include "AvoidBindCheck.h"
#include "clang/AST/ASTContext.h"
#include "clang/ASTMatchers/ASTMatchFinder.h"
#include "clang/Basic/LLVM.h"
#include "clang/Basic/LangOptions.h"
#include "clang/Basic/SourceLocation.h"
#include "clang/Lex/Lexer.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallSet.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/StringSet.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/FormatVariadic.h"
#include "llvm/Support/Regex.h"
#include "llvm/Support/raw_ostream.h"
#include <algorithm>
#include <cstddef>
#include <string>
Include dependency graph for AvoidBindCheck.cpp:

Go to the source code of this file.

Namespaces

 clang
 ===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//
 
 clang::tidy
 
 clang::tidy::modernize
 

Enumerations

enum  clang::tidy::modernize::@420::BindArgumentKind
 
enum  clang::tidy::modernize::@420::CaptureMode
 
enum  clang::tidy::modernize::@420::CaptureExpr
 
enum  clang::tidy::modernize::@420::CallableType
 
enum  clang::tidy::modernize::@420::CallableMaterializationKind
 

Functions

static bool clang::tidy::modernize::tryCaptureAsLocalVariable (const MatchFinder::MatchResult &Result, BindArgument &B, const Expr *E)
 
static bool clang::tidy::modernize::tryCaptureAsMemberVariable (const MatchFinder::MatchResult &Result, BindArgument &B, const Expr *E)
 
static const Expr * clang::tidy::modernize::ignoreTemporariesAndPointers (const Expr *E)
 
static const Expr * clang::tidy::modernize::ignoreTemporariesAndConstructors (const Expr *E)
 
static StringRef clang::tidy::modernize::getSourceTextForExpr (const MatchFinder::MatchResult &Result, const Expr *E)
 
static bool clang::tidy::modernize::isCallExprNamed (const Expr *E, StringRef Name)
 
static void clang::tidy::modernize::initializeBindArgumentForCallExpr (const MatchFinder::MatchResult &Result, BindArgument &B, const CallExpr *CE, unsigned &CaptureIndex)
 
static bool clang::tidy::modernize::anyDescendantIsLocal (const Stmt *Statement)
 
static SmallVector< BindArgument, 4 > clang::tidy::modernize::buildBindArguments (const MatchFinder::MatchResult &Result, const CallableInfo &Callable)
 
static int clang::tidy::modernize::findPositionOfPlaceholderUse (ArrayRef< BindArgument > Args, size_t PlaceholderIndex)
 
static void clang::tidy::modernize::addPlaceholderArgs (const LambdaProperties &LP, llvm::raw_ostream &Stream, bool PermissiveParameterList)
 
static void clang::tidy::modernize::addFunctionCallArgs (ArrayRef< BindArgument > Args, llvm::raw_ostream &Stream)
 
static bool clang::tidy::modernize::isPlaceHolderIndexRepeated (const ArrayRef< BindArgument > Args)
 
static std::vector< const FunctionDecl * > clang::tidy::modernize::findCandidateCallOperators (const CXXRecordDecl *RecordDecl, size_t NumArgs)
 
static bool clang::tidy::modernize::isFixitSupported (const CallableInfo &Callee, ArrayRef< BindArgument > Args)
 
const FunctionDecl * clang::tidy::modernize::getCallOperator (const CXXRecordDecl *Callable, size_t NumArgs)
 
const FunctionDecl * clang::tidy::modernize::getCallMethodDecl (const MatchFinder::MatchResult &Result, CallableType Type, CallableMaterializationKind Materialization)
 
static CallableType clang::tidy::modernize::getCallableType (const MatchFinder::MatchResult &Result)
 
static CallableMaterializationKind clang::tidy::modernize::getCallableMaterialization (const MatchFinder::MatchResult &Result)
 
static LambdaProperties clang::tidy::modernize::getLambdaProperties (const MatchFinder::MatchResult &Result)
 
static bool clang::tidy::modernize::emitCapture (llvm::StringSet<> &CaptureSet, StringRef Delimiter, CaptureMode CM, CaptureExpr CE, StringRef Identifier, StringRef InitExpression, raw_ostream &Stream)
 
static void clang::tidy::modernize::emitCaptureList (const LambdaProperties &LP, const MatchFinder::MatchResult &Result, raw_ostream &Stream)
 
static ArrayRef< BindArgument > clang::tidy::modernize::getForwardedArgumentList (const LambdaProperties &P)
 

Enumeration Type Documentation

◆ BindArgumentKind

enum clang::tidy::modernize::@420::BindArgumentKind

Definition at line 38 of file AvoidBindCheck.cpp.

◆ CallableMaterializationKind

enum clang::tidy::modernize::@420::CallableMaterializationKind

Definition at line 49 of file AvoidBindCheck.cpp.

◆ CallableType

enum clang::tidy::modernize::@420::CallableType

Definition at line 42 of file AvoidBindCheck.cpp.

◆ CaptureExpr

enum clang::tidy::modernize::@420::CaptureExpr

Definition at line 40 of file AvoidBindCheck.cpp.

◆ CaptureMode

enum clang::tidy::modernize::@420::CaptureMode

Definition at line 39 of file AvoidBindCheck.cpp.

Variable Documentation

◆ BindArguments

SmallVector<BindArgument, 4> BindArguments

Definition at line 105 of file AvoidBindCheck.cpp.

◆ BindNamespace

StringRef BindNamespace

Definition at line 106 of file AvoidBindCheck.cpp.

◆ Callable

CallableInfo Callable

Definition at line 104 of file AvoidBindCheck.cpp.

◆ CaptureIdentifier

std::string CaptureIdentifier

Definition at line 75 of file AvoidBindCheck.cpp.

◆ CaptureInitializer

StringRef CaptureInitializer

Definition at line 99 of file AvoidBindCheck.cpp.

◆ CE

CaptureExpr CE = CE_None

Definition at line 67 of file AvoidBindCheck.cpp.

◆ CM

CaptureMode CM = CM_None

Definition at line 63 of file AvoidBindCheck.cpp.

Referenced by clang::clangd::isInstanceMember().

◆ Decl

const FunctionDecl* Decl = nullptr

◆ E

const Expr* E = nullptr

Definition at line 88 of file AvoidBindCheck.cpp.

Referenced by EntityMap::add(), addModuleDescription(), clang::clangd::ClangdServer::applyTweak(), clang::tidy::readability::AST_MATCHER(), clang::clangd::ParsedAST::build(), clang::tidy::bugprone::checkOverrideByDerivedMethod(), clang::tidy::ClangTidyASTConsumerFactory::ClangTidyASTConsumerFactory(), Modularize::CoverageChecker::collectFileSystemHeaders(), Modularize::CoverageChecker::collectModuleHeaders(), Modularize::ModularizeUtilities::collectModuleMapHeaders(), clang::replace::collectReplacementsFromDirectory(), Modularize::CoverageChecker::collectUmbrellaHeaders(), Modularize::ModularizeUtilities::collectUmbrellaHeaders(), clang::tidy::bugprone::countNonPowOfTwoLiteralNum(), clang::doc::decodeRecord(), findInputFile(), Modularize::CoverageChecker::findUnaccountedForHeaders(), clang::clangd::config::Provider::fromAncestorRelativeYAMLFiles(), clang::doc::genEnumsBlock(), clang::tidy::readability::getConstructExprArgRange(), llvm::DenseMapInfo< clang::clangd::RefSlab::Builder::Entry >::getEmptyKey(), clang::doc::serialize::getInfoRelativePath(), clang::pp_trace::PPCallbacksTracker::getSourceString(), llvm::DenseMapInfo< clang::clangd::RefSlab::Builder::Entry >::getTombstoneKey(), clang::tidy::bugprone::isLikelyTypo(), Modularize::ModularizeUtilities::loadAllHeaderListsAndDependencies(), loadModuleDescriptions(), Modularize::ModularizeUtilities::loadProblemHeaderList(), Modularize::ModularizeUtilities::loadSingleHeaderListsAndDependencies(), clang::doc::serialize::parseEnumerators(), replaceDotDot(), clang::clangd::Tweak::Effect::showMessage(), clang::clangd::IncludeFixer::unresolvedNameRecorder(), clang::doc::serialize::ClangDocCommentVisitor::visitBlockCommandComment(), clang::tidy::readability::FindUsageOfThis::VisitCXXThisExpr(), clang::doc::serialize::ClangDocCommentVisitor::visitHTMLStartTagComment(), and clang::doc::serialize::ClangDocCommentVisitor::visitInlineCommandComment().

◆ IsFixitSupported

bool IsFixitSupported = false

Definition at line 107 of file AvoidBindCheck.cpp.

◆ IsUsed

bool IsUsed = false

Definition at line 85 of file AvoidBindCheck.cpp.

◆ Kind

BindArgumentKind Kind = BK_Other

◆ Materialization

CallableMaterializationKind Materialization = CMK_Other

Definition at line 93 of file AvoidBindCheck.cpp.

◆ PlaceHolderIndex

size_t PlaceHolderIndex = 0

Definition at line 82 of file AvoidBindCheck.cpp.

◆ SourceTokens

StringRef SourceTokens

Definition at line 70 of file AvoidBindCheck.cpp.

◆ Type

CallableType Type = CT_Other

Definition at line 92 of file AvoidBindCheck.cpp.

◆ UsageIdentifier

std::string UsageIdentifier

Definition at line 79 of file AvoidBindCheck.cpp.