From fa88faafeb0d446e823f14583c598cb1afe3b5c2 Mon Sep 17 00:00:00 2001 From: Dmitri Gribenko Date: Tue, 14 Jan 2020 15:46:13 +0100 Subject: [PATCH] Removed PointerUnion3 and PointerUnion4 aliases in favor of the variadic template --- include/llvm/ADT/PointerUnion.h | 10 ---------- include/llvm/Support/SourceMgr.h | 8 ++++---- lib/Transforms/IPO/LowerTypeTests.cpp | 2 +- tools/llvm-pdbutil/InputFile.h | 2 +- unittests/ADT/PointerUnionTest.cpp | 4 ++-- 5 files changed, 8 insertions(+), 18 deletions(-) diff --git a/include/llvm/ADT/PointerUnion.h b/include/llvm/ADT/PointerUnion.h index 2ad96c52751..40b7b000da4 100644 --- a/include/llvm/ADT/PointerUnion.h +++ b/include/llvm/ADT/PointerUnion.h @@ -272,16 +272,6 @@ struct PointerLikeTypeTraits> { PointerUnion::Val)>::NumLowBitsAvailable; }; -/// A pointer union of three pointer types. See documentation for PointerUnion -/// for usage. -template -using PointerUnion3 = PointerUnion; - -/// A pointer union of four pointer types. See documentation for PointerUnion -/// for usage. -template -using PointerUnion4 = PointerUnion; - // Teach DenseMap how to use PointerUnions as keys. template struct DenseMapInfo> { using Union = PointerUnion; diff --git a/include/llvm/Support/SourceMgr.h b/include/llvm/Support/SourceMgr.h index aa6026c23d0..1b005519e5d 100644 --- a/include/llvm/Support/SourceMgr.h +++ b/include/llvm/Support/SourceMgr.h @@ -61,10 +61,10 @@ private: /// into relatively small files (often smaller than 2^8 or 2^16 bytes), /// we select the offset vector element type dynamically based on the /// size of Buffer. - using VariableSizeOffsets = PointerUnion4 *, - std::vector *, - std::vector *, - std::vector *>; + using VariableSizeOffsets = PointerUnion *, + std::vector *, + std::vector *, + std::vector *>; /// Vector of offsets into Buffer at which there are line-endings /// (lazily populated). Once populated, the '\n' that marks the end of diff --git a/lib/Transforms/IPO/LowerTypeTests.cpp b/lib/Transforms/IPO/LowerTypeTests.cpp index c3c498e38f2..fa664966faf 100644 --- a/lib/Transforms/IPO/LowerTypeTests.cpp +++ b/lib/Transforms/IPO/LowerTypeTests.cpp @@ -1811,7 +1811,7 @@ bool LowerTypeTestsModule::lower() { // reference them. This is used to partition the set of type identifiers in // the module into disjoint sets. using GlobalClassesTy = EquivalenceClasses< - PointerUnion3>; + PointerUnion>; GlobalClassesTy GlobalClasses; // Verify the type metadata and build a few data structures to let us diff --git a/tools/llvm-pdbutil/InputFile.h b/tools/llvm-pdbutil/InputFile.h index f25390c971d..a5d2897f560 100644 --- a/tools/llvm-pdbutil/InputFile.h +++ b/tools/llvm-pdbutil/InputFile.h @@ -43,7 +43,7 @@ class InputFile { std::unique_ptr PdbSession; object::OwningBinary CoffObject; std::unique_ptr UnknownFile; - PointerUnion3 PdbOrObj; + PointerUnion PdbOrObj; using TypeCollectionPtr = std::unique_ptr; diff --git a/unittests/ADT/PointerUnionTest.cpp b/unittests/ADT/PointerUnionTest.cpp index 0a88114ede8..3c709baf385 100644 --- a/unittests/ADT/PointerUnionTest.cpp +++ b/unittests/ADT/PointerUnionTest.cpp @@ -13,8 +13,8 @@ using namespace llvm; namespace { typedef PointerUnion PU; -typedef PointerUnion3 PU3; -typedef PointerUnion4 PU4; +typedef PointerUnion PU3; +typedef PointerUnion PU4; struct PointerUnionTest : public testing::Test { float f;