From dd7dacfff997c706d0fcc2efc625552fbff44154 Mon Sep 17 00:00:00 2001 From: Dmitri Gribenko Date: Sun, 3 Feb 2013 13:19:54 +0000 Subject: [PATCH] libclang: remove unneeded const_casts llvm-svn: 174280 --- clang/tools/libclang/CIndex.cpp | 5 ++--- clang/tools/libclang/IndexingContext.h | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/clang/tools/libclang/CIndex.cpp b/clang/tools/libclang/CIndex.cpp index 13be3a1..74224c4 100644 --- a/clang/tools/libclang/CIndex.cpp +++ b/clang/tools/libclang/CIndex.cpp @@ -1681,7 +1681,7 @@ class DeclVisit : public VisitorJob { public: DeclVisit(const Decl *D, CXCursor parent, bool isFirst) : VisitorJob(parent, VisitorJob::DeclVisitKind, - const_cast(D), isFirst ? (void*) 1 : (void*) 0) {} + D, isFirst ? (void*) 1 : (void*) 0) {} static bool classof(const VisitorJob *VJ) { return VJ->getKind() == DeclVisitKind; } @@ -1742,8 +1742,7 @@ public: class DeclarationNameInfoVisit : public VisitorJob { public: DeclarationNameInfoVisit(const Stmt *S, CXCursor parent) - : VisitorJob(parent, VisitorJob::DeclarationNameInfoVisitKind, - const_cast(S)) {} + : VisitorJob(parent, VisitorJob::DeclarationNameInfoVisitKind, S) {} static bool classof(const VisitorJob *VJ) { return VJ->getKind() == VisitorJob::DeclarationNameInfoVisitKind; } diff --git a/clang/tools/libclang/IndexingContext.h b/clang/tools/libclang/IndexingContext.h index 6c8999e..c9097c5 100644 --- a/clang/tools/libclang/IndexingContext.h +++ b/clang/tools/libclang/IndexingContext.h @@ -494,7 +494,7 @@ private: void getContainerInfo(const DeclContext *DC, ContainerInfo &ContInfo); CXCursor getCursor(const Decl *D) { - return cxcursor::MakeCXCursor(const_cast(D), CXTU); + return cxcursor::MakeCXCursor(D, CXTU); } CXCursor getRefCursor(const NamedDecl *D, SourceLocation Loc); -- 2.7.4