summaryrefslogtreecommitdiffstats
path: root/tools/CIndex/CIndex.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/CIndex/CIndex.cpp')
-rw-r--r--tools/CIndex/CIndex.cpp28
1 files changed, 25 insertions, 3 deletions
diff --git a/tools/CIndex/CIndex.cpp b/tools/CIndex/CIndex.cpp
index 07bb7fb..b52a32e 100644
--- a/tools/CIndex/CIndex.cpp
+++ b/tools/CIndex/CIndex.cpp
@@ -315,6 +315,7 @@ public:
bool VisitSizeOfAlignOfExpr(SizeOfAlignOfExpr *E);
bool VisitExplicitCastExpr(ExplicitCastExpr *E);
bool VisitCompoundLiteralExpr(CompoundLiteralExpr *E);
+ bool VisitObjCMessageExpr(ObjCMessageExpr *E);
};
} // end anonymous namespace
@@ -532,9 +533,10 @@ bool CursorVisitor::VisitVarDecl(VarDecl *D) {
}
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) {
@@ -900,6 +902,14 @@ bool CursorVisitor::VisitCompoundLiteralExpr(CompoundLiteralExpr *E) {
return VisitExpr(E);
}
+bool CursorVisitor::VisitObjCMessageExpr(ObjCMessageExpr *E) {
+ ObjCMessageExpr::ClassInfo CI = E->getClassInfo();
+ if (CI.Decl && Visit(MakeCursorObjCClassRef(CI.Decl, CI.Loc, TU)))
+ return true;
+
+ return VisitExpr(E);
+}
+
bool CursorVisitor::VisitAttributes(Decl *D) {
for (const Attr *A = D->getAttrs(); A; A = A->getNext())
if (Visit(MakeCXCursor(A, D, TU)))
@@ -1579,6 +1589,18 @@ unsigned clang_isTranslationUnit(enum CXCursorKind K) {
return K == CXCursor_TranslationUnit;
}
+unsigned clang_isUnexposed(enum CXCursorKind K) {
+ switch (K) {
+ case CXCursor_UnexposedDecl:
+ case CXCursor_UnexposedExpr:
+ case CXCursor_UnexposedStmt:
+ case CXCursor_UnexposedAttr:
+ return true;
+ default:
+ return false;
+ }
+}
+
CXCursorKind clang_getCursorKind(CXCursor C) {
return C.kind;
}
OpenPOWER on IntegriCloud