1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 04:02:41 +01:00

Removed PointerUnion3 and PointerUnion4 aliases in favor of the variadic template

This commit is contained in:
Dmitri Gribenko 2020-01-14 15:46:13 +01:00
parent b10e6ebb2b
commit fa88faafeb
5 changed files with 8 additions and 18 deletions

View File

@ -272,16 +272,6 @@ struct PointerLikeTypeTraits<PointerUnion<PTs...>> {
PointerUnion<PTs...>::Val)>::NumLowBitsAvailable; PointerUnion<PTs...>::Val)>::NumLowBitsAvailable;
}; };
/// A pointer union of three pointer types. See documentation for PointerUnion
/// for usage.
template <typename PT1, typename PT2, typename PT3>
using PointerUnion3 = PointerUnion<PT1, PT2, PT3>;
/// A pointer union of four pointer types. See documentation for PointerUnion
/// for usage.
template <typename PT1, typename PT2, typename PT3, typename PT4>
using PointerUnion4 = PointerUnion<PT1, PT2, PT3, PT4>;
// Teach DenseMap how to use PointerUnions as keys. // Teach DenseMap how to use PointerUnions as keys.
template <typename ...PTs> struct DenseMapInfo<PointerUnion<PTs...>> { template <typename ...PTs> struct DenseMapInfo<PointerUnion<PTs...>> {
using Union = PointerUnion<PTs...>; using Union = PointerUnion<PTs...>;

View File

@ -61,10 +61,10 @@ private:
/// into relatively small files (often smaller than 2^8 or 2^16 bytes), /// into relatively small files (often smaller than 2^8 or 2^16 bytes),
/// we select the offset vector element type dynamically based on the /// we select the offset vector element type dynamically based on the
/// size of Buffer. /// size of Buffer.
using VariableSizeOffsets = PointerUnion4<std::vector<uint8_t> *, using VariableSizeOffsets = PointerUnion<std::vector<uint8_t> *,
std::vector<uint16_t> *, std::vector<uint16_t> *,
std::vector<uint32_t> *, std::vector<uint32_t> *,
std::vector<uint64_t> *>; std::vector<uint64_t> *>;
/// Vector of offsets into Buffer at which there are line-endings /// Vector of offsets into Buffer at which there are line-endings
/// (lazily populated). Once populated, the '\n' that marks the end of /// (lazily populated). Once populated, the '\n' that marks the end of

View File

@ -1811,7 +1811,7 @@ bool LowerTypeTestsModule::lower() {
// reference them. This is used to partition the set of type identifiers in // reference them. This is used to partition the set of type identifiers in
// the module into disjoint sets. // the module into disjoint sets.
using GlobalClassesTy = EquivalenceClasses< using GlobalClassesTy = EquivalenceClasses<
PointerUnion3<GlobalTypeMember *, Metadata *, ICallBranchFunnel *>>; PointerUnion<GlobalTypeMember *, Metadata *, ICallBranchFunnel *>>;
GlobalClassesTy GlobalClasses; GlobalClassesTy GlobalClasses;
// Verify the type metadata and build a few data structures to let us // Verify the type metadata and build a few data structures to let us

View File

@ -43,7 +43,7 @@ class InputFile {
std::unique_ptr<NativeSession> PdbSession; std::unique_ptr<NativeSession> PdbSession;
object::OwningBinary<object::Binary> CoffObject; object::OwningBinary<object::Binary> CoffObject;
std::unique_ptr<MemoryBuffer> UnknownFile; std::unique_ptr<MemoryBuffer> UnknownFile;
PointerUnion3<PDBFile *, object::COFFObjectFile *, MemoryBuffer *> PdbOrObj; PointerUnion<PDBFile *, object::COFFObjectFile *, MemoryBuffer *> PdbOrObj;
using TypeCollectionPtr = std::unique_ptr<codeview::LazyRandomTypeCollection>; using TypeCollectionPtr = std::unique_ptr<codeview::LazyRandomTypeCollection>;

View File

@ -13,8 +13,8 @@ using namespace llvm;
namespace { namespace {
typedef PointerUnion<int *, float *> PU; typedef PointerUnion<int *, float *> PU;
typedef PointerUnion3<int *, float *, long long *> PU3; typedef PointerUnion<int *, float *, long long *> PU3;
typedef PointerUnion4<int *, float *, long long *, double *> PU4; typedef PointerUnion<int *, float *, long long *, double *> PU4;
struct PointerUnionTest : public testing::Test { struct PointerUnionTest : public testing::Test {
float f; float f;