Home
last modified time | relevance | path

Searched refs:ASTNode (Results 1 – 25 of 57) sorted by relevance

123

/llvm-project-15.0.7/clang/utils/TableGen/
H A DASTTableGen.cpp24 if (auto node = getAs<ASTNode>()) { in getName()
94 using ChildMap = std::multimap<ASTNode, ASTNode>;
96 static void visitASTNodeRecursive(ASTNode node, ASTNode base, in visitASTNodeRecursive()
98 ASTNodeHierarchyVisitor<ASTNode> visit) { in visitASTNodeRecursive()
109 ASTNodeHierarchyVisitor<ASTNode> visit) { in visitHierarchy()
121 ASTNode root; in visitHierarchy()
122 for (ASTNode node : nodes) { in visitHierarchy()
135 visitASTNodeRecursive(root, ASTNode(), hierarchy, visit); in visitHierarchy()
140 ASTNodeHierarchyVisitor<ASTNode> visit) { in visitASTNodeHierarchyImpl()
H A DClangASTNodesEmitter.cpp33 typedef std::multimap<ASTNode, ASTNode> ChildMap;
37 ASTNode Root;
61 std::string baseName(ASTNode node) { in baseName()
70 std::pair<ASTNode, ASTNode> EmitNode(raw_ostream& OS, ASTNode Base);
87 std::pair<ASTNode, ASTNode> ClangASTNodesEmitter::EmitNode(raw_ostream &OS, in EmitNode()
88 ASTNode Base) { in EmitNode()
94 ASTNode First, Last; in EmitNode()
99 ASTNode Child = i->second; in EmitNode()
H A DASTTableGen.h157 class ASTNode : public HasProperties {
159 ASTNode(llvm::Record *record = nullptr) : HasProperties(record) {} in HasProperties()
166 ASTNode getBase() const { in getBase()
180 class DeclNode : public ASTNode {
182 DeclNode(llvm::Record *record = nullptr) : ASTNode(record) {} in ASTNode() function
202 class TypeNode : public ASTNode {
204 TypeNode(llvm::Record *record = nullptr) : ASTNode(record) {} in ASTNode() function
224 class StmtNode : public ASTNode {
226 StmtNode(llvm::Record *record = nullptr) : ASTNode(record) {} in ASTNode() function
487 ASTNodeHierarchyVisitor<ASTNode> visit);
[all …]
/llvm-project-15.0.7/clang-tools-extra/clangd/refactor/tweaks/
H A DExtractVariable.cpp115 Expr = Node->ASTNode.get<clang::Expr>(); in ExtractionContext()
169 if (InsertionPoint->ASTNode.get<VarDecl>()) in computeInsertionPoint()
251 N.ASTNode.get<Expr>())) { in parse()
259 const Expr *E = Child->ASTNode.get<Expr>(); in parse()
363 if (CE->getCallee() != MaybeCallee.ASTNode.get<Expr>()) in getCallExpr()
396 const Expr *E = N->ASTNode.get<Expr>(); in eligibleForExtraction()
436 if (childExprIsStmt(Parent->ASTNode.get<Stmt>(), in eligibleForExtraction()
437 OuterImplicit.ASTNode.get<Expr>())) in eligibleForExtraction()
443 if (const auto *BO = Parent->ASTNode.get<BinaryOperator>()) { in eligibleForExtraction()
445 BO->getRHS() == OuterImplicit.ASTNode.get<Expr>()) in eligibleForExtraction()
[all …]
H A DExpandAutoType.cpp56 while (N && N->ASTNode.get<TypeLoc>()) in isStructuredBindingType()
59 return N && N->ASTNode.get<DecompositionDecl>(); in isStructuredBindingType()
70 if (const auto *DD = It->ASTNode.get<DeclaratorDecl>()) { in isDeducedAsLambda()
85 if (Node->Parent->ASTNode.get<NonTypeTemplateParmDecl>()) in isTemplateParam()
92 if (auto *TypeNode = Node->ASTNode.get<TypeLoc>()) { in prepare()
H A DExtractFunction.cpp103 if (!N->ASTNode.get<Stmt>()) in isRootStmt()
110 if (N->Selected == SelectionTree::Unselected && !N->ASTNode.get<DeclStmt>()) in isRootStmt()
146 if (Parent->ASTNode.get<DeclStmt>()) in getParentOfRootStmts()
226 const Stmt *Last = EZ.getLastRootStmt()->ASTNode.get<Stmt>(); in alwaysReturns()
245 if (CurNode->ASTNode.get<LambdaExpr>()) in findEnclosingFunction()
247 if (const FunctionDecl *Func = CurNode->ASTNode.get<FunctionDecl>()) { in findEnclosingFunction()
269 SM, LangOpts, Parent->Children.back()->ASTNode.getSourceRange())) in findZoneRange()
293 if (Child->ASTNode.get<Expr>()) in validSingleChild()
298 if (Child->ASTNode.get<Stmt>() == EnclosingFunc->getBody()) in validSingleChild()
329 ExtZone.RootStmts.insert(Child->ASTNode.get<Stmt>()); in findExtractionZone()
[all …]
H A DAddUsing.cpp252 if (Node->ASTNode.get<NestedNameSpecifierLoc>()) { in prepare()
255 if (auto *T = Node->ASTNode.get<TypeLoc>()) { in prepare()
259 if (Node->Parent->ASTNode.get<TypeLoc>() || in prepare()
260 Node->Parent->ASTNode.get<NestedNameSpecifierLoc>()) { in prepare()
272 if (auto *D = Node->ASTNode.get<DeclRefExpr>()) { in prepare()
278 } else if (auto *T = Node->ASTNode.get<TypeLoc>()) { in prepare()
H A DDumpAST.cpp39 if (dumpable(N->ASTNode)) in prepare()
40 Node = N->ASTNode; in prepare()
140 if (auto *D = Node->ASTNode.get<Decl>()) in prepare()
H A DObjCLocalizeStringLiteral.cpp54 if (N->ASTNode.get<StringLiteral>()) { in REGISTER_TWEAK()
58 Str = dyn_cast_or_null<ObjCStringLiteral>(N->ASTNode.get<Stmt>()); in REGISTER_TWEAK()
H A DObjCMemberwiseInitializer.cpp200 const Decl *D = N->ASTNode.get<Decl>(); in REGISTER_TWEAK()
239 if (const auto *D = N->ASTNode.get<Decl>()) { in paramsForSelection()
248 if (Container == N->ASTNode.get<ObjCContainerDecl>() && N->Children.empty()) in paramsForSelection()
254 const Decl *D = CNode->ASTNode.get<Decl>(); in paramsForSelection()
H A DSwapIfBranches.cpp54 if (llvm::isa_and_nonnull<CompoundStmt>(N->ASTNode.get<Stmt>())) in REGISTER_TWEAK()
56 If = dyn_cast_or_null<IfStmt>(N->ASTNode.get<Stmt>()); in REGISTER_TWEAK()
H A DRemoveUsingNamespace.cpp89 return Node->Parent && Node->Parent->ASTNode.get<TranslationUnitDecl>(); in isTopLevelDecl()
109 TargetDirective = CA->ASTNode.get<UsingDirectiveDecl>(); in prepare()
H A DPopulateSwitch.cpp96 Switch = CA->ASTNode.get<SwitchStmt>(); in REGISTER_TWEAK()
99 Switch = Parent->ASTNode.get<SwitchStmt>(); in REGISTER_TWEAK()
/llvm-project-15.0.7/clang/lib/StaticAnalyzer/Checkers/WebKit/
H A DASTUtils.h65 template <typename T> std::string safeGetName(const T *ASTNode) { in safeGetName() argument
66 const auto *const ND = llvm::dyn_cast_or_null<clang::NamedDecl>(ASTNode); in safeGetName()
/llvm-project-15.0.7/clang/tools/libclang/
H A DCXComment.h33 Result.ASTNode = C; in createCXComment()
39 return static_cast<const comments::Comment *>(CXC.ASTNode); in getASTNode()
H A DCXIndexDataConsumer.cpp164 SourceLocation Loc, ASTNodeInfo ASTNode) { in handleDeclOccurrence() argument
196 if (ASTNode.OrigE) { in handleDeclOccurrence()
197 Cursor = cxcursor::MakeCXCursor(ASTNode.OrigE, in handleDeclOccurrence()
198 cast<Decl>(ASTNode.ContainerDC), in handleDeclOccurrence()
201 if (ASTNode.OrigD) { in handleDeclOccurrence()
202 if (auto *OrigND = dyn_cast<NamedDecl>(ASTNode.OrigD)) in handleDeclOccurrence()
205 Cursor = MakeCXCursor(ASTNode.OrigD, CXTU); in handleDeclOccurrence()
211 dyn_cast_or_null<NamedDecl>(ASTNode.Parent), in handleDeclOccurrence()
212 ASTNode.ContainerDC, ASTNode.OrigE, Kind, CXRole); in handleDeclOccurrence()
215 const DeclContext *LexicalDC = ASTNode.ContainerDC; in handleDeclOccurrence()
[all …]
/llvm-project-15.0.7/clang-tools-extra/clangd/
H A DSelection.cpp53 if (const auto *RE = N->ASTNode.get<RecoveryExpr>()) { in recordMetrics()
737 Nodes.back().ASTNode = DynTypedNode::create(*AST.getTranslationUnitDecl()); in SelectionVisitor()
825 Nodes.back().ASTNode = std::move(Node); in push()
836 dlog("{1}pop: {0}", printNodeToString(N.ASTNode, PrintPolicy), indent(-1)); in pop()
837 claimTokensFor(N.ASTNode, N.Selected); in pop()
992 printNodeKind(OS, N.ASTNode); in print()
993 OS << ' ' << abbreviatedString(N.ASTNode, PrintPolicy) << "\n"; in print()
1001 printNodeKind(OS, ASTNode); in kind()
1082 if (const Decl *Current = CurrentNode->ASTNode.get<Decl>()) { in getDeclContext()
1094 getSourceRange(Children.front()->ASTNode) == getSourceRange(ASTNode)) in ignoreImplicit()
[all …]
H A DXRefs.cpp178 *NodeKind = N->ASTNode.getNodeKind(); in getDeclAtPositionWithRelations()
183 if (N->ASTNode.get<Attr>() && N->Parent) in getDeclAtPositionWithRelations()
1138 if (N.ASTNode.get<BreakStmt>()) { in relatedControlFlow()
1140 } else if (N.ASTNode.get<ContinueStmt>()) { in relatedControlFlow()
1142 } else if (N.ASTNode.get<ReturnStmt>()) { in relatedControlFlow()
1144 } else if (N.ASTNode.get<CXXThrowExpr>()) { in relatedControlFlow()
1146 } else if (N.ASTNode.get<SwitchCase>()) { in relatedControlFlow()
1798 while (N && N->ASTNode.get<NestedNameSpecifierLoc>()) in typeForNode()
1804 if (const TypeLoc *TL = N->ASTNode.get<TypeLoc>()) { in typeForNode()
1827 if (const Decl *D = N->ASTNode.get<Decl>()) { in typeForNode()
[all …]
H A DHover.cpp456 if (const Expr *E = N->ASTNode.get<Expr>()) { in printExprValue()
463 } else if (N->ASTNode.get<Decl>() || N->ASTNode.get<Stmt>()) { in printExprValue()
879 const auto *CE = OuterNode.Parent->ASTNode.get<CallExpr>(); in maybeAddCalleeArgInfo()
894 if (CE->getArg(I) != OuterNode.ASTNode.get<Expr>()) in maybeAddCalleeArgInfo()
909 if (const auto *E = N->ASTNode.get<Expr>()) { in maybeAddCalleeArgInfo()
917 if (const auto *ImplicitCast = CastNode->ASTNode.get<ImplicitCastExpr>()) { in maybeAddCalleeArgInfo()
942 CastNode->ASTNode.get<CXXConstructExpr>()) { in maybeAddCalleeArgInfo()
1034 auto Decls = explicitReferenceTargets(N->ASTNode, DeclRelation::Alias, in getHover()
1039 if (Decls.front() == N->ASTNode.get<Decl>()) in getHover()
1045 } else if (const Expr *E = N->ASTNode.get<Expr>()) { in getHover()
[all …]
H A DDumpAST.h45 ASTNode dumpAST(const DynTypedNode &, const syntax::TokenBuffer &Tokens,
/llvm-project-15.0.7/clang/include/clang/Basic/
H A DCommentNodes.td1 include "clang/Basic/ASTNode.td"
3 class CommentNode<CommentNode base, bit abstract = 0> : ASTNode {
H A DASTNode.td5 class ASTNode : HasProperties;
/llvm-project-15.0.7/clang/lib/Tooling/ASTDiff/
H A DASTDiff.cpp197 template <class T> std::tuple<NodeId, NodeId> PreTraverse(T *ASTNode) { in PreTraverse()
203 N.ASTNode = DynTypedNode::create(*ASTNode); in PreTraverse()
204 assert(!N.ASTNode.getNodeKind().isNone() && in PreTraverse()
414 const DynTypedNode &DTN = N.ASTNode; in getNodeValue()
687 ASTNodeKind Node::getType() const { return ASTNode.getNodeKind(); } in getType()
692 if (auto *ND = ASTNode.get<NamedDecl>()) { in getQualifiedIdentifier()
700 if (auto *ND = ASTNode.get<NamedDecl>()) { in getIdentifier()
996 SourceRange Range = N.ASTNode.getSourceRange(); in getSourceRangeOffsets()
1000 if (auto *ThisExpr = N.ASTNode.get<CXXThisExpr>()) { in getSourceRangeOffsets()
/llvm-project-15.0.7/clang-tools-extra/clangd/index/
H A DSymbolCollector.cpp524 index::IndexDataConsumer::ASTNodeInfo ASTNode) { in handleDeclOccurrence() argument
527 assert(ASTNode.OrigD); in handleDeclOccurrence()
532 D = ASTNode.OrigD; in handleDeclOccurrence()
536 if ((ASTNode.OrigD->getFriendObjectKind() != in handleDeclOccurrence()
544 D = CanonicalDecls.try_emplace(D, ASTNode.OrigD).first->second; in handleDeclOccurrence()
588 if (ASTNode.OrigD->isImplicit() || in handleDeclOccurrence()
611 getRefContainer(ASTNode.Parent, Opts), in handleDeclOccurrence()
623 auto *OriginalDecl = dyn_cast<NamedDecl>(ASTNode.OrigD); in handleDeclOccurrence()
/llvm-project-15.0.7/clang/include/clang/Index/
H A DIndexDataConsumer.h44 SourceLocation Loc, ASTNodeInfo ASTNode) { in handleDeclOccurrence() argument

123