[llvm] r273670 - Revert r273664
Hubert Tong via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 24 05:25:15 PDT 2016
Author: hubert.reinterpretcast
Date: Fri Jun 24 07:25:15 2016
New Revision: 273670
URL: http://llvm.org/viewvc/llvm-project?rev=273670&view=rev
Log:
Revert r273664
Revert change until build issues with MSVC can be resolved.
Modified:
llvm/trunk/include/llvm/Support/TrailingObjects.h
Modified: llvm/trunk/include/llvm/Support/TrailingObjects.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/TrailingObjects.h?rev=273670&r1=273669&r2=273670&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/TrailingObjects.h (original)
+++ llvm/trunk/include/llvm/Support/TrailingObjects.h Fri Jun 24 07:25:15 2016
@@ -342,50 +342,6 @@ public:
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<void *>::with_counts<1u>::type myStackObjStorage;
- /// MyObj::FixedSizeStorageOwner
- /// myStackObjOwner(new ((void *)&myStackObjStorage) MyObj);
- /// MyObj *const myStackObjPtr = myStackObjOwner.get();
- ///
- /// \endcode
- template <typename... Tys> struct FixedSizeStorage {
- template <size_t... Counts> struct with_counts {
- typedef llvm::AlignedCharArray<
- llvm::AlignOf<BaseTy>::Alignment, totalSizeToAlloc<Tys...>(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
More information about the llvm-commits
mailing list