mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
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
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user