mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
TypeRefID: Only add high bits of a pointer if on 64-bit
Adding another 0 to the TypeRefID bits is useless on 32-bit platforms.
This commit is contained in:
@@ -56,9 +56,11 @@ public:
|
||||
|
||||
template <typename T>
|
||||
void addPointer(const T *Pointer) {
|
||||
auto Raw = reinterpret_cast<uintptr_t>(Pointer);
|
||||
Bits.push_back((uint32_t)Raw);
|
||||
Bits.push_back(Raw >> 32);
|
||||
auto Raw = reinterpret_cast<uint32_t *>(&Pointer);
|
||||
Bits.push_back(Raw[0]);
|
||||
if (sizeof(const T *) > 4) {
|
||||
Bits.push_back(Raw[1]);
|
||||
}
|
||||
}
|
||||
|
||||
void addInteger(uint32_t Integer) {
|
||||
|
||||
Reference in New Issue
Block a user