]> granicus.if.org Git - clang/commitdiff
CursorVisitor: Migrate CXXUnresolvedConstructExpr over to data-recursive algorithm.
authorTed Kremenek <kremenek@apple.com>
Wed, 17 Nov 2010 00:50:36 +0000 (00:50 +0000)
committerTed Kremenek <kremenek@apple.com>
Wed, 17 Nov 2010 00:50:36 +0000 (00:50 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119437 91177308-0d34-0410-b5e6-96231b3b80d8

tools/libclang/CIndex.cpp

index c3ebe137094d85df2fbda54235d86344728dc06c..a14d1895117182f28bab0410c9afd04561cdcdde 100644 (file)
@@ -348,7 +348,6 @@ public:
   bool VisitCXXPseudoDestructorExpr(CXXPseudoDestructorExpr *E);
   bool VisitUnaryTypeTraitExpr(UnaryTypeTraitExpr *E);
   bool VisitDependentScopeDeclRefExpr(DependentScopeDeclRefExpr *E);
-  bool VisitCXXUnresolvedConstructExpr(CXXUnresolvedConstructExpr *E);
   bool VisitCXXDependentScopeMemberExpr(CXXDependentScopeMemberExpr *E);
 
   // Data-recursive visitor functions.
@@ -1614,15 +1613,6 @@ bool CursorVisitor::VisitDependentScopeDeclRefExpr(
   return false;
 }
 
-bool CursorVisitor::VisitCXXUnresolvedConstructExpr(
-                                                CXXUnresolvedConstructExpr *E) {
-  if (TypeSourceInfo *TSInfo = E->getTypeSourceInfo())
-    if (Visit(TSInfo->getTypeLoc()))
-      return true;
-  
-  return VisitExpr(E);
-}
-
 bool CursorVisitor::VisitCXXDependentScopeMemberExpr(
                                               CXXDependentScopeMemberExpr *E) {
   // Visit the base expression, if there is one.
@@ -1723,6 +1713,7 @@ public:
   void VisitCXXNewExpr(CXXNewExpr *E);
   void VisitCXXOperatorCallExpr(CXXOperatorCallExpr *E);
   void VisitCXXTemporaryObjectExpr(CXXTemporaryObjectExpr *E);
+  void VisitCXXUnresolvedConstructExpr(CXXUnresolvedConstructExpr *E);
   void VisitDeclRefExpr(DeclRefExpr *D);
   void VisitDeclStmt(DeclStmt *S);
   void VisitExplicitCastExpr(ExplicitCastExpr *E);
@@ -1806,6 +1797,12 @@ void EnqueueVisitor::VisitCXXTemporaryObjectExpr(CXXTemporaryObjectExpr *E) {
   EnqueueChildren(E);
   AddTypeLoc(E->getTypeSourceInfo());
 }
+
+void EnqueueVisitor::VisitCXXUnresolvedConstructExpr(CXXUnresolvedConstructExpr 
+                                                     *E) {
+  EnqueueChildren(E);
+  AddTypeLoc(E->getTypeSourceInfo());
+}
 void EnqueueVisitor::VisitDeclRefExpr(DeclRefExpr *DR) {
   WL.push_back(DeclRefExprParts(DR, Parent));
 }