clang-tools  16.0.0git
Namespaces
ExtractFunction.cpp File Reference
#include "AST.h"
#include "FindTarget.h"
#include "ParsedAST.h"
#include "Selection.h"
#include "SourceCode.h"
#include "refactor/Tweak.h"
#include "support/Logger.h"
#include "clang/AST/ASTContext.h"
#include "clang/AST/Decl.h"
#include "clang/AST/DeclBase.h"
#include "clang/AST/NestedNameSpecifier.h"
#include "clang/AST/RecursiveASTVisitor.h"
#include "clang/AST/Stmt.h"
#include "clang/Basic/LangOptions.h"
#include "clang/Basic/SourceLocation.h"
#include "clang/Basic/SourceManager.h"
#include "clang/Tooling/Core/Replacement.h"
#include "clang/Tooling/Refactoring/Extract/SourceExtraction.h"
#include "llvm/ADT/None.h"
#include "llvm/ADT/Optional.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallSet.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/Error.h"
#include "llvm/Support/raw_os_ostream.h"
Include dependency graph for ExtractFunction.cpp:

Go to the source code of this file.

Namespaces

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

Variable Documentation

◆ AlwaysReturns

bool AlwaysReturns = false

Definition at line 517 of file ExtractFunction.cpp.

◆ BodyRange

SourceRange BodyRange

Definition at line 350 of file ExtractFunction.cpp.

◆ BrokenControlFlow

bool BrokenControlFlow = false

Definition at line 520 of file ExtractFunction.cpp.

◆ CallerReturnsValue

bool CallerReturnsValue = false

Definition at line 358 of file ExtractFunction.cpp.

◆ Const

bool Const = false

Definition at line 361 of file ExtractFunction.cpp.

◆ Constexpr

ConstexprSpecKind Constexpr = ConstexprSpecKind::Unspecified

Definition at line 360 of file ExtractFunction.cpp.

◆ DeclaredIn

ZoneRelative DeclaredIn

Definition at line 502 of file ExtractFunction.cpp.

◆ DeclIndex

unsigned DeclIndex

Definition at line 504 of file ExtractFunction.cpp.

◆ DeclInfoMap

llvm::DenseMap<const Decl *, DeclInformation> DeclInfoMap

Definition at line 515 of file ExtractFunction.cpp.

◆ DefinitionPoint

SourceLocation DefinitionPoint

Definition at line 351 of file ExtractFunction.cpp.

◆ DefinitionQualifier

const NestedNameSpecifier* DefinitionQualifier = nullptr

Definition at line 354 of file ExtractFunction.cpp.

◆ EnclosingClass

const CXXRecordDecl* EnclosingClass = nullptr

Definition at line 353 of file ExtractFunction.cpp.

◆ EnclosingFuncRange

SourceRange EnclosingFuncRange

Definition at line 163 of file ExtractFunction.cpp.

◆ EnclosingFunction

const FunctionDecl* EnclosingFunction = nullptr

Definition at line 161 of file ExtractFunction.cpp.

◆ ForwardDeclarationPoint

llvm::Optional<SourceLocation> ForwardDeclarationPoint

Definition at line 352 of file ExtractFunction.cpp.

◆ ForwardDeclarationSyntacticDC

const DeclContext* ForwardDeclarationSyntacticDC = nullptr

Definition at line 357 of file ExtractFunction.cpp.

◆ HasReturnStmt

bool HasReturnStmt = false

Definition at line 516 of file ExtractFunction.cpp.

◆ IsReferencedInPostZone

bool IsReferencedInPostZone = false

Definition at line 506 of file ExtractFunction.cpp.

◆ IsReferencedInZone

bool IsReferencedInZone = false

Definition at line 505 of file ExtractFunction.cpp.

◆ LangOpts

const LangOptions* LangOpts

Definition at line 366 of file ExtractFunction.cpp.

