CursorVisitor: migrate handling of
TypesCompatibleExpr to data-recursion algorithm.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119438 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/tools/libclang/CIndex.cpp b/tools/libclang/CIndex.cpp
index a14d189..acf6b74 100644
--- a/tools/libclang/CIndex.cpp
+++ b/tools/libclang/CIndex.cpp
@@ -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());