summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitri Gribenko <gribozavr@gmail.com>2013-01-23 15:56:07 +0000
committerDmitri Gribenko <gribozavr@gmail.com>2013-01-23 15:56:07 +0000
commitf930448bf61bd5f35a8fe90a90336d07598655c2 (patch)
tree57f964544bfe3f118331bf0c7e0ef7b0bd660d2b
parent1565eb3e381161924c96884c3bbc64bea6555535 (diff)
downloadbcm5719-llvm-f930448bf61bd5f35a8fe90a90336d07598655c2.tar.gz
bcm5719-llvm-f930448bf61bd5f35a8fe90a90336d07598655c2.zip
Remove uneeded casts
llvm-svn: 173269
-rw-r--r--clang/tools/libclang/CIndex.cpp8
-rw-r--r--clang/tools/libclang/CXSourceLocation.cpp2
2 files changed, 4 insertions, 6 deletions
diff --git a/clang/tools/libclang/CIndex.cpp b/clang/tools/libclang/CIndex.cpp
index fa0bd524fb0..64904fafb25 100644
--- a/clang/tools/libclang/CIndex.cpp
+++ b/clang/tools/libclang/CIndex.cpp
@@ -131,8 +131,7 @@ CXSourceRange cxloc::translateSourceRange(const SourceManager &SM,
}
CXSourceRange Result = {
- { static_cast<void*>(const_cast<SourceManager*>(&SM)),
- static_cast<void*>(const_cast<LangOptions*>(&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<void*>(const_cast<char*>(Tok.getLiteralData()));
+ CXTok.ptr_data = const_cast<char *>(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<void*>(const_cast<FileEntry*>(ID->getFile()));
+ return const_cast<FileEntry *>(ID->getFile());
}
CXSourceRange clang_Cursor_getCommentRange(CXCursor C) {
diff --git a/clang/tools/libclang/CXSourceLocation.cpp b/clang/tools/libclang/CXSourceLocation.cpp
index 856481af74c..af311eb8d96 100644
--- a/clang/tools/libclang/CXSourceLocation.cpp
+++ b/clang/tools/libclang/CXSourceLocation.cpp
@@ -346,7 +346,7 @@ void clang_getFileLocation(CXSourceLocation location,
return createNullLocation(file, line, column, offset);
if (file)
- *file = static_cast<void*>(const_cast<FileEntry*>(SM.getFileEntryForID(FID)));
+ *file = const_cast<FileEntry *>(SM.getFileEntryForID(FID));
if (line)
*line = SM.getLineNumber(FID, FileOffset);
if (column)
OpenPOWER on IntegriCloud