Referenced by clang::clangd::adjustRenameRanges(), clang::tidy::modernize::alreadyConcatenated(), clang::clangd::collectIdentifierRanges(), clang::tidy::google::findToken(), clang::tidy::bugprone::getDoubleUnderscoreFixup(), clang::clangd::getEligiblePoints(), clang::tidy::bugprone::getFailureInfoImpl(), clang::tidy::readability::getLocationOfConst(), clang::tidy::readability::getStringFromRange(), clang::tidy::modernize::getStringFromRange(), clang::tidy::bugprone::hasReservedDoubleUnderscore(), clang::clangd::isBuiltinDiagnosticSuppressed(), clang::clangd::isHeaderFile(), clang::clangd::isKeyword(), clang::tidy::modernize::UseAutoCheck::isLanguageVersionSupported(), clang::tidy::modernize::UseNullptrCheck::isLanguageVersionSupported(), clang::tidy::modernize::UseOverrideCheck::isLanguageVersionSupported(), clang::tidy::readability::RedundantStringCStrCheck::isLanguageVersionSupported(), clang::tidy::modernize::LoopConvertCheck::isLanguageVersionSupported(), clang::tidy::misc::UnusedAliasDeclsCheck::isLanguageVersionSupported(), clang::tidy::modernize::PassByValueCheck::isLanguageVersionSupported(), clang::tidy::readability::RedundantStringInitCheck::isLanguageVersionSupported(), clang::tidy::modernize::ConcatNestedNamespacesCheck::isLanguageVersionSupported(), clang::tidy::performance::NoAutomaticMoveCheck::isLanguageVersionSupported(), clang::tidy::performance::ForRangeCopyCheck::isLanguageVersionSupported(), clang::tidy::modernize::UseBoolLiteralsCheck::isLanguageVersionSupported(), clang::tidy::modernize::UseTransparentFunctorsCheck::isLanguageVersionSupported(), clang::tidy::readability::ImplicitBoolConversionCheck::isLanguageVersionSupported(), clang::tidy::performance::ImplicitConversionInLoopCheck::isLanguageVersionSupported(), clang::tidy::readability::SimplifySubscriptExprCheck::isLanguageVersionSupported(), clang::tidy::bugprone::StringConstructorCheck::isLanguageVersionSupported(), clang::tidy::cert::ThrownExceptionTypeCheck::isLanguageVersionSupported(), clang::tidy::bugprone::UnusedRaiiCheck::isLanguageVersionSupported(), clang::tidy::modernize::AvoidCArraysCheck::isLanguageVersionSupported(), clang::tidy::cppcoreguidelines::PreferMemberInitializerCheck::isLanguageVersionSupported(), clang::tidy::cppcoreguidelines::ProBoundsArrayToPointerDecayCheck::isLanguageVersionSupported(), clang::tidy::cppcoreguidelines::ProTypeConstCastCheck::isLanguageVersionSupported(), clang::tidy::cert::VariadicFunctionDefCheck::isLanguageVersionSupported(), clang::tidy::cppcoreguidelines::ProTypeReinterpretCastCheck::isLanguageVersionSupported(), clang::tidy::abseil::DurationDivisionCheck::isLanguageVersionSupported(), clang::tidy::readability::MakeMemberFunctionConstCheck::isLanguageVersionSupported(), clang::tidy::cert::SetLongJmpCheck::isLanguageVersionSupported(), clang::tidy::hicpp::ExceptionBaseclassCheck::isLanguageVersionSupported(), clang::tidy::bugprone::SmartPtrArrayMismatchCheck::isLanguageVersionSupported(), clang::tidy::performance::MoveConstructorInitCheck::isLanguageVersionSupported(), clang::tidy::fuchsia::MultipleInheritanceCheck::isLanguageVersionSupported(), clang::tidy::bugprone::StringIntegerAssignmentCheck::isLanguageVersionSupported(), clang::tidy::llvm_libc::CalleeNamespaceCheck::isLanguageVersionSupported(), clang::tidy::abseil::NoInternalDependenciesCheck::isLanguageVersionSupported(), clang::tidy::modernize::UnaryStaticAssertCheck::isLanguageVersionSupported(), clang::tidy::abseil::NoNamespaceCheck::isLanguageVersionSupported(), clang::tidy::bugprone::UndelegatedConstructorCheck::isLanguageVersionSupported(), clang::tidy::abseil::FasterStrsplitDelimiterCheck::isLanguageVersionSupported(), clang::tidy::cert::NonTrivialTypesLibcMemoryCallsCheck::isLanguageVersionSupported(), clang::tidy::objc::NSDateFormatterCheck::isLanguageVersionSupported(), clang::tidy::bugprone::CopyConstructorInitCheck::isLanguageVersionSupported(), clang::tidy::bugprone::UseAfterMoveCheck::isLanguageVersionSupported(), clang::tidy::google::UpgradeGoogletestCaseCheck::isLanguageVersionSupported(), clang::tidy::modernize::UseDefaultMemberInitCheck::isLanguageVersionSupported(), clang::tidy::cert::DefaultOperatorNewAlignmentCheck::isLanguageVersionSupported(), clang::tidy::cert::PostfixOperatorCheck::isLanguageVersionSupported(), clang::tidy::bugprone::UnhandledExceptionAtNewCheck::isLanguageVersionSupported(), clang::tidy::llvm_libc::ImplementationInNamespaceCheck::isLanguageVersionSupported(), clang::tidy::cppcoreguidelines::ProTypeCstyleCastCheck::isLanguageVersionSupported(), clang::tidy::cppcoreguidelines::ProTypeStaticCastDowncastCheck::isLanguageVersionSupported(), clang::tidy::cppcoreguidelines::ProTypeUnionAccessCheck::isLanguageVersionSupported(), clang::tidy::cppcoreguidelines::ProTypeVarargCheck::isLanguageVersionSupported(), clang::tidy::modernize::DeprecatedIosBaseAliasesCheck::isLanguageVersionSupported(), clang::tidy::performance::InefficientAlgorithmCheck::isLanguageVersionSupported(), clang::tidy::cppcoreguidelines::AvoidConstOrRefDataMembersCheck::isLanguageVersionSupported(), clang::tidy::cppcoreguidelines::AvoidGotoCheck::isLanguageVersionSupported(), clang::tidy::cert::DontModifyStdNamespaceCheck::isLanguageVersionSupported(), clang::tidy::modernize::AvoidBindCheck::isLanguageVersionSupported(), clang::tidy::objc::AvoidNSErrorInitCheck::isLanguageVersionSupported(), clang::tidy::modernize::ReturnBracedInitListCheck::isLanguageVersionSupported(), clang::tidy::objc::MissingHashCheck::isLanguageVersionSupported(), clang::tidy::openmp::ExceptionEscapeCheck::isLanguageVersionSupported(), clang::tidy::cert::MutatingCopyCheck::isLanguageVersionSupported(), clang::tidy::abseil::StrCatAppendCheck::isLanguageVersionSupported(), clang::tidy::readability::NamespaceCommentCheck::isLanguageVersionSupported(), clang::tidy::readability::StringCompareCheck::isLanguageVersionSupported(), clang::tidy::abseil::StringFindStrContainsCheck::isLanguageVersionSupported(), clang::tidy::objc::SuperSelfCheck::isLanguageVersionSupported(), clang::tidy::bugprone::ThrowKeywordMissingCheck::isLanguageVersionSupported(), clang::tidy::fuchsia::TrailingReturnCheck::isLanguageVersionSupported(), clang::tidy::fuchsia::StaticallyConstructedObjectsCheck::isLanguageVersionSupported(), clang::tidy::bugprone::UnhandledSelfAssignmentCheck::isLanguageVersionSupported(), clang::tidy::objc::ForbiddenSubclassingCheck::isLanguageVersionSupported(), clang::tidy::performance::UnnecessaryValueParamCheck::isLanguageVersionSupported(), clang::tidy::readability::UseAnyOfAllOfCheck::isLanguageVersionSupported(), clang::tidy::objc::NSInvocationArgumentLifetimeCheck::isLanguageVersionSupported(), clang::tidy::objc::DeallocInCategoryCheck::isLanguageVersionSupported(), clang::tidy::objc::AssertEquals::isLanguageVersionSupported(), clang::tidy::modernize::UseUncaughtExceptionsCheck::isLanguageVersionSupported(), clang::tidy::abseil::CleanupCtadCheck::isLanguageVersionSupported(), clang::tidy::openmp::UseDefaultNoneCheck::isLanguageVersionSupported(), clang::tidy::performance::InefficientStringConcatenationCheck::isLanguageVersionSupported(), clang::tidy::readability::RedundantAccessSpecifiersCheck::isLanguageVersionSupported(), clang::tidy::boost::UseToStringCheck::isLanguageVersionSupported(), clang::tidy::modernize::ShrinkToFitCheck::isLanguageVersionSupported(), clang::tidy::portability::SIMDIntrinsicsCheck::isLanguageVersionSupported(), clang::tidy::bugprone::NoEscapeCheck::isLanguageVersionSupported(), clang::tidy::cppcoreguidelines::SpecialMemberFunctionsCheck::isLanguageVersionSupported(), clang::tidy::misc::StaticAssertCheck::isLanguageVersionSupported(), clang::tidy::misc::NewDeleteOverloadsCheck::isLanguageVersionSupported(), clang::tidy::google::ExplicitConstructorCheck::isLanguageVersionSupported(), clang::tidy::google::objc::AvoidThrowingObjCExceptionCheck::isLanguageVersionSupported(), clang::tidy::performance::NoexceptMoveConstructorCheck::isLanguageVersionSupported(), clang::tidy::cppcoreguidelines::VirtualClassDestructorCheck::isLanguageVersionSupported(), clang::tidy::bugprone::InaccurateEraseCheck::isLanguageVersionSupported(), clang::tidy::readability::QualifiedAutoCheck::isLanguageVersionSupported(), clang::tidy::performance::InefficientVectorOperationCheck::isLanguageVersionSupported(), clang::tidy::google::objc::AvoidNSObjectNewCheck::isLanguageVersionSupported(), clang::tidy::modernize::ReplaceRandomShuffleCheck::isLanguageVersionSupported(), clang::tidy::abseil::UpgradeDurationConversionsCheck::isLanguageVersionSupported(), clang::tidy::google::objc::GlobalVariableDeclarationCheck::isLanguageVersionSupported(), clang::tidy::readability::RedundantMemberInitCheck::isLanguageVersionSupported(), clang::tidy::bugprone::UncheckedOptionalAccessCheck::isLanguageVersionSupported(), clang::tidy::bugprone::ExceptionEscapeCheck::isLanguageVersionSupported(), clang::tidy::bugprone::VirtualNearMissCheck::isLanguageVersionSupported(), clang::tidy::misc::ConstCorrectnessCheck::isLanguageVersionSupported(), clang::tidy::performance::FasterStringFindCheck::isLanguageVersionSupported(), clang::tidy::performance::UnnecessaryCopyInitialization::isLanguageVersionSupported(), clang::tidy::modernize::UseEmplaceCheck::isLanguageVersionSupported(), clang::tidy::objc::PropertyDeclarationCheck::isLanguageVersionSupported(), clang::tidy::abseil::RedundantStrcatCallsCheck::isLanguageVersionSupported(), clang::tidy::cppcoreguidelines::ProBoundsConstantArrayIndexCheck::isLanguageVersionSupported(), clang::tidy::modernize::RawStringLiteralCheck::isLanguageVersionSupported(), clang::tidy::google::runtime::OverloadedUnaryAndCheck::isLanguageVersionSupported(), clang::tidy::bugprone::DynamicStaticInitializersCheck::isLanguageVersionSupported(), clang::tidy::bugprone::SignalHandlerCheck::isLanguageVersionSupported(), clang::tidy::readability::ContainerSizeEmptyCheck::isLanguageVersionSupported(), clang::tidy::google::build::ExplicitMakePairCheck::isLanguageVersionSupported(), clang::tidy::performance::TriviallyDestructibleCheck::isLanguageVersionSupported(), clang::tidy::misc::ThrowByValueCatchByReferenceCheck::isLanguageVersionSupported(), clang::tidy::readability::RedundantSmartptrGetCheck::isLanguageVersionSupported(), clang::tidy::misc::UnconventionalAssignOperatorCheck::isLanguageVersionSupported(), clang::tidy::modernize::UseTrailingReturnTypeCheck::isLanguageVersionSupported(), clang::tidy::cppcoreguidelines::OwningMemoryCheck::isLanguageVersionSupported(), clang::tidy::bugprone::ForwardingReferenceOverloadCheck::isLanguageVersionSupported(), clang::tidy::performance::MoveConstArgCheck::isLanguageVersionSupported(), clang::tidy::google::objc::FunctionNamingCheck::isLanguageVersionSupported(), clang::tidy::cppcoreguidelines::MacroUsageCheck::isLanguageVersionSupported(), clang::tidy::misc::NonPrivateMemberVariablesInClassesCheck::isLanguageVersionSupported(), clang::tidy::modernize::UseUsingCheck::isLanguageVersionSupported(), clang::tidy::google::runtime::IntegerTypesCheck::isLanguageVersionSupported(), clang::tidy::cppcoreguidelines::NoMallocCheck::isLanguageVersionSupported(), clang::tidy::modernize::MakeUniqueCheck::isLanguageVersionSupported(), clang::tidy::misc::UniqueptrResetReleaseCheck::isLanguageVersionSupported(), clang::tidy::modernize::UseNoexceptCheck::isLanguageVersionSupported(), clang::tidy::modernize::RedundantVoidArgCheck::isLanguageVersionSupported(), clang::tidy::cppcoreguidelines::ProTypeMemberInitCheck::isLanguageVersionSupported(), clang::tidy::misc::DefinitionsInHeadersCheck::isLanguageVersionSupported(), clang::tidy::modernize::DeprecatedHeadersCheck::isLanguageVersionSupported(), clang::tidy::google::build::UnnamedNamespaceInHeaderCheck::isLanguageVersionSupported(), clang::tidy::bugprone::MoveForwardingReferenceCheck::isLanguageVersionSupported(), clang::tidy::bugprone::StringviewNullptrCheck::isLanguageVersionSupported(), clang::tidy::modernize::UseEqualsDefaultCheck::isLanguageVersionSupported(), clang::tidy::google::build::UsingNamespaceDirectiveCheck::isLanguageVersionSupported(), clang::tidy::modernize::UseEqualsDeleteCheck::isLanguageVersionSupported(), clang::tidy::modernize::MakeSmartPtrCheck::isLanguageVersionSupported(), clang::tidy::modernize::ReplaceDisallowCopyAndAssignMacroCheck::isLanguageVersionSupported(), clang::tidy::modernize::ReplaceAutoPtrCheck::isLanguageVersionSupported(), clang::tidy::llvm_check::PreferIsaOrDynCastInConditionalsCheck::isLanguageVersionSupported(), and clang::clangd::visibleNamespaces().

