forked from OSchip/llvm-project
libclang: change getCursorAttr() to return 'const Attr *'
llvm-svn: 173583
This commit is contained in:
parent
5a7ae8dc18
commit
e4baea61b5
|
@ -522,7 +522,7 @@ bool CursorVisitor::VisitChildren(CXCursor Cursor) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Cursor.kind == CXCursor_IBOutletCollectionAttr) {
|
if (Cursor.kind == CXCursor_IBOutletCollectionAttr) {
|
||||||
IBOutletCollectionAttr *A =
|
const IBOutletCollectionAttr *A =
|
||||||
cast<IBOutletCollectionAttr>(cxcursor::getCursorAttr(Cursor));
|
cast<IBOutletCollectionAttr>(cxcursor::getCursorAttr(Cursor));
|
||||||
if (const ObjCInterfaceType *InterT = A->getInterface()->getAs<ObjCInterfaceType>())
|
if (const ObjCInterfaceType *InterT = A->getInterface()->getAs<ObjCInterfaceType>())
|
||||||
return Visit(cxcursor::MakeCursorObjCClassRef(InterT->getInterface(),
|
return Visit(cxcursor::MakeCursorObjCClassRef(InterT->getInterface(),
|
||||||
|
@ -3258,12 +3258,12 @@ CXString clang_getCursorSpelling(CXCursor C) {
|
||||||
return getDeclSpelling(getCursorDecl(C));
|
return getDeclSpelling(getCursorDecl(C));
|
||||||
|
|
||||||
if (C.kind == CXCursor_AnnotateAttr) {
|
if (C.kind == CXCursor_AnnotateAttr) {
|
||||||
AnnotateAttr *AA = cast<AnnotateAttr>(cxcursor::getCursorAttr(C));
|
const AnnotateAttr *AA = cast<AnnotateAttr>(cxcursor::getCursorAttr(C));
|
||||||
return createCXString(AA->getAnnotation());
|
return createCXString(AA->getAnnotation());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (C.kind == CXCursor_AsmLabelAttr) {
|
if (C.kind == CXCursor_AsmLabelAttr) {
|
||||||
AsmLabelAttr *AA = cast<AsmLabelAttr>(cxcursor::getCursorAttr(C));
|
const AsmLabelAttr *AA = cast<AsmLabelAttr>(cxcursor::getCursorAttr(C));
|
||||||
return createCXString(AA->getLabel());
|
return createCXString(AA->getLabel());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6012,7 +6012,7 @@ CXType clang_getIBOutletCollectionType(CXCursor C) {
|
||||||
if (C.kind != CXCursor_IBOutletCollectionAttr)
|
if (C.kind != CXCursor_IBOutletCollectionAttr)
|
||||||
return cxtype::MakeCXType(QualType(), cxcursor::getCursorTU(C));
|
return cxtype::MakeCXType(QualType(), cxcursor::getCursorTU(C));
|
||||||
|
|
||||||
IBOutletCollectionAttr *A =
|
const IBOutletCollectionAttr *A =
|
||||||
cast<IBOutletCollectionAttr>(cxcursor::getCursorAttr(C));
|
cast<IBOutletCollectionAttr>(cxcursor::getCursorAttr(C));
|
||||||
|
|
||||||
return cxtype::MakeCXType(A->getInterface(), cxcursor::getCursorTU(C));
|
return cxtype::MakeCXType(A->getInterface(), cxcursor::getCursorTU(C));
|
||||||
|
|
|
@ -794,8 +794,8 @@ const Stmt *cxcursor::getCursorStmt(CXCursor Cursor) {
|
||||||
return static_cast<const Stmt *>(Cursor.data[1]);
|
return static_cast<const Stmt *>(Cursor.data[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
Attr *cxcursor::getCursorAttr(CXCursor Cursor) {
|
const Attr *cxcursor::getCursorAttr(CXCursor Cursor) {
|
||||||
return static_cast<Attr*>(const_cast<void*>(Cursor.data[1]));
|
return static_cast<const Attr *>(Cursor.data[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
Decl *cxcursor::getCursorParentDecl(CXCursor Cursor) {
|
Decl *cxcursor::getCursorParentDecl(CXCursor Cursor) {
|
||||||
|
|
|
@ -244,7 +244,7 @@ std::pair<OverloadedDeclRefStorage, SourceLocation>
|
||||||
const Decl *getCursorDecl(CXCursor Cursor);
|
const Decl *getCursorDecl(CXCursor Cursor);
|
||||||
const Expr *getCursorExpr(CXCursor Cursor);
|
const Expr *getCursorExpr(CXCursor Cursor);
|
||||||
const Stmt *getCursorStmt(CXCursor Cursor);
|
const Stmt *getCursorStmt(CXCursor Cursor);
|
||||||
Attr *getCursorAttr(CXCursor Cursor);
|
const Attr *getCursorAttr(CXCursor Cursor);
|
||||||
Decl *getCursorParentDecl(CXCursor Cursor);
|
Decl *getCursorParentDecl(CXCursor Cursor);
|
||||||
|
|
||||||
ASTContext &getCursorContext(CXCursor Cursor);
|
ASTContext &getCursorContext(CXCursor Cursor);
|
||||||
|
|
Loading…
Reference in New Issue