clang-tools 22.0.0git
UnnecessaryCopyInitialization.cpp File Reference
#include "UnnecessaryCopyInitialization.h"
#include "../utils/DeclRefExprUtils.h"
#include "../utils/FixItHintUtils.h"
#include "../utils/LexerUtils.h"
#include "../utils/Matchers.h"
#include "../utils/OptionsUtils.h"
#include "clang/AST/Decl.h"
#include "clang/Basic/Diagnostic.h"
#include <optional>

Go to the source code of this file.

Namespaces

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

Functions

static void clang::tidy::performance::recordFixes (const VarDecl &Var, ASTContext &Context, DiagnosticBuilder &Diagnostic)
static std::optional< SourceLocation > clang::tidy::performance::firstLocAfterNewLine (SourceLocation Loc, SourceManager &SM)
static void clang::tidy::performance::recordRemoval (const DeclStmt &Stmt, ASTContext &Context, DiagnosticBuilder &Diagnostic)
static bool clang::tidy::performance::isInitializingVariableImmutable (const VarDecl &InitializingVar, const Stmt &BlockStmt, ASTContext &Context, const std::vector< StringRef > &ExcludedContainerTypes)
static bool clang::tidy::performance::isVariableUnused (const VarDecl &Var, const Stmt &BlockStmt, ASTContext &Context)
static const SubstTemplateTypeParmType * clang::tidy::performance::getSubstitutedType (const QualType &Type, ASTContext &Context)
static bool clang::tidy::performance::differentReplacedTemplateParams (const QualType &VarType, const QualType &InitializerType, ASTContext &Context)
static QualType clang::tidy::performance::constructorArgumentType (const VarDecl *OldVar, const BoundNodes &Nodes)
SmallPtrSet< const DeclRefExpr *, 16 > clang::tidy::performance::allDeclRefExprs (const VarDecl &VarDecl, const Stmt &Stmt, ASTContext &Context)
 Returns set of all DeclRefExprs to VarDecl within Stmt.
bool clang::tidy::performance::isOnlyUsedAsConst (const VarDecl &Var, const Stmt &Stmt, ASTContext &Context, int Indirections)
 Returns true if all DeclRefExpr to the variable within Stmt do not modify it. See constReferenceDeclRefExprs for the meaning of Indirections.

Variables

static constexpr StringRef clang::tidy::performance::ObjectArgId = "objectArg"
static constexpr StringRef clang::tidy::performance::InitFunctionCallId = "initFunctionCall"
static constexpr StringRef clang::tidy::performance::MethodDeclId = "methodDecl"
static constexpr StringRef clang::tidy::performance::FunctionDeclId = "functionDecl"
static constexpr StringRef clang::tidy::performance::OldVarDeclId = "oldVarDecl"