clang 19.0.0git
Classes | Namespaces | Functions
ASTDiff.cpp File Reference
#include "clang/Tooling/ASTDiff/ASTDiff.h"
#include "clang/AST/ParentMapContext.h"
#include "clang/AST/RecursiveASTVisitor.h"
#include "clang/Basic/SourceManager.h"
#include "clang/Lex/Lexer.h"
#include "llvm/ADT/PriorityQueue.h"
#include <limits>
#include <memory>
#include <optional>
#include <unordered_set>

Go to the source code of this file.

Classes

class  clang::diff::ASTDiff::Impl
 
class  clang::diff::SyntaxTree::Impl
 Represents the AST of a TranslationUnit. More...
 
struct  clang::diff::SNodeId
 Identifies a node in a subtree by its postorder offset, starting at 1. More...
 
class  clang::diff::Subtree
 
class  clang::diff::ZhangShashaMatcher
 Implementation of Zhang and Shasha's Algorithm for tree edit distance. More...
 

Namespaces

namespace  clang
 The JSON file list parser is used to communicate input to InstallAPI.
 
namespace  clang::diff
 

Functions

static bool clang::diff::isSpecializedNodeExcluded (const Decl *D)
 
static bool clang::diff::isSpecializedNodeExcluded (const Stmt *S)
 
static bool clang::diff::isSpecializedNodeExcluded (CXXCtorInitializer *I)
 
template<class T >
static bool clang::diff::isNodeExcluded (const SourceManager &SrcMgr, T *N)
 
static std::vector< NodeId > clang::diff::getSubtreePostorder (const SyntaxTree::Impl &Tree, NodeId Root)
 
static std::vector< NodeId > clang::diff::getSubtreeBfs (const SyntaxTree::Impl &Tree, NodeId Root)
 
static const DeclContextclang::diff::getEnclosingDeclContext (ASTContext &AST, const Stmt *S)
 
static std::string clang::diff::getInitializerValue (const CXXCtorInitializer *Init, const PrintingPolicy &TypePP)
 

Variable Documentation

◆ Depth

int Depth = 0

Definition at line 190 of file ASTDiff.cpp.

◆ Id

int Id = 0

Definition at line 190 of file ASTDiff.cpp.

