[llvm-branch-commits] [cfe-branch] r119633 - /cfe/branches/Apple/whitney/tools/libclang/CIndex.cpp
Daniel Dunbar
daniel at zuster.org
Wed Nov 17 18:36:53 PST 2010
Author: ddunbar
Date: Wed Nov 17 20:36:53 2010
New Revision: 119633
URL: http://llvm.org/viewvc/llvm-project?rev=119633&view=rev
Log:
Merge r118933:
--
Author: Ted Kremenek <kremenek at apple.com>
Date: Fri Nov 12 22:24:55 2010 +0000
CursorVisitor: migrate ObjCMessageExpr over to data-recursion algorithm.
Modified:
cfe/branches/Apple/whitney/tools/libclang/CIndex.cpp
Modified: cfe/branches/Apple/whitney/tools/libclang/CIndex.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/Apple/whitney/tools/libclang/CIndex.cpp?rev=119633&r1=119632&r2=119633&view=diff
==============================================================================
--- cfe/branches/Apple/whitney/tools/libclang/CIndex.cpp (original)
+++ cfe/branches/Apple/whitney/tools/libclang/CIndex.cpp Wed Nov 17 20:36:53 2010
@@ -374,7 +374,6 @@
bool VisitDeclRefExpr(DeclRefExpr *E);
bool VisitBlockExpr(BlockExpr *B);
bool VisitExplicitCastExpr(ExplicitCastExpr *E);
- bool VisitObjCMessageExpr(ObjCMessageExpr *E);
bool VisitObjCEncodeExpr(ObjCEncodeExpr *E);
bool VisitOffsetOfExpr(OffsetOfExpr *E);
bool VisitSizeOfAlignOfExpr(SizeOfAlignOfExpr *E);
@@ -405,6 +404,7 @@
DATA_RECURSIVE_VISIT(InitListExpr)
DATA_RECURSIVE_VISIT(ForStmt)
DATA_RECURSIVE_VISIT(MemberExpr)
+ DATA_RECURSIVE_VISIT(ObjCMessageExpr)
DATA_RECURSIVE_VISIT(OverloadExpr)
DATA_RECURSIVE_VISIT(SwitchStmt)
DATA_RECURSIVE_VISIT(WhileStmt)
@@ -1802,14 +1802,6 @@
return false;
}
-bool CursorVisitor::VisitObjCMessageExpr(ObjCMessageExpr *E) {
- if (TypeSourceInfo *TSInfo = E->getClassReceiverTypeInfo())
- if (Visit(TSInfo->getTypeLoc()))
- return true;
-
- return VisitExpr(E);
-}
-
bool CursorVisitor::VisitObjCEncodeExpr(ObjCEncodeExpr *E) {
return Visit(E->getEncodedTypeSourceInfo()->getTypeLoc());
}
@@ -1907,6 +1899,10 @@
WLAddStmt(WL, C, M->getBase());
break;
}
+ case Stmt::ObjCMessageExprClass:
+ EnqueueChildren(WL, C, S);
+ WLAddTypeLoc(WL, C, cast<ObjCMessageExpr>(S)->getClassReceiverTypeInfo());
+ break;
case Stmt::ParenExprClass: {
WLAddStmt(WL, C, cast<ParenExpr>(S)->getSubExpr());
break;
@@ -2001,6 +1997,7 @@
case Stmt::IfStmtClass:
case Stmt::InitListExprClass:
case Stmt::MemberExprClass:
+ case Stmt::ObjCMessageExprClass:
case Stmt::ParenExprClass:
case Stmt::SwitchStmtClass:
case Stmt::UnaryOperatorClass:
More information about the llvm-branch-commits
mailing list