diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2013-10-31 21:23:20 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2013-10-31 21:23:20 +0000 |
commit | b87c465391eff87c40ed1dfc3532241041365865 (patch) | |
tree | 2c6d51e9b2fb6bb4ff2703a60bb0196584519426 /clang/tools | |
parent | cb5bd5e5080ee169b3675d7a6bc85d82163a504f (diff) | |
download | llvm-b87c465391eff87c40ed1dfc3532241041365865.zip llvm-b87c465391eff87c40ed1dfc3532241041365865.tar.gz llvm-b87c465391eff87c40ed1dfc3532241041365865.tar.bz2 |
Store a TypeArgument on an attribute as a TypeSourceInfo*, rather than as a
QualType with a SourceLocation stashed alongside.
llvm-svn: 193803
Diffstat (limited to 'clang/tools')
-rw-r--r-- | clang/tools/libclang/CIndex.cpp | 5 | ||||
-rw-r--r-- | clang/tools/libclang/IndexingContext.cpp | 8 |
2 files changed, 8 insertions, 5 deletions
diff --git a/clang/tools/libclang/CIndex.cpp b/clang/tools/libclang/CIndex.cpp index 48c2ee3..c30f937 100644 --- a/clang/tools/libclang/CIndex.cpp +++ b/clang/tools/libclang/CIndex.cpp @@ -533,8 +533,9 @@ bool CursorVisitor::VisitChildren(CXCursor Cursor) { const IBOutletCollectionAttr *A = cast<IBOutletCollectionAttr>(cxcursor::getCursorAttr(Cursor)); if (const ObjCObjectType *ObjT = A->getInterface()->getAs<ObjCObjectType>()) - return Visit(cxcursor::MakeCursorObjCClassRef(ObjT->getInterface(), - A->getInterfaceLoc(), TU)); + return Visit(cxcursor::MakeCursorObjCClassRef( + ObjT->getInterface(), + A->getInterfaceLoc()->getTypeLoc().getLocStart(), TU)); } // If pointing inside a macro definition, check if the token is an identifier diff --git a/clang/tools/libclang/IndexingContext.cpp b/clang/tools/libclang/IndexingContext.cpp index 6dadd72..41ed6ea 100644 --- a/clang/tools/libclang/IndexingContext.cpp +++ b/clang/tools/libclang/IndexingContext.cpp @@ -94,8 +94,10 @@ AttrListInfo::AttrListInfo(const Decl *D, IndexingContext &IdxCtx) const IBOutletCollectionAttr * IBAttr = cast<IBOutletCollectionAttr>(IBInfo.A); + SourceLocation InterfaceLocStart = + IBAttr->getInterfaceLoc()->getTypeLoc().getLocStart(); IBInfo.IBCollInfo.attrInfo = &IBInfo; - IBInfo.IBCollInfo.classLoc = IdxCtx.getIndexLoc(IBAttr->getInterfaceLoc()); + IBInfo.IBCollInfo.classLoc = IdxCtx.getIndexLoc(InterfaceLocStart); IBInfo.IBCollInfo.objcClass = 0; IBInfo.IBCollInfo.classCursor = clang_getNullCursor(); QualType Ty = IBAttr->getInterface(); @@ -103,8 +105,8 @@ AttrListInfo::AttrListInfo(const Decl *D, IndexingContext &IdxCtx) if (const ObjCInterfaceDecl *InterD = ObjectTy->getInterface()) { IdxCtx.getEntityInfo(InterD, IBInfo.ClassInfo, SA); IBInfo.IBCollInfo.objcClass = &IBInfo.ClassInfo; - IBInfo.IBCollInfo.classCursor = MakeCursorObjCClassRef(InterD, - IBAttr->getInterfaceLoc(), IdxCtx.CXTU); + IBInfo.IBCollInfo.classCursor = + MakeCursorObjCClassRef(InterD, InterfaceLocStart, IdxCtx.CXTU); } } } |