Referenced by clang::Sema::ActOnEnumConstant(), clang::Sema::ActOnIdExpression(), clang::Sema::actOnLambdaInitCaptureInitialization(), clang::Sema::ActOnMemberAccessExpr(), clang::Sema::ActOnOpenMPIdExpression(), clang::Sema::ActOnTagTemplateIdType(), clang::LambdaIntroducer::addCapture(), clang::driver::types::appendSuffixForType(), argumentDependentLookup(), ArmBuiltinAliasValid(), clang::Sema::BuildBuiltinCallExpr(), buildCaptureDecl(), clang::Sema::buildLambdaInitCaptureInitialization(), clang::Sema::BuildObjCExceptionDecl(), clang::driver::types::canLipoType(), clang::driver::types::canTypeBeUserSpecified(), checkConfigMacro(), clang::Sema::CheckEnumConstant(), clang::Sema::CodeCompleteAfterFunctionEquals(), clang::Sema::CodeCompleteObjCMethodDecl(), TypeInfo::PhasesBitSet::contains(), clang::NamespaceDecl::Create(), clang::ObjCCategoryImplDecl::Create(), clang::OMPCapturedExprDecl::Create(), clang::ObjCProtocolDecl::Create(), clang::ObjCCategoryDecl::Create(), clang::BindingDecl::Create(), clang::ImplicitParamDecl::Create(), clang::ObjCCompatibleAliasDecl::Create(), clang::IndirectFieldDecl::Create(), clang::ObjCPropertyDecl::Create(), clang::VarDecl::Create(), clang::EnumDecl::Create(), clang::ObjCAtDefsFieldDecl::Create(), clang::ParmVarDecl::Create(), clang::TypedefDecl::Create(), clang::TypeAliasDecl::Create(), clang::EnumConstantDecl::Create(), clang::ObjCIvarDecl::Create(), clang::ObjCInterfaceDecl::Create(), clang::TemplateTypeParmDecl::Create(), clang::TemplateTemplateParmDecl::Create(), clang::FieldDecl::Create(), clang::NonTypeTemplateParmDecl::Create(), clang::CXXRecordDecl::Create(), clang::RecordDecl::Create(), clang::Sema::createLambdaInitCaptureVarDecl(), clang::ento::ExplodedGraph::createUncachedNode(), clang::Sema::DecomposeUnqualifiedId(), clang::HeaderMapImpl::dump(), clang::ento::ExplodedNode::ExplodedNode(), clang::transformer::expression(), clang::diff::SyntaxTree::findPositionInParent(), clang::diff::SyntaxTree::Impl::findPositionInParent(), clang::ObjCImplDecl::FindPropertyImplDecl(), formatModuleId(), clang::MangleContext::getAnonymousStructId(), GetAssumedMessageSendExprType(), clang::ASTContext::GetBuiltinType(), clang::driver::types::getCompilationPhases(), clang::driver::InputAction::getId(), clang::ento::ExplodedNode::getID(), clang::diff::Subtree::getIdInRoot(), clang::ObjCContainerDecl::getIvarDecl(), clang::getLastArgIntValue(), clang::getLastArgUInt64Value(), clang::diff::Subtree::getLeftMostDescendant(), clang::diff::ASTDiff::Impl::getMapped(), clang::diff::ASTDiff::getMapped(), clang::diff::SyntaxTree::Impl::getMutableNode(), getNode(), clang::diff::SyntaxTree::getNode(), clang::diff::SyntaxTree::Impl::getNode(), clang::diff::Subtree::getNode(), clang::diff::SyntaxTree::getNodeValue(), clang::diff::SyntaxTree::Impl::getNodeValue(), clang::diff::Subtree::getNodeValue(), clang::diff::SyntaxTree::Impl::getNumberOfDescendants(), clang::Sema::getObjCInterfaceDecl(), clang::CodeCompletionResult::getOrderedName(), clang::driver::phases::getPhaseName(), clang::driver::types::getPrecompiledType(), clang::driver::types::getPreprocessedType(), clang::ObjCContainerDecl::getProperty(), clang::diff::getSubtreePostorder(), clang::Sema::getTemplateArgumentBindingsText(), clang::driver::types::getTypeName(), clang::driver::types::getTypeTempSuffix(), clang::transformer::ifBound(), clang::Sema::Initialize(), clang::driver::types::isAcceptedByClang(), clang::driver::types::isAcceptedByFlang(), clang::driver::types::isCuda(), clang::driver::types::isCXX(), clang::driver::types::isDerivedFromC(), clang::driver::types::isHIP(), clang::driver::types::isHLSL(), clang::diff::SyntaxTree::Impl::isInSubtree(), clang::driver::types::isLLVMIR(), clang::Preprocessor::isMacroDefined(), clang::NSAPI::isMacroDefined(), clang::driver::types::isObjC(), clang::driver::types::isOpenCL(), isPreprocessedHeaderUnitType(), isPreprocessedModuleType(), clang::driver::types::isSrcFile(), clang::diff::SyntaxTree::Impl::isValidNodeId(), clang::driver::types::lookupCXXTypeForCType(), clang::driver::types::lookupHeaderTypeForSourceType(), clang::Sema::LookupInlineAsmIdentifier(), clang::Sema::lookupOpenMPDeclareTargetName(), clang::driver::types::lookupTypeForTypeSpecifier(), clang::MacroPPCallbacks::MacroDefined(), clang::MacroPPCallbacks::MacroUndefined(), clang::transformer::notBoundError(), clang::driver::types::onlyPrecompileType(), clang::diff::SNodeId::operator int(), clang::diff::SNodeId::operator+(), clang::diff::SNodeId::operator++(), clang::diff::SNodeId::operator--(), parseId(), clang::Parser::ParseMSAsmIdentifier(), parseRangeSelectorImpl(), parseStringId(), clang::Parser::ParseUnqualifiedId(), TypeInfo::PhasesBitSet::PhasesBitSet(), clang::Module::print(), printNode(), clang::Sema::ProcessPragmaWeak(), clang::ento::mpi::Request::Profile(), clang::ASTReader::ReadAST(), clang::TreeTransform< Derived >::RebuildDependentNameType(), clang::TreeTransform< Derived >::RebuildExceptionDecl(), RegisterBuiltinMacro(), clang::driver::InputAction::setId(), clang::UnqualifiedId::setIdentifier(), clang::Declarator::SetIdentifier(), clang::UnqualifiedId::setImplicitSelfParam(), clang::UnqualifiedId::setLiteralOperatorId(), clang::CodeGen::CodeGenModule::SetLLVMFunctionAttributesForDefinition(), clang::SarifResult::setRuleId(), and clang::SarifRule::setRuleId().

