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
diff --git a/include/clang/AST/DeclContextInternals.h b/include/clang/AST/DeclContextInternals.h
index 2a4b12a..9602b67 100644
--- a/include/clang/AST/DeclContextInternals.h
+++ b/include/clang/AST/DeclContextInternals.h
@@ -156,7 +156,8 @@
   /// 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 fb8d4d5..075838d 100644
--- a/include/clang/Analysis/ProgramPoint.h
+++ b/include/clang/Analysis/ProgramPoint.h
@@ -59,7 +59,7 @@
 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 dfbb301..e9a20b7 100644
--- a/include/clang/Parse/Ownership.h
+++ b/include/clang/Parse/Ownership.h
@@ -403,8 +403,10 @@
 
     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 @@
       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 b5aec0c..42a3726 100644
--- a/lib/AST/DeclBase.cpp
+++ b/lib/AST/DeclBase.cpp
@@ -811,12 +811,12 @@
     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 b7b48d7..13b2c20 100644
--- a/lib/Checker/GRExprEngine.cpp
+++ b/lib/Checker/GRExprEngine.cpp
@@ -1970,7 +1970,7 @@
 //===----------------------------------------------------------------------===//
 
 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) {