[cfe-commits] r68394 - /cfe/trunk/include/clang/Parse/Ownership.h
Chris Lattner
sabre at nondot.org
Fri Apr 3 11:23:42 PDT 2009
Author: lattner
Date: Fri Apr 3 13:23:42 2009
New Revision: 68394
URL: http://llvm.org/viewvc/llvm-project?rev=68394&view=rev
Log:
Fix Clang on VC++, patch by Bixia Zheng!
Modified:
cfe/trunk/include/clang/Parse/Ownership.h
Modified: cfe/trunk/include/clang/Parse/Ownership.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Parse/Ownership.h?rev=68394&r1=68393&r2=68394&view=diff
==============================================================================
--- cfe/trunk/include/clang/Parse/Ownership.h (original)
+++ cfe/trunk/include/clang/Parse/Ownership.h Fri Apr 3 13:23:42 2009
@@ -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 @@
// 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 @@
ASTMultiPtr<Destroyer>& move(ASTMultiPtr<Destroyer> &ptr) {
return ptr;
}
-
#endif
-
}
#endif
More information about the cfe-commits
mailing list