X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=include%2Fllvm%2FSupport%2FPointerLikeTypeTraits.h;h=8e6659c92fd6400e0dabe07dca78699f6f1a5262;hb=2b762697564ca1e12e0e974e93ceeb4c3420505c;hp=8a8e95f047ee190698d448d6fbf1083b3651fbcd;hpb=8b67f774e9c38b7718b2b300b628388f966df4e0;p=oota-llvm.git diff --git a/include/llvm/Support/PointerLikeTypeTraits.h b/include/llvm/Support/PointerLikeTypeTraits.h index 8a8e95f047e..8e6659c92fd 100644 --- a/include/llvm/Support/PointerLikeTypeTraits.h +++ b/include/llvm/Support/PointerLikeTypeTraits.h @@ -15,10 +15,10 @@ #ifndef LLVM_SUPPORT_POINTERLIKETYPETRAITS_H #define LLVM_SUPPORT_POINTERLIKETYPETRAITS_H -#include "llvm/System/DataTypes.h" +#include "llvm/Support/DataTypes.h" namespace llvm { - + /// PointerLikeTypeTraits - This is a traits object that is used to handle /// pointer types and things that are just wrappers for pointers as a uniform /// entity. @@ -33,12 +33,10 @@ class PointerLikeTypeTraits { template class PointerLikeTypeTraits { public: - static inline void *getAsVoidPointer(T* P) { return P; } - static inline T *getFromVoidPointer(void *P) { - return static_cast(P); - } - - /// Note, we assume here that malloc returns objects at least 8-byte aligned. + static inline void *getAsVoidPointer(T *P) { return P; } + static inline T *getFromVoidPointer(void *P) { return static_cast(P); } + + /// Note, we assume here that malloc returns objects at least 4-byte aligned. /// However, this may be wrong, or pointers may be from something other than /// malloc. In this case, you should specialize this template to reduce this. /// @@ -46,7 +44,7 @@ public: /// this is actually true. enum { NumLowBitsAvailable = 2 }; }; - + // Provide PointerLikeTypeTraits for const pointers. template class PointerLikeTypeTraits { @@ -75,7 +73,7 @@ public: // No bits are available! enum { NumLowBitsAvailable = 0 }; }; - + } // end namespace llvm #endif