mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-31 09:25:42 +00:00
Add a PointerLikeTypeTraits specialization for uintptr_t
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67985 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -15,6 +15,8 @@
|
|||||||
#ifndef LLVM_SUPPORT_POINTERLIKETYPETRAITS_H
|
#ifndef LLVM_SUPPORT_POINTERLIKETYPETRAITS_H
|
||||||
#define LLVM_SUPPORT_POINTERLIKETYPETRAITS_H
|
#define LLVM_SUPPORT_POINTERLIKETYPETRAITS_H
|
||||||
|
|
||||||
|
#include "llvm/Support/DataTypes.h"
|
||||||
|
|
||||||
namespace llvm {
|
namespace llvm {
|
||||||
|
|
||||||
/// PointerLikeTypeTraits - This is a traits object that is used to handle
|
/// PointerLikeTypeTraits - This is a traits object that is used to handle
|
||||||
@@ -56,6 +58,20 @@ public:
|
|||||||
enum { NumLowBitsAvailable = 3 };
|
enum { NumLowBitsAvailable = 3 };
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Provide PointerLikeTypeTraits for uintptr_t.
|
||||||
|
template<>
|
||||||
|
class PointerLikeTypeTraits<uintptr_t> {
|
||||||
|
public:
|
||||||
|
static inline void *getAsVoidPointer(uintptr_t P) {
|
||||||
|
return reinterpret_cast<void*>(P);
|
||||||
|
}
|
||||||
|
static inline uintptr_t getFromVoidPointer(void *P) {
|
||||||
|
return reinterpret_cast<uintptr_t>(P);
|
||||||
|
}
|
||||||
|
// No bits are available!
|
||||||
|
enum { NumLowBitsAvailable = 0 };
|
||||||
|
};
|
||||||
|
|
||||||
} // end namespace llvm
|
} // end namespace llvm
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user