mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-15 07:34:33 +00:00
Protect SmallVectorImpl's constructor and a few other methods that aren't meant to be public.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148550 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
eb9fa666f9
commit
3feccbaaee
@ -100,10 +100,10 @@ public:
|
|||||||
template <typename T>
|
template <typename T>
|
||||||
class SmallVectorTemplateCommon : public SmallVectorBase {
|
class SmallVectorTemplateCommon : public SmallVectorBase {
|
||||||
protected:
|
protected:
|
||||||
void setEnd(T *P) { this->EndX = P; }
|
|
||||||
public:
|
|
||||||
SmallVectorTemplateCommon(size_t Size) : SmallVectorBase(Size) {}
|
SmallVectorTemplateCommon(size_t Size) : SmallVectorBase(Size) {}
|
||||||
|
|
||||||
|
void setEnd(T *P) { this->EndX = P; }
|
||||||
|
public:
|
||||||
typedef size_t size_type;
|
typedef size_t size_type;
|
||||||
typedef ptrdiff_t difference_type;
|
typedef ptrdiff_t difference_type;
|
||||||
typedef T value_type;
|
typedef T value_type;
|
||||||
@ -174,7 +174,7 @@ public:
|
|||||||
/// implementations that are designed to work with non-POD-like T's.
|
/// implementations that are designed to work with non-POD-like T's.
|
||||||
template <typename T, bool isPodLike>
|
template <typename T, bool isPodLike>
|
||||||
class SmallVectorTemplateBase : public SmallVectorTemplateCommon<T> {
|
class SmallVectorTemplateBase : public SmallVectorTemplateCommon<T> {
|
||||||
public:
|
protected:
|
||||||
SmallVectorTemplateBase(size_t Size) : SmallVectorTemplateCommon<T>(Size) {}
|
SmallVectorTemplateBase(size_t Size) : SmallVectorTemplateCommon<T>(Size) {}
|
||||||
|
|
||||||
static void destroy_range(T *S, T *E) {
|
static void destroy_range(T *S, T *E) {
|
||||||
@ -226,7 +226,7 @@ void SmallVectorTemplateBase<T, isPodLike>::grow(size_t MinSize) {
|
|||||||
/// implementations that are designed to work with POD-like T's.
|
/// implementations that are designed to work with POD-like T's.
|
||||||
template <typename T>
|
template <typename T>
|
||||||
class SmallVectorTemplateBase<T, true> : public SmallVectorTemplateCommon<T> {
|
class SmallVectorTemplateBase<T, true> : public SmallVectorTemplateCommon<T> {
|
||||||
public:
|
protected:
|
||||||
SmallVectorTemplateBase(size_t Size) : SmallVectorTemplateCommon<T>(Size) {}
|
SmallVectorTemplateBase(size_t Size) : SmallVectorTemplateCommon<T>(Size) {}
|
||||||
|
|
||||||
// No need to do a destroy loop for POD's.
|
// No need to do a destroy loop for POD's.
|
||||||
@ -270,11 +270,13 @@ public:
|
|||||||
typedef typename SuperClass::iterator iterator;
|
typedef typename SuperClass::iterator iterator;
|
||||||
typedef typename SuperClass::size_type size_type;
|
typedef typename SuperClass::size_type size_type;
|
||||||
|
|
||||||
|
protected:
|
||||||
// Default ctor - Initialize to empty.
|
// Default ctor - Initialize to empty.
|
||||||
explicit SmallVectorImpl(unsigned N)
|
explicit SmallVectorImpl(unsigned N)
|
||||||
: SmallVectorTemplateBase<T, isPodLike<T>::value>(N*sizeof(T)) {
|
: SmallVectorTemplateBase<T, isPodLike<T>::value>(N*sizeof(T)) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public:
|
||||||
~SmallVectorImpl() {
|
~SmallVectorImpl() {
|
||||||
// Destroy the constructed elements in the vector.
|
// Destroy the constructed elements in the vector.
|
||||||
this->destroy_range(this->begin(), this->end());
|
this->destroy_range(this->begin(), this->end());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user