Fixes for compilation with Microsoft Visual Studio 2010, from Steven Watanabe!

llvm-svn: 103458
This commit is contained in:
Douglas Gregor 2010-05-11 06:18:17 +00:00
parent 6739a89117
commit 10dc8aa581
5 changed files with 21 additions and 5 deletions

View File

@ -156,7 +156,8 @@ public:
/// represents.
DeclContext::lookup_result getLookupResult(ASTContext &Context) {
if (isNull())
return DeclContext::lookup_result(0, 0);
return DeclContext::lookup_result(DeclContext::lookup_iterator(0),
DeclContext::lookup_iterator(0));
if (hasDeclarationIDs())
materializeDecls(Context);

View File

@ -59,7 +59,7 @@ private:
protected:
ProgramPoint(const void* P, Kind k, const LocationContext *l,
const void *tag = 0)
: Data(P, NULL), K(k), L(l), Tag(tag) {}
: Data(P, static_cast<const void*>(NULL)), K(k), L(l), Tag(tag) {}
ProgramPoint(const void* P1, const void* P2, Kind k, const LocationContext *l,
const void *tag = 0)

View File

@ -403,8 +403,10 @@ namespace clang {
friend class moving::ASTResultMover<Destroyer>;
#if !(defined(_MSC_VER) && _MSC_VER >= 1600)
ASTOwningResult(ASTOwningResult&); // DO NOT IMPLEMENT
ASTOwningResult& operator =(ASTOwningResult&); // DO NOT IMPLEMENT
#endif
void destroy() {
if (Ptr) {
@ -444,6 +446,19 @@ namespace clang {
return *this;
}
#if defined(_MSC_VER) && _MSC_VER >= 1600
// Emulated move semantics don't work with msvc.
ASTOwningResult(ASTOwningResult &&mover)
: ActionInv(mover.ActionInv),
Ptr(mover.Ptr) {
mover.Ptr = 0;
}
ASTOwningResult &operator=(ASTOwningResult &&mover) {
*this = moving::ASTResultMover<Destroyer>(mover);
return *this;
}
#endif
/// Assignment from a raw pointer. Takes ownership - beware!
ASTOwningResult &operator=(void *raw) {
destroy();

View File

@ -811,12 +811,12 @@ DeclContext::lookup(DeclarationName Name) {
buildLookup(this);
if (!LookupPtr)
return lookup_result(0, 0);
return lookup_result(lookup_iterator(0), lookup_iterator(0));
}
StoredDeclsMap::iterator Pos = LookupPtr->find(Name);
if (Pos == LookupPtr->end())
return lookup_result(0, 0);
return lookup_result(lookup_iterator(0), lookup_iterator(0));
return Pos->second.getLookupResult(getParentASTContext());
}

View File

@ -1970,7 +1970,7 @@ void GRExprEngine::VisitCall(CallExpr* CE, ExplodedNode* Pred,
//===----------------------------------------------------------------------===//
static std::pair<const void*,const void*> EagerlyAssumeTag
= std::pair<const void*,const void*>(&EagerlyAssumeTag,0);
= std::pair<const void*,const void*>(&EagerlyAssumeTag,static_cast<void*>(0));
void GRExprEngine::EvalEagerlyAssume(ExplodedNodeSet &Dst, ExplodedNodeSet &Src,
Expr *Ex) {