Fix warnings found by gcc-4.6, from -Wunused-but-set-variable and
-Wint-to-pointer-cast.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123719 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/tools/libclang/CIndex.cpp b/tools/libclang/CIndex.cpp
index 910f449..7f00f99 100644
--- a/tools/libclang/CIndex.cpp
+++ b/tools/libclang/CIndex.cpp
@@ -1530,22 +1530,22 @@
public:
LabelRefVisit(LabelStmt *LS, SourceLocation labelLoc, CXCursor parent)
: VisitorJob(parent, VisitorJob::LabelRefVisitKind, LS,
- (void*) labelLoc.getRawEncoding()) {}
+ labelLoc.getPtrEncoding()) {}
static bool classof(const VisitorJob *VJ) {
return VJ->getKind() == VisitorJob::LabelRefVisitKind;
}
LabelStmt *get() const { return static_cast<LabelStmt*>(data[0]); }
SourceLocation getLoc() const {
- return SourceLocation::getFromRawEncoding((unsigned)(uintptr_t) data[1]); }
+ return SourceLocation::getFromPtrEncoding(data[1]); }
};
class NestedNameSpecifierVisit : public VisitorJob {
public:
NestedNameSpecifierVisit(NestedNameSpecifier *NS, SourceRange R,
CXCursor parent)
: VisitorJob(parent, VisitorJob::NestedNameSpecifierVisitKind,
- NS, (void*) R.getBegin().getRawEncoding(),
- (void*) R.getEnd().getRawEncoding()) {}
+ NS, R.getBegin().getPtrEncoding(),
+ R.getEnd().getPtrEncoding()) {}
static bool classof(const VisitorJob *VJ) {
return VJ->getKind() == VisitorJob::NestedNameSpecifierVisitKind;
}
@@ -1583,7 +1583,7 @@
public:
MemberRefVisit(FieldDecl *D, SourceLocation L, CXCursor parent)
: VisitorJob(parent, VisitorJob::MemberRefVisitKind, D,
- (void*) L.getRawEncoding()) {}
+ L.getPtrEncoding()) {}
static bool classof(const VisitorJob *VJ) {
return VJ->getKind() == VisitorJob::MemberRefVisitKind;
}