]> granicus.if.org Git - clang/commitdiff
Fix Clang on VC++, patch by Bixia Zheng!
authorChris Lattner <sabre@nondot.org>
Fri, 3 Apr 2009 18:23:42 +0000 (18:23 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 3 Apr 2009 18:23:42 +0000 (18:23 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68394 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Parse/Ownership.h

index b184abc0a039a611029469d349581f6b657ba282..f9ba5ea70bc9b7d370a6c21d840e4a567a227600 100644 (file)
 #ifndef LLVM_CLANG_PARSE_OWNERSHIP_H
 #define LLVM_CLANG_PARSE_OWNERSHIP_H
 
-#include "llvm/Support/PointerLikeTypeTraits.h"
+#include "llvm/ADT/PointerIntPair.h"
 
 //===----------------------------------------------------------------------===//
 // OpaquePtr
 //===----------------------------------------------------------------------===//
 
 namespace clang {
+  class ActionBase;
+  
   /// OpaquePtr - This is a very simple POD type that wraps a pointer that the
   /// Parser doesn't know about but that Sema or another client does.  The UID
   /// template argument is used to make sure that "Decl" pointers are not
@@ -165,10 +167,20 @@ namespace llvm {
 // Flip this switch to measure performance impact of the smart pointers.
 //#define DISABLE_SMART_POINTERS
 
-#include "llvm/ADT/PointerIntPair.h"
+namespace llvm {
+  template<>
+  class PointerLikeTypeTraits<clang::ActionBase*> {
+    typedef clang::ActionBase* PT;
+  public:
+    static inline void *getAsVoidPointer(PT P) { return P; }
+    static inline PT getFromVoidPointer(void *P) {
+      return static_cast<PT>(P);
+    }
+    enum { NumLowBitsAvailable = 2 };
+  };
+}
 
-namespace clang
-{
+namespace clang {
   // Basic
   class DiagnosticBuilder;
 
@@ -739,9 +751,7 @@ namespace clang
   ASTMultiPtr<Destroyer>& move(ASTMultiPtr<Destroyer> &ptr) {
     return ptr;
   }
-
 #endif
-
 }
 
 #endif