// Statement visitors
bool VisitStmt(Stmt *S);
- bool VisitGotoStmt(GotoStmt *S);
// Expression visitors
bool VisitDeclRefExpr(DeclRefExpr *E);
DATA_RECURSIVE_VISIT(IfStmt)
DATA_RECURSIVE_VISIT(InitListExpr)
DATA_RECURSIVE_VISIT(ForStmt)
+ DATA_RECURSIVE_VISIT(GotoStmt)
DATA_RECURSIVE_VISIT(MemberExpr)
DATA_RECURSIVE_VISIT(ObjCMessageExpr)
DATA_RECURSIVE_VISIT(OverloadExpr)
return false;
}
-bool CursorVisitor::VisitGotoStmt(GotoStmt *S) {
- return Visit(MakeCursorLabelRef(S->getLabel(), S->getLabelLoc(), TU));
-}
-
bool CursorVisitor::VisitDeclRefExpr(DeclRefExpr *E) {
// Visit nested-name-specifier, if present.
if (NestedNameSpecifier *Qualifier = E->getQualifier())
CXCursor Cursor = MakeCXCursor(S, StmtParent, TU);
switch (S->getStmtClass()) {
+ case Stmt::GotoStmtClass: {
+ GotoStmt *GS = cast<GotoStmt>(S);
+ if (Visit(MakeCursorLabelRef(GS->getLabel(),
+ GS->getLabelLoc(), TU))) {
+ return true;
+ }
+ continue;
+ }
default: {
// FIXME: this entire switch stmt will eventually
// go away.