[cfe-commits] r70602 - /cfe/trunk/include/clang/AST/Type.h

Chris Lattner sabre at nondot.org
Fri May 1 16:47:59 PDT 2009


Author: lattner
Date: Fri May  1 18:47:59 2009
New Revision: 70602

URL: http://llvm.org/viewvc/llvm-project?rev=70602&view=rev
Log:
explicitly know that the alignment of Type* is 3 bits.

Modified:
    cfe/trunk/include/clang/AST/Type.h

Modified: cfe/trunk/include/clang/AST/Type.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Type.h?rev=70602&r1=70601&r2=70602&view=diff

==============================================================================
--- cfe/trunk/include/clang/AST/Type.h (original)
+++ cfe/trunk/include/clang/AST/Type.h Fri May  1 18:47:59 2009
@@ -29,15 +29,24 @@
 using llvm::cast_or_null;
 using llvm::dyn_cast;
 using llvm::dyn_cast_or_null;
+namespace clang { class Type; }
 
 namespace llvm {
   template <typename T>
   class PointerLikeTypeTraits;
+  template<>
+  class PointerLikeTypeTraits< ::clang::Type*> {
+  public:
+    static inline void *getAsVoidPointer(::clang::Type *P) { return P; }
+    static inline ::clang::Type *getFromVoidPointer(void *P) {
+      return static_cast< ::clang::Type*>(P);
+    }
+    enum { NumLowBitsAvailable = 3 };
+  };
 }
 
 namespace clang {
   class ASTContext;
-  class Type;
   class TypedefDecl;
   class TemplateDecl;
   class TemplateTypeParmDecl;





More information about the cfe-commits mailing list