Keep track of type source information in the return type of an
Objective-C method declaration, e.g., for
- (Foo *)myMethod;
we now have TypeSourceInfo for the Foo*.
llvm-svn: 97942
diff --git a/clang/tools/CIndex/CIndex.cpp b/clang/tools/CIndex/CIndex.cpp
index 07bb7fb..4ae2f80 100644
--- a/clang/tools/CIndex/CIndex.cpp
+++ b/clang/tools/CIndex/CIndex.cpp
@@ -532,9 +532,10 @@
}
bool CursorVisitor::VisitObjCMethodDecl(ObjCMethodDecl *ND) {
- // FIXME: We really need a TypeLoc covering Objective-C method declarations.
- // At the moment, we don't have information about locations in the return
- // type.
+ if (TypeSourceInfo *TSInfo = ND->getResultTypeSourceInfo())
+ if (Visit(TSInfo->getTypeLoc()))
+ return true;
+
for (ObjCMethodDecl::param_iterator P = ND->param_begin(),
PEnd = ND->param_end();
P != PEnd; ++P) {