diff options
author | Chris Lattner <sabre@nondot.org> | 2009-03-29 04:32:37 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-03-29 04:32:37 +0000 |
commit | e30173ac3396510bd0bb26a66fd615ff9083436d (patch) | |
tree | d71f62634bc8d263495a1672c22f32f7611fca73 /include/llvm/Support/PointerLikeTypeTraits.h | |
parent | 8ee1b5e916249d1a64ad8cf99b08a0e160f9d052 (diff) | |
download | llvm-e30173ac3396510bd0bb26a66fd615ff9083436d.tar.gz llvm-e30173ac3396510bd0bb26a66fd615ff9083436d.tar.bz2 llvm-e30173ac3396510bd0bb26a66fd615ff9083436d.tar.xz |
Replace the PointerLikeTypeTraits::getNumLowBitsAvailable
function with a new NumLowBitsAvailable enum, which makes the
value available as an integer constant expression.
Add PointerLikeTypeTraits specializations for Instruction* and
Use** since they are only guaranteed 4-byte aligned.
Enhance PointerIntPair to know about (and enforce) the alignment
specified by PointerLikeTypeTraits. This should allow things
like PointerIntPair<PointerIntPair<void*, 1,bool>, 1, bool>
because the inner one knows that 2 low bits are free.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67979 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Support/PointerLikeTypeTraits.h')
-rw-r--r-- | include/llvm/Support/PointerLikeTypeTraits.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/llvm/Support/PointerLikeTypeTraits.h b/include/llvm/Support/PointerLikeTypeTraits.h index 41b2302381..000919ca10 100644 --- a/include/llvm/Support/PointerLikeTypeTraits.h +++ b/include/llvm/Support/PointerLikeTypeTraits.h @@ -42,7 +42,7 @@ public: /// /// All clients should use assertions to do a run-time check to ensure that /// this is actually true. - static inline unsigned getNumLowBitsAvailable() { return 3; } + enum { NumLowBitsAvailable = 3 }; }; // Provide PointerLikeTypeTraits for const pointers. @@ -53,7 +53,7 @@ public: static inline const T *getFromVoidPointer(const void *P) { return static_cast<const T*>(P); } - static inline unsigned getNumLowBitsAvailable() { return 3; } + enum { NumLowBitsAvailable = 3 }; }; } // end namespace llvm |