llvm.org GIT mirror llvm / 4318fc5
Rename llvm::Optional<T>::Reset to 'reset' as per LLVM naming conventions. Code review feedback on r175580 from Jordan Rose. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175595 91177308-0d34-0410-b5e6-96231b3b80d8 David Blaikie 6 years ago
2 changed file(s) with 4 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
6161
6262 Optional &operator=(const Optional &O) {
6363 if (!O)
64 Reset();
64 reset();
6565 else
6666 *this = *O;
6767 return *this;
6868 }
6969
70 void Reset() {
70 void reset() {
7171 if (hasVal) {
7272 (*this)->~T();
7373 hasVal = false;
7575 }
7676
7777 ~Optional() {
78 Reset();
78 reset();
7979 }
8080
8181 const T* getPointer() const { assert(hasVal); return reinterpret_cast(storage.buffer); }
5555 EXPECT_EQ(0u, NonDefaultConstructible::CopyAssignments);
5656 EXPECT_EQ(1u, NonDefaultConstructible::Destructions);
5757 NonDefaultConstructible::ResetCounts();
58 O.Reset();
58 O.reset();
5959 EXPECT_EQ(0u, NonDefaultConstructible::CopyConstructions);
6060 EXPECT_EQ(0u, NonDefaultConstructible::CopyAssignments);
6161 EXPECT_EQ(1u, NonDefaultConstructible::Destructions);