clang 19.0.0git
Public Types | Public Member Functions | Friends | List of all members
clang::ast_matchers::BoundNodes Class Reference

Maps string IDs to AST nodes matched by parts of a matcher. More...

#include "clang/ASTMatchers/ASTMatchers.h"

Public Types

using IDToNodeMap = internal::BoundNodesMap::IDToNodeMap
 Type of mapping from binding identifiers to bound nodes.
 

Public Member Functions

template<typename T >
const T * getNodeAs (StringRef ID) const
 Returns the AST node bound to ID.
 
const IDToNodeMapgetMap () const
 Retrieve mapping from binding identifiers to bound nodes.
 

Friends

class internal::BoundNodesTreeBuilder
 

Detailed Description

Maps string IDs to AST nodes matched by parts of a matcher.

The bound nodes are generated by calling bind("id") on the node matchers of the nodes we want to access later.

The instances of BoundNodes are created by MatchFinder when the user's callbacks are executed every time a match is found.

Examples
/home/buildbot/as-worker-4/publish-doxygen-docs/llvm-project/clang/lib/StaticAnalyzer/Core/RegionStore.cpp.

Definition at line 109 of file ASTMatchers.h.

Member Typedef Documentation

◆ IDToNodeMap

using clang::ast_matchers::BoundNodes::IDToNodeMap = internal::BoundNodesMap::IDToNodeMap

Type of mapping from binding identifiers to bound nodes.

This type is an associative container with a key type of std::string and a value type of clang::DynTypedNode

Definition at line 123 of file ASTMatchers.h.

Member Function Documentation

◆ getMap()

const IDToNodeMap & clang::ast_matchers::BoundNodes::getMap ( ) const
inline

Retrieve mapping from binding identifiers to bound nodes.

Definition at line 126 of file ASTMatchers.h.

◆ getNodeAs()

template<typename T >
const T * clang::ast_matchers::BoundNodes::getNodeAs ( StringRef  ID) const
inline

Returns the AST node bound to ID.

Returns NULL if there was no node bound to ID or if there is a node but it cannot be converted to the specified type.

Definition at line 116 of file ASTMatchers.h.

References ID.

Referenced by emitDiagnostics().

Friends And Related Function Documentation

◆ internal::BoundNodesTreeBuilder

friend class internal::BoundNodesTreeBuilder
friend

Definition at line 131 of file ASTMatchers.h.


The documentation for this class was generated from the following file: