forked from OSchip/llvm-project
[ObjC] Wrap namespace-global structs in an anonymous namespace to avoid ODR violations
<rdar://problem/65537147> Differential Revision: https://reviews.llvm.org/D83796
This commit is contained in:
parent
9b974dfa72
commit
3f2d880a93
|
@ -98,42 +98,46 @@ private:
|
||||||
};
|
};
|
||||||
|
|
||||||
namespace Foundation1010 {
|
namespace Foundation1010 {
|
||||||
struct DataDescriptor_32 {
|
namespace {
|
||||||
uint32_t _used;
|
struct DataDescriptor_32 {
|
||||||
uint32_t _offset;
|
uint32_t _used;
|
||||||
uint32_t _size : 28;
|
uint32_t _offset;
|
||||||
uint64_t _priv1 : 4;
|
uint32_t _size : 28;
|
||||||
uint32_t _priv2;
|
uint64_t _priv1 : 4;
|
||||||
uint32_t _data;
|
uint32_t _priv2;
|
||||||
};
|
uint32_t _data;
|
||||||
|
};
|
||||||
struct DataDescriptor_64 {
|
|
||||||
uint64_t _used;
|
struct DataDescriptor_64 {
|
||||||
uint64_t _offset;
|
uint64_t _used;
|
||||||
uint64_t _size : 60;
|
uint64_t _offset;
|
||||||
uint64_t _priv1 : 4;
|
uint64_t _size : 60;
|
||||||
uint32_t _priv2;
|
uint64_t _priv1 : 4;
|
||||||
uint64_t _data;
|
uint32_t _priv2;
|
||||||
};
|
uint64_t _data;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
using NSArrayMSyntheticFrontEnd =
|
using NSArrayMSyntheticFrontEnd =
|
||||||
GenericNSArrayMSyntheticFrontEnd<DataDescriptor_32, DataDescriptor_64>;
|
GenericNSArrayMSyntheticFrontEnd<DataDescriptor_32, DataDescriptor_64>;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace Foundation1428 {
|
namespace Foundation1428 {
|
||||||
struct DataDescriptor_32 {
|
namespace {
|
||||||
uint32_t _used;
|
struct DataDescriptor_32 {
|
||||||
uint32_t _offset;
|
uint32_t _used;
|
||||||
uint32_t _size;
|
uint32_t _offset;
|
||||||
uint32_t _data;
|
uint32_t _size;
|
||||||
};
|
uint32_t _data;
|
||||||
|
};
|
||||||
struct DataDescriptor_64 {
|
|
||||||
uint64_t _used;
|
struct DataDescriptor_64 {
|
||||||
uint64_t _offset;
|
uint64_t _used;
|
||||||
uint64_t _size;
|
uint64_t _offset;
|
||||||
uint64_t _data;
|
uint64_t _size;
|
||||||
};
|
uint64_t _data;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
using NSArrayMSyntheticFrontEnd =
|
using NSArrayMSyntheticFrontEnd =
|
||||||
GenericNSArrayMSyntheticFrontEnd<DataDescriptor_32, DataDescriptor_64>;
|
GenericNSArrayMSyntheticFrontEnd<DataDescriptor_32, DataDescriptor_64>;
|
||||||
|
|
|
@ -278,64 +278,67 @@ namespace Foundation1100 {
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace Foundation1428 {
|
namespace Foundation1428 {
|
||||||
struct DataDescriptor_32 {
|
namespace {
|
||||||
uint32_t _used : 26;
|
struct DataDescriptor_32 {
|
||||||
uint32_t _kvo : 1;
|
uint32_t _used : 26;
|
||||||
uint32_t _size;
|
uint32_t _kvo : 1;
|
||||||
uint32_t _buffer;
|
uint32_t _size;
|
||||||
uint64_t GetSize() { return _size; }
|
uint32_t _buffer;
|
||||||
};
|
uint64_t GetSize() { return _size; }
|
||||||
|
};
|
||||||
struct DataDescriptor_64 {
|
|
||||||
uint64_t _used : 58;
|
struct DataDescriptor_64 {
|
||||||
uint32_t _kvo : 1;
|
uint64_t _used : 58;
|
||||||
uint64_t _size;
|
uint32_t _kvo : 1;
|
||||||
uint64_t _buffer;
|
uint64_t _size;
|
||||||
uint64_t GetSize() { return _size; }
|
uint64_t _buffer;
|
||||||
};
|
uint64_t GetSize() { return _size; }
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
using NSDictionaryMSyntheticFrontEnd =
|
using NSDictionaryMSyntheticFrontEnd =
|
||||||
GenericNSDictionaryMSyntheticFrontEnd<DataDescriptor_32, DataDescriptor_64>;
|
GenericNSDictionaryMSyntheticFrontEnd<DataDescriptor_32, DataDescriptor_64>;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace Foundation1437 {
|
namespace Foundation1437 {
|
||||||
static const uint64_t NSDictionaryCapacities[] = {
|
namespace {
|
||||||
0, 3, 7, 13, 23, 41, 71, 127, 191, 251, 383, 631, 1087, 1723,
|
static const uint64_t NSDictionaryCapacities[] = {
|
||||||
2803, 4523, 7351, 11959, 19447, 31231, 50683, 81919, 132607,
|
0, 3, 7, 13, 23, 41, 71, 127, 191, 251, 383, 631, 1087, 1723,
|
||||||
214519, 346607, 561109, 907759, 1468927, 2376191, 3845119,
|
2803, 4523, 7351, 11959, 19447, 31231, 50683, 81919, 132607,
|
||||||
6221311, 10066421, 16287743, 26354171, 42641881, 68996069,
|
214519, 346607, 561109, 907759, 1468927, 2376191, 3845119,
|
||||||
111638519, 180634607, 292272623, 472907251
|
6221311, 10066421, 16287743, 26354171, 42641881, 68996069,
|
||||||
};
|
111638519, 180634607, 292272623, 472907251
|
||||||
|
};
|
||||||
static const size_t NSDictionaryNumSizeBuckets = sizeof(NSDictionaryCapacities) / sizeof(uint64_t);
|
|
||||||
|
static const size_t NSDictionaryNumSizeBuckets =
|
||||||
struct DataDescriptor_32 {
|
sizeof(NSDictionaryCapacities) / sizeof(uint64_t);
|
||||||
uint32_t _buffer;
|
|
||||||
uint32_t _muts;
|
struct DataDescriptor_32 {
|
||||||
uint32_t _used : 25;
|
uint32_t _buffer;
|
||||||
uint32_t _kvo : 1;
|
uint32_t _muts;
|
||||||
uint32_t _szidx : 6;
|
uint32_t _used : 25;
|
||||||
|
uint32_t _kvo : 1;
|
||||||
|
uint32_t _szidx : 6;
|
||||||
|
|
||||||
uint64_t GetSize() {
|
uint64_t GetSize() {
|
||||||
return (_szidx) >= NSDictionaryNumSizeBuckets ?
|
return (_szidx) >= NSDictionaryNumSizeBuckets ?
|
||||||
0 : NSDictionaryCapacities[_szidx];
|
0 : NSDictionaryCapacities[_szidx];
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
struct DataDescriptor_64 {
|
struct DataDescriptor_64 {
|
||||||
uint64_t _buffer;
|
uint64_t _buffer;
|
||||||
uint32_t _muts;
|
uint32_t _muts;
|
||||||
uint32_t _used : 25;
|
uint32_t _used : 25;
|
||||||
uint32_t _kvo : 1;
|
uint32_t _kvo : 1;
|
||||||
uint32_t _szidx : 6;
|
uint32_t _szidx : 6;
|
||||||
|
|
||||||
uint64_t GetSize() {
|
uint64_t GetSize() {
|
||||||
return (_szidx) >= NSDictionaryNumSizeBuckets ?
|
return (_szidx) >= NSDictionaryNumSizeBuckets ?
|
||||||
0 : NSDictionaryCapacities[_szidx];
|
0 : NSDictionaryCapacities[_szidx];
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
|
||||||
using NSDictionaryMSyntheticFrontEnd =
|
using NSDictionaryMSyntheticFrontEnd =
|
||||||
GenericNSDictionaryMSyntheticFrontEnd<DataDescriptor_32, DataDescriptor_64>;
|
GenericNSDictionaryMSyntheticFrontEnd<DataDescriptor_32, DataDescriptor_64>;
|
||||||
|
|
Loading…
Reference in New Issue