◆ Parent

NodeId Parent

Definition at line 191 of file ASTDiff.cpp.

Referenced by clang::Sema::ActOnFinishLinkageSpecification(), clang::Sema::ActOnFunctionDeclarator(), clang::Sema::ActOnStartNamespaceDef(), clang::extractapi::APISet::addClassTemplate(), clang::extractapi::APISet::addClassTemplatePartialSpecialization(), clang::extractapi::APISet::addClassTemplateSpecialization(), clang::extractapi::APISet::addCXXClass(), clang::extractapi::APISet::addCXXFieldTemplate(), clang::extractapi::APISet::addCXXMethodTemplate(), clang::extractapi::APISet::addCXXMethodTemplateSpec(), clang::interp::VariableScope< Emitter >::addExtended(), clang::interp::ExprScope< Emitter >::addExtended(), clang::format::MacroCallReconstructor::addLine(), clang::interp::VariableScope< Emitter >::addLocal(), clang::extractapi::APISet::addNamespace(), adjustParent(), clang::ast_matchers::AST_MATCHER_P(), clang::Sema::BuildBuiltinOffsetOf(), clang::ento::RetainSummaryManager::canEval(), clang::ModuleMap::canonicalizeModuleMapPath(), clang::CFGBlock::CFGBlock(), checkDuplicateDefaultInit(), clang::interp::InterpState::checkingForUndefinedBehavior(), clang::interp::InterpState::checkingPotentialConstantExpression(), clang::DependentDiagnostic::Create(), clang::ConstructionContextLayer::create(), clang::Sema::CreateBuiltin(), clang::ModuleMap::createGlobalModuleFragmentForModuleUnit(), clang::ModuleMap::createImplicitGlobalModuleFragmentForModuleUnit(), clang::CodeGen::CGDebugInfo::CreateMacro(), clang::ModuleMap::createPrivateModuleFragmentForInterfaceUnit(), clang::CodeGen::CGDebugInfo::CreateTempMacroFile(), clang::sema::DelayedDiagnosticPool::DelayedDiagnosticPool(), clang::Scope::dumpImpl(), clang::sema::DelayedDiagnosticPool::empty(), clang::interp::Context::evaluate(), clang::interp::Context::evaluateAsInitializer(), clang::interp::Context::evaluateAsRValue(), clang::ModuleMap::findOrCreateModule(), clang::diff::SyntaxTree::Impl::findPositionInParent(), clang::CodeGen::ConstantAggregateBuilderTemplateBase< Impl, Traits >::finishAndAddTo(), clang::CodeGen::ConstantAggregateBuilderTemplateBase< Impl, Traits >::finishAndCreateFuture(), clang::CodeGen::ConstantAggregateBuilderTemplateBase< Impl, Traits >::finishAndCreateGlobal(), clang::CodeGen::ConstantAggregateBuilderTemplateBase< Impl, Traits >::finishAndSetAsInitializer(), clang::format::forEachToken(), clang::interp::InterpState::getBottomFrame(), clang::interp::InterpState::getCtx(), clang::ASTContext::getDeclAlign(), getEnclosingParent(), getEnclosingStmtLocation(), clang::interp::InterpState::getEvalStatus(), clang::tooling::CodeRangeASTSelection::getFunctionLikeNearestParent(), getImplicitCodeSegAttrFromClass(), clang::ObjCProtocolDecl::getImpliedProtocols(), clang::ASTNodeKind::getMostDerivedCommonAncestor(), clang::LocationContext::getParent(), clang::ConstructionContextLayer::getParent(), clang::sema::DelayedDiagnosticPool::getParent(), clang::InitializedEntity::getParent(), clang::interp::VariableScope< Emitter >::getParent(), getRequiredQualification(), clang::Sema::getSelfAssignmentClassMemberCandidate(), clang::interp::InterpState::getSplitFrame(), clang::AnalysisDeclContextManager::getStackFrame(), clang::ento::PathDiagnosticLocation::getValidSourceLocation(), clang::index::IndexingContext::handleReference(), clang::interp::InterpState::hasActiveDiagnostic(), clang::interp::InterpState::hasPriorDiagnostic(), hasUnguardedAccess(), clang::interp::InterpState::inConstantContext(), clang::index::IndexingContext::indexBody(), clang::index::IndexingContext::indexNestedNameSpecifierLoc(), clang::index::IndexingContext::indexTypeLoc(), clang::index::IndexingContext::indexTypeSourceInfo(), clang::ModuleMap::inferFrameworkModule(), clang::Sema::inferGslPointerAttribute(), clang::dataflow::Environment::initialize(), clang::InitializedEntity::InitializeBase(), clang::InitializedEntity::InitializeElement(), clang::InitializedEntity::InitializeMember(), initializingConstexprVariable(), InsertOCLBuiltinDeclarationsFromTable(), isDesignatorAtObjectEnd(), clang::tooling::CodeRangeASTSelection::isInFunctionLikeBodyOfCode(), clang::AnalysisDeclContext::isInStdNamespace(), clang::ConstructionContextLayer::isLast(), clang::LocationContext::isParentOf(), clang::interp::Context::isPotentialConstantExpr(), clang::ODRHash::isSubDeclToBeProcessed(), clang::ento::BugSuppression::isSuppressed(), clang::index::IndexingContext::isTemplateImplicitInstantiation(), clang::interp::InterpState::keepEvaluatingAfterFailure(), clang::LocationContext::LocationContext(), clang::Sema::MarkFunctionReferenced(), clang::Sema::MatchTemplateParametersToScopeSpecifier(), clang::interp::InterpState::noteUndefinedBehavior(), clang::Decl::operator new(), clang::sema::DelayedDiagnosticPool::operator=(), potentiallyWritesIntoIvar(), removeLValueToRValueCast(), rewriteBuiltinFunctionDecl(), clang::Scope::Scope(), seenBefore(), clang::interp::InterpState::setActiveDiagnostic(), clang::interp::InterpState::setFoldFailureDiagnostic(), clang::FunctionDecl::setIsPureVirtual(), clang::ParentMap::setParent(), clang::extractapi::impl::ExtractAPIVisitorBase< Derived >::VisitClassTemplatePartialSpecializationDecl(), clang::extractapi::impl::ExtractAPIVisitorBase< Derived >::VisitClassTemplateSpecializationDecl(), clang::extractapi::impl::ExtractAPIVisitorBase< Derived >::VisitCXXMethodDecl(), clang::extractapi::impl::ExtractAPIVisitorBase< Derived >::VisitCXXRecordDecl(), clang::extractapi::impl::ExtractAPIVisitorBase< Derived >::VisitNamespaceDecl(), clang::ASTDeclWriter::VisitNamespaceDecl(), clang::ento::SValExplainer::VisitParamVarRegion(), and clang::interp::VariableScope< Emitter >::~VariableScope().

◆ Tree

const SyntaxTree::Impl& Tree