[cfe-commits] r112879 - in /cfe/trunk: test/Index/load-stmts.cpp tools/libclang/CIndex.cpp
Douglas Gregor
dgregor at apple.com
Thu Sep 2 15:19:25 PDT 2010
Author: dgregor
Date: Thu Sep 2 17:19:24 2010
New Revision: 112879
URL: http://llvm.org/viewvc/llvm-project?rev=112879&view=rev
Log:
Add libclang visitation for UnresolvedLookupExprs
Modified:
cfe/trunk/test/Index/load-stmts.cpp
cfe/trunk/tools/libclang/CIndex.cpp
Modified: cfe/trunk/test/Index/load-stmts.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Index/load-stmts.cpp?rev=112879&r1=112878&r2=112879&view=diff
==============================================================================
--- cfe/trunk/test/Index/load-stmts.cpp (original)
+++ cfe/trunk/test/Index/load-stmts.cpp Thu Sep 2 17:19:24 2010
@@ -38,6 +38,16 @@
int_ptr->Integer::~Integer();
}
+namespace N {
+ int f(int);
+ float f(float);
+}
+
+template<typename T>
+void test_dependent_exprs(T t) {
+ N::f(t);
+}
+
// RUN: c-index-test -test-load-source all %s | FileCheck %s
// CHECK: load-stmts.cpp:1:13: TypedefDecl=T:1:13 (Definition) Extent=[1:13 - 1:14]
// CHECK: load-stmts.cpp:2:8: StructDecl=X:2:8 (Definition) Extent=[2:1 - 2:23]
@@ -103,3 +113,7 @@
// CHECK: load-stmts.cpp:38:3: DeclRefExpr=int_ptr:37:12 Extent=[38:3 - 38:10]
// CHECK: load-stmts.cpp:38:12: TypeRef=Integer:36:15 Extent=[38:12 - 38:19]
// CHECK: load-stmts.cpp:38:22: TypeRef=Integer:36:15 Extent=[38:22 - 38:29]
+// CHECK: load-stmts.cpp:47:6: FunctionTemplate=test_dependent_exprs:47:6 (Definition)
+// CHECK: load-stmts.cpp:48:3: CallExpr= Extent=[48:3 - 48:10]
+// CHECK: load-stmts.cpp:48:3: NamespaceRef=N:41:11 Extent=[48:3 - 48:4]
+// CHECK: load-stmts.cpp:48:8: DeclRefExpr=t:47:29 Extent=[48:8 - 48:9]
Modified: cfe/trunk/tools/libclang/CIndex.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/CIndex.cpp?rev=112879&r1=112878&r2=112879&view=diff
==============================================================================
--- cfe/trunk/tools/libclang/CIndex.cpp (original)
+++ cfe/trunk/tools/libclang/CIndex.cpp Thu Sep 2 17:19:24 2010
@@ -386,10 +386,12 @@
// 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: CXXTemporaryObjectExpr has poor source-location information.
+ // FIXME: CXXScalarValueInitExpr has poor source-location information.
// FIXME: CXXNewExpr has poor source-location information
bool VisitCXXPseudoDestructorExpr(CXXPseudoDestructorExpr *E);
+ // FIXME: UnaryTypeTraitExpr has poor source-location information.
+ bool VisitUnresolvedLookupExpr(UnresolvedLookupExpr *E);
};
} // end anonymous namespace
@@ -1608,6 +1610,21 @@
return false;
}
+bool CursorVisitor::VisitUnresolvedLookupExpr(UnresolvedLookupExpr *E) {
+ // Visit the nested-name-specifier.
+ if (NestedNameSpecifier *Qualifier = E->getQualifier())
+ if (VisitNestedNameSpecifier(Qualifier, E->getQualifierRange()))
+ return true;
+
+ // Visit the declaration name.
+ if (VisitDeclarationNameInfo(E->getNameInfo()))
+ return true;
+
+ // FIXME: We don't have a way to visit all of the declarations referenced
+ // here.
+ return false;
+}
+
bool CursorVisitor::VisitObjCMessageExpr(ObjCMessageExpr *E) {
if (TypeSourceInfo *TSInfo = E->getClassReceiverTypeInfo())
if (Visit(TSInfo->getTypeLoc()))
More information about the cfe-commits
mailing list