◆ Name

std::string Name = "extracted"

Definition at line 338 of file ExtractFunction.cpp.

◆ OrderPriority

unsigned OrderPriority

Definition at line 341 of file ExtractFunction.cpp.

◆ Parameters

std::vector<Parameter> Parameters

Definition at line 349 of file ExtractFunction.cpp.

◆ Parent

const Node* Parent = nullptr

◆ PassByReference

bool PassByReference

Definition at line 340 of file ExtractFunction.cpp.

◆ ReturnType

QualType ReturnType

Definition at line 348 of file ExtractFunction.cpp.

◆ RootStmts

llvm::DenseSet<const Stmt *> RootStmts

Definition at line 165 of file ExtractFunction.cpp.

◆ SemanticDC

const DeclContext* SemanticDC = nullptr

Definition at line 355 of file ExtractFunction.cpp.

◆ SemicolonPolicy

tooling::ExtractionSemicolonPolicy SemicolonPolicy

Definition at line 365 of file ExtractFunction.cpp.

◆ Static

bool Static = false

◆ SyntacticDC

const DeclContext* SyntacticDC = nullptr

Definition at line 356 of file ExtractFunction.cpp.

◆ TheDecl

const Decl* TheDecl

Definition at line 501 of file ExtractFunction.cpp.

◆ TypeInfo

QualType TypeInfo

Definition at line 339 of file ExtractFunction.cpp.

Referenced by clang::doc::serialize::emitInfo().

◆ ZoneRange

SourceRange ZoneRange

Definition at line 159 of file ExtractFunction.cpp.