diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-05-11 06:18:17 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-05-11 06:18:17 +0000 |
commit | a5fdd9ce694b1c2dbfd225cb6f55ef743d1ab562 (patch) | |
tree | 6df62f8206c22b3ac2b4c4603480eb126dbec893 | |
parent | f8e10a5d408b59946ce66edbaba251f0c6f16d60 (diff) |
Fixes for compilation with Microsoft Visual Studio 2010, from Steven Watanabe!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103458 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/clang/AST/DeclContextInternals.h | 3 | ||||
-rw-r--r-- | include/clang/Analysis/ProgramPoint.h | 2 | ||||
-rw-r--r-- | include/clang/Parse/Ownership.h | 15 | ||||
-rw-r--r-- | lib/AST/DeclBase.cpp | 4 | ||||
-rw-r--r-- | lib/Checker/GRExprEngine.cpp | 2 |
5 files changed, 21 insertions, 5 deletions
diff --git a/include/clang/AST/DeclContextInternals.h b/include/clang/AST/DeclContextInternals.h index 2a4b12ac2e..9602b677fc 100644 --- a/include/clang/AST/DeclContextInternals.h +++ b/include/clang/AST/DeclContextInternals.h @@ -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); diff --git a/include/clang/Analysis/ProgramPoint.h b/include/clang/Analysis/ProgramPoint.h index fb8d4d5ff5..075838d45e 100644 --- a/include/clang/Analysis/ProgramPoint.h +++ b/include/clang/Analysis/ProgramPoint.h @@ -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) diff --git a/include/clang/Parse/Ownership.h b/include/clang/Parse/Ownership.h index dfbb301f3b..e9a20b7872 100644 --- a/include/clang/Parse/Ownership.h +++ b/include/clang/Parse/Ownership.h @@ -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(); diff --git a/lib/AST/DeclBase.cpp b/lib/AST/DeclBase.cpp index b5aec0c512..42a3726320 100644 --- a/lib/AST/DeclBase.cpp +++ b/lib/AST/DeclBase.cpp @@ -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()); } diff --git a/lib/Checker/GRExprEngine.cpp b/lib/Checker/GRExprEngine.cpp index b7b48d70de..13b2c20458 100644 --- a/lib/Checker/GRExprEngine.cpp +++ b/lib/Checker/GRExprEngine.cpp @@ -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) { |