From e4ea879fe73581bc70a9bfbfddc7ca06b5c0768b Mon Sep 17 00:00:00 2001 From: Dmitri Gribenko Date: Wed, 23 Jan 2013 15:56:07 +0000 Subject: [PATCH] Remove uneeded casts git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173269 91177308-0d34-0410-b5e6-96231b3b80d8 --- tools/libclang/CIndex.cpp | 8 +++----- tools/libclang/CXSourceLocation.cpp | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/tools/libclang/CIndex.cpp b/tools/libclang/CIndex.cpp index fa0bd524fb..64904fafb2 100644 --- a/tools/libclang/CIndex.cpp +++ b/tools/libclang/CIndex.cpp @@ -131,8 +131,7 @@ CXSourceRange cxloc::translateSourceRange(const SourceManager &SM, } CXSourceRange Result = { - { static_cast(const_cast(&SM)), - static_cast(const_cast(&LangOpts)) }, + { &SM, &LangOpts }, R.getBegin().getRawEncoding(), EndLoc.getRawEncoding() }; @@ -4844,8 +4843,7 @@ static void getTokens(ASTUnit *CXXUnit, SourceRange Range, // - Kind-specific fields if (Tok.isLiteral()) { CXTok.int_data[0] = CXToken_Literal; - CXTok.ptr_data = - static_cast(const_cast(Tok.getLiteralData())); + CXTok.ptr_data = const_cast(Tok.getLiteralData()); } else if (Tok.is(tok::raw_identifier)) { // Lookup the identifier to determine whether we have a keyword. IdentifierInfo *II @@ -5833,7 +5831,7 @@ CXFile clang_getIncludedFile(CXCursor cursor) { return 0; const InclusionDirective *ID = getCursorInclusionDirective(cursor); - return static_cast(const_cast(ID->getFile())); + return const_cast(ID->getFile()); } CXSourceRange clang_Cursor_getCommentRange(CXCursor C) { diff --git a/tools/libclang/CXSourceLocation.cpp b/tools/libclang/CXSourceLocation.cpp index 856481af74..af311eb8d9 100644 --- a/tools/libclang/CXSourceLocation.cpp +++ b/tools/libclang/CXSourceLocation.cpp @@ -346,7 +346,7 @@ void clang_getFileLocation(CXSourceLocation location, return createNullLocation(file, line, column, offset); if (file) - *file = static_cast(const_cast(SM.getFileEntryForID(FID))); + *file = const_cast(SM.getFileEntryForID(FID)); if (line) *line = SM.getLineNumber(FID, FileOffset); if (column) -- 2.40.0