summaryrefslogtreecommitdiffstats
path: root/clang/tools/libclang/CIndex.cpp
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2013-01-23 08:25:41 +0000
committerBill Wendling <isanbard@gmail.com>2013-01-23 08:25:41 +0000
commiteade362f3062e4b2f492c755cc6f002bf15215c1 (patch)
tree0a9faaf184ef5d036c0f4776c2d2553062531886 /clang/tools/libclang/CIndex.cpp
parent7c8f96a91b9edde97ccd0dfaaa04e5bb04e308c6 (diff)
downloadbcm5719-llvm-eade362f3062e4b2f492c755cc6f002bf15215c1.tar.gz
bcm5719-llvm-eade362f3062e4b2f492c755cc6f002bf15215c1.zip
Explicitly cast away the const-ness instead of doing it implicitly.
llvm-svn: 173232
Diffstat (limited to 'clang/tools/libclang/CIndex.cpp')
-rw-r--r--clang/tools/libclang/CIndex.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/clang/tools/libclang/CIndex.cpp b/clang/tools/libclang/CIndex.cpp
index 5ec0fba1a83..fa0bd524fb0 100644
--- a/clang/tools/libclang/CIndex.cpp
+++ b/clang/tools/libclang/CIndex.cpp
@@ -130,9 +130,12 @@ CXSourceRange cxloc::translateSourceRange(const SourceManager &SM,
EndLoc = EndLoc.getLocWithOffset(Length);
}
- CXSourceRange Result = { { (void *)&SM, (void *)&LangOpts },
- R.getBegin().getRawEncoding(),
- EndLoc.getRawEncoding() };
+ CXSourceRange Result = {
+ { static_cast<void*>(const_cast<SourceManager*>(&SM)),
+ static_cast<void*>(const_cast<LangOptions*>(&LangOpts)) },
+ R.getBegin().getRawEncoding(),
+ EndLoc.getRawEncoding()
+ };
return Result;
}
@@ -4841,7 +4844,8 @@ static void getTokens(ASTUnit *CXXUnit, SourceRange Range,
// - Kind-specific fields
if (Tok.isLiteral()) {
CXTok.int_data[0] = CXToken_Literal;
- CXTok.ptr_data = (void *)Tok.getLiteralData();
+ CXTok.ptr_data =
+ static_cast<void*>(const_cast<char*>(Tok.getLiteralData()));
} else if (Tok.is(tok::raw_identifier)) {
// Lookup the identifier to determine whether we have a keyword.
IdentifierInfo *II
@@ -5829,7 +5833,7 @@ CXFile clang_getIncludedFile(CXCursor cursor) {
return 0;
const InclusionDirective *ID = getCursorInclusionDirective(cursor);
- return (void *)ID->getFile();
+ return static_cast<void*>(const_cast<FileEntry*>(ID->getFile()));
}
CXSourceRange clang_Cursor_getCommentRange(CXCursor C) {
OpenPOWER on IntegriCloud