clang 20.0.0git
|
#include "clang/Tooling/Refactoring/ASTSelection.h"
#include "clang/AST/LexicallyOrderedRecursiveASTVisitor.h"
#include "clang/Lex/Lexer.h"
#include "llvm/Support/SaveAndRestore.h"
#include <optional>
Go to the source code of this file.
Functions | |
static const char * | selectionKindToString (SourceSelectionKind Kind) |
static void | dump (const SelectedASTNode &Node, llvm::raw_ostream &OS, unsigned Indent=0) |
static bool | hasAnyDirectChildrenWithKind (const SelectedASTNode &Node, SourceSelectionKind Kind) |
Returns true if the given node has any direct children with the following selection kind. | |
static void | findDeepestWithKind (const SelectedASTNode &ASTSelection, llvm::SmallVectorImpl< SelectedNodeWithParents > &MatchingNodes, SourceSelectionKind Kind, llvm::SmallVectorImpl< SelectedASTNode::ReferenceType > &ParentStack) |
Finds the set of bottom-most selected AST nodes that are in the selection tree with the specified selection kind. | |
static void | findDeepestWithKind (const SelectedASTNode &ASTSelection, llvm::SmallVectorImpl< SelectedNodeWithParents > &MatchingNodes, SourceSelectionKind Kind) |
static bool | isFunctionLikeDeclaration (const Decl *D) |
|
static |
Definition at line 216 of file ASTSelection.cpp.
References D, dump(), clang::DynTypedNode::get(), clang::Decl::getDeclKindName(), Node, and selectionKindToString().
Referenced by dump().
|
static |
Definition at line 371 of file ASTSelection.cpp.
References findDeepestWithKind().
|
static |
Finds the set of bottom-most selected AST nodes that are in the selection tree with the specified selection kind.
For example, given the following selection tree:
FunctionDecl "f" contains-selection CompoundStmt contains-selection [#1] CallExpr inside ImplicitCastExpr inside DeclRefExpr inside IntegerLiteral inside IntegerLiteral inside FunctionDecl "f2" contains-selection CompoundStmt contains-selection [#2] CallExpr inside ImplicitCastExpr inside DeclRefExpr inside IntegerLiteral inside IntegerLiteral inside
This function will find references to nodes #1 and #2 when searching for the ContainsSelection
kind.
Definition at line 341 of file ASTSelection.cpp.
References clang::tooling::SelectedASTNode::Children, findDeepestWithKind(), clang::DynTypedNode::get(), hasAnyDirectChildrenWithKind(), and clang::tooling::SelectedASTNode::Node.
Referenced by clang::tooling::CodeRangeASTSelection::create(), and findDeepestWithKind().
|
static |
Returns true if the given node has any direct children with the following selection kind.
Note: The direct children also include children of direct children with the "None" selection kind.
Definition at line 238 of file ASTSelection.cpp.
References hasAnyDirectChildrenWithKind(), Node, and clang::tooling::None.
Referenced by findDeepestWithKind(), and hasAnyDirectChildrenWithKind().
Definition at line 414 of file ASTSelection.cpp.
References D.
Referenced by clang::tooling::CodeRangeASTSelection::getFunctionLikeNearestParent(), and clang::tooling::CodeRangeASTSelection::isInFunctionLikeBodyOfCode().
|
static |
Definition at line 200 of file ASTSelection.cpp.
Referenced by dump().