diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2013-10-31 01:56:18 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2013-10-31 01:56:18 +0000 |
commit | d386fef64f1fd00fc9a97efb963d8ec393fd1ace (patch) | |
tree | 3567690a358532ec28b5f4fb3e04383c4fc449a3 /tools | |
parent | 6d754e9a9d6591e8fc5eedc144cc70a7e539ba6f (diff) | |
download | clang-d386fef64f1fd00fc9a97efb963d8ec393fd1ace.tar.gz clang-d386fef64f1fd00fc9a97efb963d8ec393fd1ace.tar.bz2 clang-d386fef64f1fd00fc9a97efb963d8ec393fd1ace.tar.xz |
Factor out custom parsing for iboutletcollection and vec_type_hint attributes
into a separate "parse an attribute that takes a type argument" codepath. This
results in both codepaths being a lot cleaner and simpler, and fixes some bugs
where the type argument handling bled into the expression argument handling and
caused us to both accept invalid and reject valid attribute arguments.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193731 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools')
-rw-r--r-- | tools/libclang/CIndex.cpp | 4 | ||||
-rw-r--r-- | tools/libclang/IndexingContext.cpp | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/tools/libclang/CIndex.cpp b/tools/libclang/CIndex.cpp index 7288402963..48c2ee3536 100644 --- a/tools/libclang/CIndex.cpp +++ b/tools/libclang/CIndex.cpp @@ -532,8 +532,8 @@ bool CursorVisitor::VisitChildren(CXCursor Cursor) { if (Cursor.kind == CXCursor_IBOutletCollectionAttr) { const IBOutletCollectionAttr *A = cast<IBOutletCollectionAttr>(cxcursor::getCursorAttr(Cursor)); - if (const ObjCInterfaceType *InterT = A->getInterface()->getAs<ObjCInterfaceType>()) - return Visit(cxcursor::MakeCursorObjCClassRef(InterT->getInterface(), + if (const ObjCObjectType *ObjT = A->getInterface()->getAs<ObjCObjectType>()) + return Visit(cxcursor::MakeCursorObjCClassRef(ObjT->getInterface(), A->getInterfaceLoc(), TU)); } diff --git a/tools/libclang/IndexingContext.cpp b/tools/libclang/IndexingContext.cpp index cfa6b85173..6dadd7291f 100644 --- a/tools/libclang/IndexingContext.cpp +++ b/tools/libclang/IndexingContext.cpp @@ -99,8 +99,8 @@ AttrListInfo::AttrListInfo(const Decl *D, IndexingContext &IdxCtx) IBInfo.IBCollInfo.objcClass = 0; IBInfo.IBCollInfo.classCursor = clang_getNullCursor(); QualType Ty = IBAttr->getInterface(); - if (const ObjCInterfaceType *InterTy = Ty->getAs<ObjCInterfaceType>()) { - if (const ObjCInterfaceDecl *InterD = InterTy->getInterface()) { + if (const ObjCObjectType *ObjectTy = Ty->getAs<ObjCObjectType>()) { + if (const ObjCInterfaceDecl *InterD = ObjectTy->getInterface()) { IdxCtx.getEntityInfo(InterD, IBInfo.ClassInfo, SA); IBInfo.IBCollInfo.objcClass = &IBInfo.ClassInfo; IBInfo.IBCollInfo.classCursor = MakeCursorObjCClassRef(InterD, |