From: Chris Lattner Date: Fri, 3 Apr 2009 18:23:42 +0000 (+0000) Subject: Fix Clang on VC++, patch by Bixia Zheng! X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ff9b446dd1db0ed3a89403373df83b0da81dc6f5;p=clang Fix Clang on VC++, patch by Bixia Zheng! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68394 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Parse/Ownership.h b/include/clang/Parse/Ownership.h index b184abc0a0..f9ba5ea70b 100644 --- a/include/clang/Parse/Ownership.h +++ b/include/clang/Parse/Ownership.h @@ -14,13 +14,15 @@ #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 { + typedef clang::ActionBase* PT; + public: + static inline void *getAsVoidPointer(PT P) { return P; } + static inline PT getFromVoidPointer(void *P) { + return static_cast(P); + } + enum { NumLowBitsAvailable = 2 }; + }; +} -namespace clang -{ +namespace clang { // Basic class DiagnosticBuilder; @@ -739,9 +751,7 @@ namespace clang ASTMultiPtr& move(ASTMultiPtr &ptr) { return ptr; } - #endif - } #endif