[cfe-commits] r119438 - /cfe/trunk/tools/libclang/CIndex.cpp
Ted Kremenek
kremenek at apple.com
Tue Nov 16 16:50:39 PST 2010
Author: kremenek
Date: Tue Nov 16 18:50:39 2010
New Revision: 119438
URL: http://llvm.org/viewvc/llvm-project?rev=119438&view=rev
Log:
CursorVisitor: migrate handling of
TypesCompatibleExpr 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=119438&r1=119437&r2=119438&view=diff
==============================================================================
--- cfe/trunk/tools/libclang/CIndex.cpp (original)
+++ cfe/trunk/tools/libclang/CIndex.cpp Tue Nov 16 18:50:39 2010
@@ -339,7 +339,6 @@
bool VisitOffsetOfExpr(OffsetOfExpr *E);
bool VisitSizeOfAlignOfExpr(SizeOfAlignOfExpr *E);
bool VisitAddrLabelExpr(AddrLabelExpr *E);
- bool VisitTypesCompatibleExpr(TypesCompatibleExpr *E);
bool VisitVAArgExpr(VAArgExpr *E);
bool VisitDesignatedInitExpr(DesignatedInitExpr *E);
bool VisitCXXTypeidExpr(CXXTypeidExpr *E);
@@ -1488,11 +1487,6 @@
return Visit(MakeCursorLabelRef(E->getLabel(), E->getLabelLoc(), TU));
}
-bool CursorVisitor::VisitTypesCompatibleExpr(TypesCompatibleExpr *E) {
- return Visit(E->getArgTInfo1()->getTypeLoc()) ||
- Visit(E->getArgTInfo2()->getTypeLoc());
-}
-
bool CursorVisitor::VisitVAArgExpr(VAArgExpr *E) {
if (Visit(E->getWrittenTypeInfo()->getTypeLoc()))
return true;
@@ -1726,6 +1720,7 @@
void VisitOverloadExpr(OverloadExpr *E);
void VisitStmt(Stmt *S);
void VisitSwitchStmt(SwitchStmt *S);
+ void VisitTypesCompatibleExpr(TypesCompatibleExpr *E);
void VisitWhileStmt(WhileStmt *W);
void VisitUnresolvedMemberExpr(UnresolvedMemberExpr *U);
@@ -1866,6 +1861,11 @@
AddStmt(S->getCond());
AddDecl(S->getConditionVariable());
}
+void EnqueueVisitor::VisitTypesCompatibleExpr(TypesCompatibleExpr *E) {
+ AddTypeLoc(E->getArgTInfo2());
+ AddTypeLoc(E->getArgTInfo1());
+}
+
void EnqueueVisitor::VisitWhileStmt(WhileStmt *W) {
AddStmt(W->getBody());
AddStmt(W->getCond());
More information about the cfe-commits
mailing list