From: Ted Kremenek Date: Mon, 21 Jun 2010 19:41:40 +0000 (+0000) Subject: Add clang_getCursorType() support for @property declarations. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0d32a68cbc508f81ae6979f3e8aa6e3007d02752;p=clang Add clang_getCursorType() support for @property declarations. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106451 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/Index/print-typekind.m b/test/Index/print-typekind.m new file mode 100644 index 0000000000..62cbb70c8e --- /dev/null +++ b/test/Index/print-typekind.m @@ -0,0 +1,7 @@ +@interface Foo +@property (readonly) id x; +@end + +// RUN: c-index-test -test-print-typekind %s | FileCheck %s +// CHECK: ObjCPropertyDecl=x:2:25 typekind=Typedef [canonical=ObjCObjectPointer] + diff --git a/tools/libclang/CXTypes.cpp b/tools/libclang/CXTypes.cpp index 777afb9bb7..ae756c7a1e 100644 --- a/tools/libclang/CXTypes.cpp +++ b/tools/libclang/CXTypes.cpp @@ -116,6 +116,8 @@ CXType clang_getCursorType(CXCursor C) { return MakeCXType(QualType(ID->getTypeForDecl(), 0), AU); if (ValueDecl *VD = dyn_cast(D)) return MakeCXType(VD->getType(), AU); + if (ObjCPropertyDecl *PD = dyn_cast(D)) + return MakeCXType(PD->getType(), AU); return MakeCXType(QualType(), AU); }