Add libclang visitation for C++ pseudo-destructor expressions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112873 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/tools/libclang/CIndex.cpp b/tools/libclang/CIndex.cpp
index 89816ac..d3c3c6e 100644
--- a/tools/libclang/CIndex.cpp
+++ b/tools/libclang/CIndex.cpp
@@ -386,6 +386,10 @@
   // FIXME: DesignatedInitExpr
   bool VisitCXXTypeidExpr(CXXTypeidExpr *E);
   bool VisitCXXDefaultArgExpr(CXXDefaultArgExpr *E) { return false; }
+  // FIXME: CXXTemporaryObjectExpr has poor source-location information
+  // FIXME: CXXScalarValueInitExpr has poor source-location information
+  // FIXME: CXXNewExpr has poor source-location information
+  bool VisitCXXPseudoDestructorExpr(CXXPseudoDestructorExpr *E);
 };
 
 } // end anonymous namespace
@@ -1580,6 +1584,30 @@
   return VisitExpr(E);
 }
 
+bool CursorVisitor::VisitCXXPseudoDestructorExpr(CXXPseudoDestructorExpr *E) {
+  // Visit base expression.
+  if (Visit(MakeCXCursor(E->getBase(), StmtParent, TU)))
+    return true;
+  
+  // Visit the nested-name-specifier.
+  if (NestedNameSpecifier *Qualifier = E->getQualifier())
+    if (VisitNestedNameSpecifier(Qualifier, E->getQualifierRange()))
+      return true;
+  
+  // Visit the scope type that looks disturbingly like the nested-name-specifier
+  // but isn't.
+  if (TypeSourceInfo *TSInfo = E->getScopeTypeInfo())
+    if (Visit(TSInfo->getTypeLoc()))
+      return true;
+  
+  // Visit the name of the type being destroyed.
+  if (TypeSourceInfo *TSInfo = E->getDestroyedTypeInfo())
+    if (Visit(TSInfo->getTypeLoc()))
+      return true;
+  
+  return false;
+}
+
 bool CursorVisitor::VisitObjCMessageExpr(ObjCMessageExpr *E) {
   if (TypeSourceInfo *TSInfo = E->getClassReceiverTypeInfo())
     if (Visit(TSInfo->getTypeLoc()))