aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tools/libclang/CIndexUSRs.cpp2
-rw-r--r--tools/libclang/IndexingContext.cpp8
2 files changed, 6 insertions, 4 deletions
diff --git a/tools/libclang/CIndexUSRs.cpp b/tools/libclang/CIndexUSRs.cpp
index 1219c2eea1..11b124c562 100644
--- a/tools/libclang/CIndexUSRs.cpp
+++ b/tools/libclang/CIndexUSRs.cpp
@@ -817,7 +817,7 @@ bool cxcursor::getDeclCursorUSR(const Decl *D, SmallVectorImpl<char> &Buf) {
{
USRGenerator UG(&D->getASTContext(), &Buf);
- UG->Visit((Decl*)D);
+ UG->Visit(const_cast<Decl*>(D));
if (UG->ignoreResults())
return true;
diff --git a/tools/libclang/IndexingContext.cpp b/tools/libclang/IndexingContext.cpp
index f295582b53..0f00bac948 100644
--- a/tools/libclang/IndexingContext.cpp
+++ b/tools/libclang/IndexingContext.cpp
@@ -397,9 +397,11 @@ void IndexingContext::handleReference(const NamedDecl *D, SourceLocation Loc,
if (isNotFromSourceFile(D->getLocation()))
return;
- CXIdxEntityRefInfo Info = { E ? MakeCXCursor((Stmt*)E,
- (Decl*)cast<Decl>(DC), CXTU)
- : getRefCursor(D, Loc),
+ CXCursor Cursor = E ? MakeCXCursor(const_cast<Expr*>(E),
+ const_cast<Decl*>(cast<Decl>(DC)), CXTU)
+ : getRefCursor(D, Loc);
+
+ CXIdxEntityRefInfo Info = { Cursor,
getIndexLoc(Loc),
getIndexEntity(D),
getIndexEntity(Parent),