aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitri Gribenko <gribozavr@gmail.com>2013-01-26 18:12:08 +0000
committerDmitri Gribenko <gribozavr@gmail.com>2013-01-26 18:12:08 +0000
commit404628caa53a3f898047d73b38647d6fbb827e00 (patch)
tree0cb0bc80d855f05d14ce88c32940ff5b856e6f00
parent7d91438047450869d7b881e1c63868c4b52a3cc2 (diff)
libclang: make getCursorParentDecl() return 'const Decl *'
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173584 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--tools/libclang/CIndex.cpp2
-rw-r--r--tools/libclang/CXCursor.cpp4
-rw-r--r--tools/libclang/CXCursor.h2
3 files changed, 4 insertions, 4 deletions
diff --git a/tools/libclang/CIndex.cpp b/tools/libclang/CIndex.cpp
index 0d1e3f721a..12d58f8fdc 100644
--- a/tools/libclang/CIndex.cpp
+++ b/tools/libclang/CIndex.cpp
@@ -5205,7 +5205,7 @@ AnnotateTokensWorker::Visit(CXCursor cursor, CXCursor parent) {
// MyCXXClass foo; // Make sure we don't annotate 'foo' as a CallExpr cursor.
if (clang_isExpression(cursorK)) {
const Expr *E = getCursorExpr(cursor);
- if (Decl *D = getCursorParentDecl(cursor)) {
+ if (const Decl *D = getCursorParentDecl(cursor)) {
const unsigned I = NextToken();
if (E->getLocStart().isValid() && D->getLocation().isValid() &&
E->getLocStart() == D->getLocation() &&
diff --git a/tools/libclang/CXCursor.cpp b/tools/libclang/CXCursor.cpp
index 9bef91d516..1a6a371835 100644
--- a/tools/libclang/CXCursor.cpp
+++ b/tools/libclang/CXCursor.cpp
@@ -798,8 +798,8 @@ const Attr *cxcursor::getCursorAttr(CXCursor Cursor) {
return static_cast<const Attr *>(Cursor.data[1]);
}
-Decl *cxcursor::getCursorParentDecl(CXCursor Cursor) {
- return static_cast<Decl*>(const_cast<void*>(Cursor.data[0]));
+const Decl *cxcursor::getCursorParentDecl(CXCursor Cursor) {
+ return static_cast<const Decl *>(Cursor.data[0]);
}
ASTContext &cxcursor::getCursorContext(CXCursor Cursor) {
diff --git a/tools/libclang/CXCursor.h b/tools/libclang/CXCursor.h
index e7fea73ba3..957d51961a 100644
--- a/tools/libclang/CXCursor.h
+++ b/tools/libclang/CXCursor.h
@@ -245,7 +245,7 @@ const Decl *getCursorDecl(CXCursor Cursor);
const Expr *getCursorExpr(CXCursor Cursor);
const Stmt *getCursorStmt(CXCursor Cursor);
const Attr *getCursorAttr(CXCursor Cursor);
-Decl *getCursorParentDecl(CXCursor Cursor);
+const Decl *getCursorParentDecl(CXCursor Cursor);
ASTContext &getCursorContext(CXCursor Cursor);
ASTUnit *getCursorASTUnit(CXCursor Cursor);