mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 20:32:21 +00:00
teach PointerLikeTypeTraits that all pointers to pointers may only be 4-byte aligned.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68147 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
bdd376ccb2
commit
f385167b85
@ -58,6 +58,20 @@ public:
|
||||
enum { NumLowBitsAvailable = 3 };
|
||||
};
|
||||
|
||||
// Pointers to pointers are only 4-byte aligned on 32-bit systems.
|
||||
template<typename T>
|
||||
class PointerLikeTypeTraits<T**> {
|
||||
public:
|
||||
static inline void *getAsVoidPointer(T** P) { return P; }
|
||||
static inline T **getFromVoidPointer(void *P) {
|
||||
return static_cast<T**>(P);
|
||||
}
|
||||
enum { NumLowBitsAvailable = 2 };
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
// Provide PointerLikeTypeTraits for uintptr_t.
|
||||
template<>
|
||||
class PointerLikeTypeTraits<uintptr_t> {
|
||||
|
@ -29,17 +29,6 @@ class Use;
|
||||
/// Tag - generic tag type for (at least 32 bit) pointers
|
||||
enum Tag { noTag, tagOne, tagTwo, tagThree };
|
||||
|
||||
// Use** is only 4-byte aligned.
|
||||
template<>
|
||||
class PointerLikeTypeTraits<Use**> {
|
||||
public:
|
||||
static inline void *getAsVoidPointer(Use** P) { return P; }
|
||||
static inline Use **getFromVoidPointer(void *P) {
|
||||
return static_cast<Use**>(P);
|
||||
}
|
||||
enum { NumLowBitsAvailable = 2 };
|
||||
};
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// Use Class
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
Loading…
Reference in New Issue
Block a user