[cfe-commits] r94099 - /cfe/trunk/tools/CIndex/CIndex.cpp

Douglas Gregor dgregor at apple.com
Thu Jan 21 12:48:56 PST 2010


Author: dgregor
Date: Thu Jan 21 14:48:56 2010
New Revision: 94099

URL: http://llvm.org/viewvc/llvm-project?rev=94099&view=rev
Log:
Teach the cursor visitor to walk into typeof types (both kinds). This
is hard to test now; tests will come when we can walk stataements and
expressions properly.

Modified:
    cfe/trunk/tools/CIndex/CIndex.cpp

Modified: cfe/trunk/tools/CIndex/CIndex.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/CIndex/CIndex.cpp?rev=94099&r1=94098&r2=94099&view=diff

==============================================================================
--- cfe/trunk/tools/CIndex/CIndex.cpp (original)
+++ cfe/trunk/tools/CIndex/CIndex.cpp Thu Jan 21 14:48:56 2010
@@ -200,6 +200,11 @@
   bool VisitRValueReferenceTypeLoc(RValueReferenceTypeLoc TL);
   bool VisitFunctionTypeLoc(FunctionTypeLoc TL);
   bool VisitArrayTypeLoc(ArrayTypeLoc TL);
+  // FIXME: Implement for TemplateSpecializationTypeLoc
+  // FIXME: Implement visitors here when the unimplemented TypeLocs get
+  // implemented
+  bool VisitTypeOfExprTypeLoc(TypeOfExprTypeLoc TL);
+  bool VisitTypeOfTypeLoc(TypeOfTypeLoc TL);
 };
   
 } // end anonymous namespace
@@ -532,6 +537,17 @@
   return false;
 }
 
+bool CursorVisitor::VisitTypeOfExprTypeLoc(TypeOfExprTypeLoc TL) {
+  return Visit(MakeCXCursor(TL.getUnderlyingExpr(), StmtParent, TU));
+}
+
+bool CursorVisitor::VisitTypeOfTypeLoc(TypeOfTypeLoc TL) {
+  if (TypeSourceInfo *TSInfo = TL.getUnderlyingTInfo())
+    return Visit(TSInfo->getTypeLoc());
+
+  return false;
+}
+
 CXString CIndexer::createCXString(const char *String, bool DupString){
   CXString Str;
   if (DupString) {





More information about the cfe-commits mailing list