clang  14.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 <unordered_set>
Include dependency graph for ASTDiff.cpp:

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

 clang
 
 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

◆ Id

int Id = 0

Definition at line 191 of file ASTDiff.cpp.

Referenced by clang::Sema::actOnLambdaInitCaptureInitialization(), clang::Sema::ActOnOpenMPIdExpression(), clang::Sema::ActOnTagTemplateIdType(), clang::LambdaIntroducer::addCapture(), clang::driver::types::appendSuffixForType(), argumentDependentLookup(), ArmBuiltinAliasValid(), clang::Sema::buildLambdaInitCaptureInitialization(), clang::Sema::BuildObjCExceptionDecl(), clang::driver::types::canLipoType(), clang::driver::types::canTypeBeUserSpecified(), checkConfigMacro(), clang::Sema::CheckEnumConstant(), TypeInfo::PhasesBitSet::contains(), clang::OMPCapturedExprDecl::Create(), clang::NamespaceDecl::Create(), clang::ObjCPropertyDecl::Create(), clang::TemplateTypeParmDecl::Create(), clang::NonTypeTemplateParmDecl::Create(), clang::ImplicitParamDecl::Create(), clang::TemplateTemplateParmDecl::Create(), clang::ObjCIvarDecl::Create(), clang::ObjCAtDefsFieldDecl::Create(), clang::ObjCProtocolDecl::Create(), clang::ObjCCategoryDecl::Create(), clang::ObjCCategoryImplDecl::Create(), clang::ObjCCompatibleAliasDecl::Create(), clang::FieldDecl::Create(), clang::EnumConstantDecl::Create(), clang::IndirectFieldDecl::Create(), clang::TypedefDecl::Create(), clang::TypeAliasDecl::Create(), clang::EnumDecl::Create(), clang::BindingDecl::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(), GetAssumedMessageSendExprType(), clang::ASTContext::GetBuiltinType(), clang::driver::types::getCompilationPhases(), clang::ASTNodeKind::getFromNodeKind(), 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::getMapped(), clang::diff::ASTDiff::Impl::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::driver::phases::getPhaseName(), clang::driver::types::getPrecompiledType(), clang::driver::types::getPreprocessedType(), 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::isCuda(), clang::driver::types::isCXX(), clang::driver::types::isDerivedFromC(), clang::driver::types::isFortran(), clang::driver::types::isHIP(), clang::diff::SyntaxTree::Impl::isInSubtree(), clang::driver::types::isLLVMIR(), clang::NSAPI::isMacroDefined(), clang::Preprocessor::isMacroDefined(), clang::driver::types::isObjC(), clang::driver::types::isOpenCL(), 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::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::ento::mpi::Request::Profile(), clang::TreeTransform< Derived >::RebuildDependentNameType(), clang::TreeTransform< Derived >::RebuildExceptionDecl(), clang::driver::InputAction::setId(), clang::UnqualifiedId::setIdentifier(), clang::UnqualifiedId::setImplicitSelfParam(), clang::UnqualifiedId::setLiteralOperatorId(), and clang::CodeGen::CodeGenModule::SetLLVMFunctionAttributesForDefinition().

◆ Parent

NodeId Parent

Definition at line 192 of file ASTDiff.cpp.

Referenced by clang::Sema::ActOnStartNamespaceDef(), clang::interp::VariableScope< Emitter >::addExtended(), clang::interp::ExprScope< Emitter >::addExtended(), clang::interp::VariableScope< Emitter >::addLocal(), adjustParent(), clang::ento::RetainSummaryManager::canEval(), clang::CFGBlock::CFGBlock(), clang::interp::InterpState::checkingForUndefinedBehavior(), clang::interp::InterpState::checkingPotentialConstantExpression(), clang::DependentDiagnostic::Create(), clang::ConstructionContextLayer::create(), clang::Sema::CreateBuiltin(), createConstantGlobalStructAndAddToParent(), clang::ModuleMap::createPrivateModuleFragmentForInterfaceUnit(), clang::CodeGen::CGDebugInfo::CreateTempMacroFile(), clang::sema::DelayedDiagnosticPool::DelayedDiagnosticPool(), clang::Scope::dumpImpl(), clang::sema::DelayedDiagnosticPool::empty(), clang::diff::SyntaxTree::Impl::findPositionInParent(), clang::CodeGen::ConstantAggregateBuilderTemplateBase< ConstantInitBuilderTraits ::ArrayBuilder, ConstantInitBuilderTraits >::finishAndAddTo(), clang::CodeGen::ConstantAggregateBuilderTemplateBase< ConstantInitBuilderTraits ::ArrayBuilder, ConstantInitBuilderTraits >::finishAndCreateFuture(), clang::CodeGen::ConstantAggregateBuilderTemplateBase< ConstantInitBuilderTraits ::ArrayBuilder, ConstantInitBuilderTraits >::finishAndCreateGlobal(), clang::CodeGen::ConstantAggregateBuilderTemplateBase< ConstantInitBuilderTraits ::ArrayBuilder, ConstantInitBuilderTraits >::finishAndSetAsInitializer(), clang::interp::InterpState::getBottomFrame(), clang::interp::InterpState::getCtx(), clang::ASTContext::getDeclAlign(), clang::interp::InterpState::getEvalStatus(), clang::tooling::CodeRangeASTSelection::getFunctionLikeNearestParent(), clang::ObjCProtocolDecl::getImpliedProtocols(), clang::ASTNodeKind::getMostDerivedCommonAncestor(), clang::syntax::Node::getParent(), clang::ConstructionContextLayer::getParent(), clang::LocationContext::getParent(), clang::interp::VariableScope< Emitter >::getParent(), clang::sema::DelayedDiagnosticPool::getParent(), clang::InitializedEntity::getParent(), clang::CFGBlock::getParent(), getRequiredQualification(), clang::interp::InterpState::getSplitFrame(), clang::index::IndexingContext::handleReference(), clang::interp::InterpState::hasActiveDiagnostic(), clang::interp::InterpState::hasPriorDiagnostic(), hasUnguardedAccess(), clang::index::IndexingContext::indexNestedNameSpecifierLoc(), clang::index::IndexingContext::indexTypeLoc(), clang::index::IndexingContext::indexTypeSourceInfo(), clang::ModuleMap::inferFrameworkModule(), clang::Sema::inferGslPointerAttribute(), clang::InitializedEntity::InitializeBase(), clang::InitializedEntity::InitializeMember(), clang::ODRHash::isDeclToBeProcessed(), isDesignatorAtObjectEnd(), clang::tooling::CodeRangeASTSelection::isInFunctionLikeBodyOfCode(), clang::AnalysisDeclContext::isInStdNamespace(), clang::ConstructionContextLayer::isLast(), clang::LocationContext::isParentOf(), clang::interp::Context::isPotentialConstantExpr(), 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::setPure(), clang::ASTDeclWriter::VisitNamespaceDecl(), and clang::interp::VariableScope< Emitter >::~VariableScope().

◆ Tree

const SyntaxTree::Impl& Tree