From 3e2c30d4473e95b5891196051223e88b91d9f68e Mon Sep 17 00:00:00 2001 From: Hubert Tong Date: Fri, 24 Jun 2016 12:25:15 +0000 Subject: [PATCH] Revert r273664 Revert change until build issues with MSVC can be resolved. llvm-svn: 273670 --- llvm/include/llvm/Support/TrailingObjects.h | 44 --------------------- 1 file changed, 44 deletions(-) diff --git a/llvm/include/llvm/Support/TrailingObjects.h b/llvm/include/llvm/Support/TrailingObjects.h index 11a6d157f8425..e28b33dd4d763 100644 --- a/llvm/include/llvm/Support/TrailingObjects.h +++ b/llvm/include/llvm/Support/TrailingObjects.h @@ -342,50 +342,6 @@ class TrailingObjects : private trailing_objects_internal::TrailingObjectsImpl< TrailingTys, size_t>::type... Counts) { return sizeof(BaseTy) + ParentType::additionalSizeToAllocImpl(0, Counts...); } - - /// A type where its ::with_counts template member has a ::type member - /// suitable for use as uninitialized storage for an object with the given - /// trailing object counts. The template arguments are similar to those - /// of additionalSizeToAlloc. - /// - /// Use with FixedSizeStorageOwner, e.g.: - /// - /// \code{.cpp} - /// - /// MyObj::FixedSizeStorage::with_counts<1u>::type myStackObjStorage; - /// MyObj::FixedSizeStorageOwner - /// myStackObjOwner(new ((void *)&myStackObjStorage) MyObj); - /// MyObj *const myStackObjPtr = myStackObjOwner.get(); - /// - /// \endcode - template struct FixedSizeStorage { - template struct with_counts { - typedef llvm::AlignedCharArray< - llvm::AlignOf::Alignment, totalSizeToAlloc(Counts...) - > type; - }; - }; - - /// A type that acts as the owner for an object placed into fixed storage. - class FixedSizeStorageOwner { - public: - FixedSizeStorageOwner(BaseTy *p) : p(p) {} - ~FixedSizeStorageOwner() { - assert(p && "FixedSizeStorageOwner owns null?"); - p->~BaseTy(); - } - - BaseTy *get() { return p; } - const BaseTy *get() const { return p; } - - private: - FixedSizeStorageOwner(const FixedSizeStorageOwner &) = delete; - FixedSizeStorageOwner(FixedSizeStorageOwner &&) = delete; - FixedSizeStorageOwner &operator=(const FixedSizeStorageOwner &) = delete; - FixedSizeStorageOwner &operator=(FixedSizeStorageOwner &&) = delete; - - BaseTy *const p; - }; }; } // end namespace llvm