summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2012-01-20 16:39:46 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2012-01-20 16:39:46 +0000
commit528f56c93fc6a80f1827da2c4128c497d1dcbe37 (patch)
treed03859f11532ab9d61d0e190f380e35aebb51406 /llvm
parent4d08ccb2d5e568cd27e0a368af655a1b0185acae (diff)
downloadbcm5719-llvm-528f56c93fc6a80f1827da2c4128c497d1dcbe37.tar.gz
bcm5719-llvm-528f56c93fc6a80f1827da2c4128c497d1dcbe37.zip
Protect SmallVectorImpl's constructor and a few other methods that aren't meant to be public.
llvm-svn: 148550
Diffstat (limited to 'llvm')
-rw-r--r--llvm/include/llvm/ADT/SmallVector.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/llvm/include/llvm/ADT/SmallVector.h b/llvm/include/llvm/ADT/SmallVector.h
index 1c42f29771b..30fc424a1d0 100644
--- a/llvm/include/llvm/ADT/SmallVector.h
+++ b/llvm/include/llvm/ADT/SmallVector.h
@@ -100,10 +100,10 @@ public:
template <typename T>
class SmallVectorTemplateCommon : public SmallVectorBase {
protected:
- void setEnd(T *P) { this->EndX = P; }
-public:
SmallVectorTemplateCommon(size_t Size) : SmallVectorBase(Size) {}
+ void setEnd(T *P) { this->EndX = P; }
+public:
typedef size_t size_type;
typedef ptrdiff_t difference_type;
typedef T value_type;
@@ -174,7 +174,7 @@ public:
/// implementations that are designed to work with non-POD-like T's.
template <typename T, bool isPodLike>
class SmallVectorTemplateBase : public SmallVectorTemplateCommon<T> {
-public:
+protected:
SmallVectorTemplateBase(size_t Size) : SmallVectorTemplateCommon<T>(Size) {}
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.
template <typename T>
class SmallVectorTemplateBase<T, true> : public SmallVectorTemplateCommon<T> {
-public:
+protected:
SmallVectorTemplateBase(size_t Size) : SmallVectorTemplateCommon<T>(Size) {}
// No need to do a destroy loop for POD's.
@@ -270,11 +270,13 @@ public:
typedef typename SuperClass::iterator iterator;
typedef typename SuperClass::size_type size_type;
+protected:
// Default ctor - Initialize to empty.
explicit SmallVectorImpl(unsigned N)
: SmallVectorTemplateBase<T, isPodLike<T>::value>(N*sizeof(T)) {
}
+public:
~SmallVectorImpl() {
// Destroy the constructed elements in the vector.
this->destroy_range(this->begin(), this->end());
OpenPOWER on IntegriCloud