Skip to content

Commit

Permalink
Visit statment children of HyperobjectType
Browse files Browse the repository at this point in the history
  • Loading branch information
VoxSciurorum authored and neboat committed Jul 13, 2022
1 parent 6f78d2a commit 3cbba61
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
4 changes: 4 additions & 0 deletions clang/include/clang/AST/ASTNodeTraverser.h
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,10 @@ class ASTNodeTraverser

void VisitHyperobjectType(const HyperobjectType *T) {
Visit(T->getElementType());
if (T->getIdentity())
Visit(T->getIdentity());
if (T->getReduce())
Visit(T->getReduce());
}
void VisitComplexType(const ComplexType *T) { Visit(T->getElementType()); }
void VisitLocInfoType(const LocInfoType *T) {
Expand Down
11 changes: 10 additions & 1 deletion clang/include/clang/AST/RecursiveASTVisitor.h
Original file line number Diff line number Diff line change
Expand Up @@ -895,6 +895,10 @@ DEF_TRAVERSE_TYPE(ComplexType, { TRY_TO(TraverseType(T->getElementType())); })

DEF_TRAVERSE_TYPE(HyperobjectType, {
TRY_TO(TraverseType(T->getElementType()));
if (Stmt *I = T->getIdentity())
TRY_TO(TraverseStmt(I));
if (Stmt *R = T->getReduce())
TRY_TO(TraverseStmt(R));
})

DEF_TRAVERSE_TYPE(PointerType, { TRY_TO(TraverseType(T->getPointeeType())); })
Expand Down Expand Up @@ -1138,7 +1142,12 @@ DEF_TRAVERSE_TYPELOC(ComplexType, {
})

DEF_TRAVERSE_TYPELOC(HyperobjectType, {
TRY_TO(TraverseType(TL.getTypePtr()->getElementType()));
const HyperobjectType *H = TL.getTypePtr();
TRY_TO(TraverseType(H->getElementType()));
if (Stmt *I = H->getIdentity())
TRY_TO(TraverseStmt(I));
if (Stmt *R = H->getReduce())
TRY_TO(TraverseStmt(R));
})

DEF_TRAVERSE_TYPELOC(PointerType,
Expand Down

0 comments on commit 3cbba61

Please sign in to comment.