[cfe-commits] r173583 - libclang: change getCursorAttr() to return 'const Attr *'
Dmitri Gribenko
gribozavr at gmail.com
Sat Jan 26 10:08:08 PST 2013
Author: gribozavr
Date: Sat Jan 26 12:08:08 2013
New Revision: 173583
URL: http://llvm.org/viewvc/llvm-project?rev=173583&view=rev
Log:
libclang: change getCursorAttr() to return 'const Attr *'
Modified:
cfe/trunk/tools/libclang/CIndex.cpp
cfe/trunk/tools/libclang/CXCursor.cpp
cfe/trunk/tools/libclang/CXCursor.h
Modified: cfe/trunk/tools/libclang/CIndex.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/CIndex.cpp?rev=173583&r1=173582&r2=173583&view=diff
==============================================================================
--- cfe/trunk/tools/libclang/CIndex.cpp (original)
+++ cfe/trunk/tools/libclang/CIndex.cpp Sat Jan 26 12:08:08 2013
@@ -522,7 +522,7 @@ bool CursorVisitor::VisitChildren(CXCurs
}
if (Cursor.kind == CXCursor_IBOutletCollectionAttr) {
- IBOutletCollectionAttr *A =
+ const IBOutletCollectionAttr *A =
cast<IBOutletCollectionAttr>(cxcursor::getCursorAttr(Cursor));
if (const ObjCInterfaceType *InterT = A->getInterface()->getAs<ObjCInterfaceType>())
return Visit(cxcursor::MakeCursorObjCClassRef(InterT->getInterface(),
@@ -3258,12 +3258,12 @@ CXString clang_getCursorSpelling(CXCurso
return getDeclSpelling(getCursorDecl(C));
if (C.kind == CXCursor_AnnotateAttr) {
- AnnotateAttr *AA = cast<AnnotateAttr>(cxcursor::getCursorAttr(C));
+ const AnnotateAttr *AA = cast<AnnotateAttr>(cxcursor::getCursorAttr(C));
return createCXString(AA->getAnnotation());
}
if (C.kind == CXCursor_AsmLabelAttr) {
- AsmLabelAttr *AA = cast<AsmLabelAttr>(cxcursor::getCursorAttr(C));
+ const AsmLabelAttr *AA = cast<AsmLabelAttr>(cxcursor::getCursorAttr(C));
return createCXString(AA->getLabel());
}
@@ -6012,7 +6012,7 @@ CXType clang_getIBOutletCollectionType(C
if (C.kind != CXCursor_IBOutletCollectionAttr)
return cxtype::MakeCXType(QualType(), cxcursor::getCursorTU(C));
- IBOutletCollectionAttr *A =
+ const IBOutletCollectionAttr *A =
cast<IBOutletCollectionAttr>(cxcursor::getCursorAttr(C));
return cxtype::MakeCXType(A->getInterface(), cxcursor::getCursorTU(C));
Modified: cfe/trunk/tools/libclang/CXCursor.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/CXCursor.cpp?rev=173583&r1=173582&r2=173583&view=diff
==============================================================================
--- cfe/trunk/tools/libclang/CXCursor.cpp (original)
+++ cfe/trunk/tools/libclang/CXCursor.cpp Sat Jan 26 12:08:08 2013
@@ -794,8 +794,8 @@ const Stmt *cxcursor::getCursorStmt(CXCu
return static_cast<const Stmt *>(Cursor.data[1]);
}
-Attr *cxcursor::getCursorAttr(CXCursor Cursor) {
- return static_cast<Attr*>(const_cast<void*>(Cursor.data[1]));
+const Attr *cxcursor::getCursorAttr(CXCursor Cursor) {
+ return static_cast<const Attr *>(Cursor.data[1]);
}
Decl *cxcursor::getCursorParentDecl(CXCursor Cursor) {
Modified: cfe/trunk/tools/libclang/CXCursor.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/CXCursor.h?rev=173583&r1=173582&r2=173583&view=diff
==============================================================================
--- cfe/trunk/tools/libclang/CXCursor.h (original)
+++ cfe/trunk/tools/libclang/CXCursor.h Sat Jan 26 12:08:08 2013
@@ -244,7 +244,7 @@ std::pair<OverloadedDeclRefStorage, Sour
const Decl *getCursorDecl(CXCursor Cursor);
const Expr *getCursorExpr(CXCursor Cursor);
const Stmt *getCursorStmt(CXCursor Cursor);
-Attr *getCursorAttr(CXCursor Cursor);
+const Attr *getCursorAttr(CXCursor Cursor);
Decl *getCursorParentDecl(CXCursor Cursor);
ASTContext &getCursorContext(CXCursor Cursor);
More information about the cfe-commits
mailing list