Keep proper source location information for the type in an Objective-C
@encode expression.
llvm-svn: 101907
diff --git a/clang/tools/CIndex/CIndex.cpp b/clang/tools/CIndex/CIndex.cpp
index 10c3995..eb93a8f 100644
--- a/clang/tools/CIndex/CIndex.cpp
+++ b/clang/tools/CIndex/CIndex.cpp
@@ -305,6 +305,7 @@
bool VisitCompoundLiteralExpr(CompoundLiteralExpr *E);
bool VisitExplicitCastExpr(ExplicitCastExpr *E);
bool VisitObjCMessageExpr(ObjCMessageExpr *E);
+ bool VisitObjCEncodeExpr(ObjCEncodeExpr *E);
bool VisitSizeOfAlignOfExpr(SizeOfAlignOfExpr *E);
};
@@ -977,6 +978,11 @@
return VisitExpr(E);
}
+bool CursorVisitor::VisitObjCEncodeExpr(ObjCEncodeExpr *E) {
+ return Visit(E->getEncodedTypeSourceInfo()->getTypeLoc());
+}
+
+
bool CursorVisitor::VisitAttributes(Decl *D) {
for (const Attr *A = D->getAttrs(); A; A = A->getNext())
if (Visit(MakeCXCursor(A, D, TU)))