aboutsummaryrefslogtreecommitdiff
path: root/tools/libclang/IndexingContext.cpp
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2011-10-28 13:37:11 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2011-10-28 13:37:11 +0000
commit854625f7347e4418803fe4aa9131928408e4dc53 (patch)
treea29c3a83837a84340cb5ba8af64413941472ae22 /tools/libclang/IndexingContext.cpp
parentaa9807a85959ffbdc5d9f649d7b24b9b2056d2cd (diff)
Use const_cast to make it obvious that it's just removing constness (and silence warnings).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143193 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/libclang/IndexingContext.cpp')
-rw-r--r--tools/libclang/IndexingContext.cpp8
1 files changed, 5 insertions, 3 deletions
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),