[cfe-commits] r103458 - in /cfe/trunk: include/clang/AST/DeclContextInternals.h include/clang/Analysis/ProgramPoint.h include/clang/Parse/Ownership.h lib/AST/DeclBase.cpp lib/Checker/GRExprEngine.cpp

Douglas Gregor dgregor at apple.com
Mon May 10 23:18:17 PDT 2010


Author: dgregor
Date: Tue May 11 01:18:17 2010
New Revision: 103458

URL: http://llvm.org/viewvc/llvm-project?rev=103458&view=rev
Log:
Fixes for compilation with Microsoft Visual Studio 2010, from Steven Watanabe!

Modified:
    cfe/trunk/include/clang/AST/DeclContextInternals.h
    cfe/trunk/include/clang/Analysis/ProgramPoint.h
    cfe/trunk/include/clang/Parse/Ownership.h
    cfe/trunk/lib/AST/DeclBase.cpp
    cfe/trunk/lib/Checker/GRExprEngine.cpp

Modified: cfe/trunk/include/clang/AST/DeclContextInternals.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/DeclContextInternals.h?rev=103458&r1=103457&r2=103458&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/DeclContextInternals.h (original)
+++ cfe/trunk/include/clang/AST/DeclContextInternals.h Tue May 11 01:18:17 2010
@@ -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);

Modified: cfe/trunk/include/clang/Analysis/ProgramPoint.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Analysis/ProgramPoint.h?rev=103458&r1=103457&r2=103458&view=diff
==============================================================================
--- cfe/trunk/include/clang/Analysis/ProgramPoint.h (original)
+++ cfe/trunk/include/clang/Analysis/ProgramPoint.h Tue May 11 01:18:17 2010
@@ -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)

Modified: cfe/trunk/include/clang/Parse/Ownership.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Parse/Ownership.h?rev=103458&r1=103457&r2=103458&view=diff
==============================================================================
--- cfe/trunk/include/clang/Parse/Ownership.h (original)
+++ cfe/trunk/include/clang/Parse/Ownership.h Tue May 11 01:18:17 2010
@@ -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();

Modified: cfe/trunk/lib/AST/DeclBase.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/DeclBase.cpp?rev=103458&r1=103457&r2=103458&view=diff
==============================================================================
--- cfe/trunk/lib/AST/DeclBase.cpp (original)
+++ cfe/trunk/lib/AST/DeclBase.cpp Tue May 11 01:18:17 2010
@@ -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());
 }
 

Modified: cfe/trunk/lib/Checker/GRExprEngine.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Checker/GRExprEngine.cpp?rev=103458&r1=103457&r2=103458&view=diff
==============================================================================
--- cfe/trunk/lib/Checker/GRExprEngine.cpp (original)
+++ cfe/trunk/lib/Checker/GRExprEngine.cpp Tue May 11 01:18:17 2010
@@ -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) {





More information about the cfe-commits mailing list