From b4c28fc93f5149a0bd7967af44c429412e751c56 Mon Sep 17 00:00:00 2001 From: Chandler Carruth Date: Tue, 31 Jul 2012 04:13:57 +0000 Subject: [PATCH] Clean up trailing whitespace and unnecessary blank lines. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161025 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/ADT/TinyPtrVector.h | 34 +++++++++++++++----------------- 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/include/llvm/ADT/TinyPtrVector.h b/include/llvm/ADT/TinyPtrVector.h index ca624c6c541..a02c10edf72 100644 --- a/include/llvm/ADT/TinyPtrVector.h +++ b/include/llvm/ADT/TinyPtrVector.h @@ -30,7 +30,7 @@ public: typedef typename VecTy::value_type value_type; llvm::PointerUnion Val; - + TinyPtrVector() {} TinyPtrVector(const TinyPtrVector &RHS) : Val(RHS.Val) { if (VecTy *V = Val.template dyn_cast()) @@ -45,7 +45,7 @@ public: if (VecTy *V = Val.template dyn_cast()) delete V; } - + // implicit conversion operator to ArrayRef. operator ArrayRef() const { if (Val.isNull()) @@ -54,7 +54,7 @@ public: return *Val.getAddrOfPtr1(); return *Val.template get(); } - + bool empty() const { // This vector can be empty if it contains no element, or if it // contains a pointer to an empty vector. @@ -63,7 +63,7 @@ public: return Vec->empty(); return false; } - + unsigned size() const { if (empty()) return 0; @@ -71,21 +71,21 @@ public: return 1; return Val.template get()->size(); } - + typedef const EltTy *const_iterator; typedef EltTy *iterator; iterator begin() { if (Val.template is()) return Val.getAddrOfPtr1(); - + return Val.template get()->begin(); } iterator end() { if (Val.template is()) return begin() + (Val.isNull() ? 0 : 1); - + return Val.template get()->end(); } @@ -103,19 +103,19 @@ public: assert(i == 0 && "tinyvector index out of range"); return V; } - - assert(i < Val.template get()->size() && + + assert(i < Val.template get()->size() && "tinyvector index out of range"); return (*Val.template get())[i]; } - + EltTy front() const { assert(!empty() && "vector empty"); if (EltTy V = Val.template dyn_cast()) return V; return Val.template get()->front(); } - + EltTy back() const { assert(!empty() && "vector empty"); if (EltTy V = Val.template dyn_cast()) @@ -123,26 +123,25 @@ public: return Val.template get()->back(); } - void push_back(EltTy NewVal) { assert(NewVal != 0 && "Can't add a null value"); - + // If we have nothing, add something. if (Val.isNull()) { Val = NewVal; return; } - + // If we have a single value, convert to a vector. if (EltTy V = Val.template dyn_cast()) { Val = new VecTy(); Val.template get()->push_back(V); } - + // Add the new value, we know we have a vector. Val.template get()->push_back(NewVal); } - + void pop_back() { // If we have a single value, convert to empty. if (Val.template is()) @@ -151,7 +150,6 @@ public: Vec->pop_back(); } - void clear() { // If we have a single value, convert to empty. if (Val.template is()) { @@ -175,7 +173,7 @@ public: } return end(); } - + private: void operator=(const TinyPtrVector&); // NOT IMPLEMENTED YET. #if LLVM_USE_RVALUE_REFERENCES -- 2.34.1