[cfe-commits] r119440 - /cfe/trunk/tools/libclang/CIndex.cpp
Ted Kremenek
kremenek at apple.com
Tue Nov 16 16:50:43 PST 2010
Author: kremenek
Date: Tue Nov 16 18:50:43 2010
New Revision: 119440
URL: http://llvm.org/viewvc/llvm-project?rev=119440&view=rev
Log:
CursorVisitor: migrate handling of
VAArgExpr to data-recursion algorithm.
Modified:
cfe/trunk/tools/libclang/CIndex.cpp
Modified: cfe/trunk/tools/libclang/CIndex.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/CIndex.cpp?rev=119440&r1=119439&r2=119440&view=diff
==============================================================================
--- cfe/trunk/tools/libclang/CIndex.cpp (original)
+++ cfe/trunk/tools/libclang/CIndex.cpp Tue Nov 16 18:50:43 2010
@@ -339,7 +339,6 @@
bool VisitOffsetOfExpr(OffsetOfExpr *E);
bool VisitSizeOfAlignOfExpr(SizeOfAlignOfExpr *E);
bool VisitAddrLabelExpr(AddrLabelExpr *E);
- bool VisitVAArgExpr(VAArgExpr *E);
bool VisitDesignatedInitExpr(DesignatedInitExpr *E);
bool VisitCXXUuidofExpr(CXXUuidofExpr *E);
bool VisitCXXScalarValueInitExpr(CXXScalarValueInitExpr *E);
@@ -1486,13 +1485,6 @@
return Visit(MakeCursorLabelRef(E->getLabel(), E->getLabelLoc(), TU));
}
-bool CursorVisitor::VisitVAArgExpr(VAArgExpr *E) {
- if (Visit(E->getWrittenTypeInfo()->getTypeLoc()))
- return true;
-
- return Visit(MakeCXCursor(E->getSubExpr(), StmtParent, TU));
-}
-
bool CursorVisitor::VisitDesignatedInitExpr(DesignatedInitExpr *E) {
// Visit the designators.
typedef DesignatedInitExpr::Designator Designator;
@@ -1712,6 +1704,7 @@
void VisitTypesCompatibleExpr(TypesCompatibleExpr *E);
void VisitWhileStmt(WhileStmt *W);
void VisitUnresolvedMemberExpr(UnresolvedMemberExpr *U);
+ void VisitVAArgExpr(VAArgExpr *E);
private:
void AddStmt(Stmt *S);
@@ -1870,6 +1863,10 @@
if (!U->isImplicitAccess())
AddStmt(U->getBase());
}
+void EnqueueVisitor::VisitVAArgExpr(VAArgExpr *E) {
+ AddStmt(E->getSubExpr());
+ AddTypeLoc(E->getWrittenTypeInfo());
+}
void CursorVisitor::EnqueueWorkList(VisitorWorkList &WL, Stmt *S) {
EnqueueVisitor(WL, MakeCXCursor(S, StmtParent, TU)).Visit(S);
More information about the cfe-commits
mailing list