mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-09 11:25:55 +00:00
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
This commit is contained in:
@@ -62,13 +62,13 @@ public:
|
|||||||
|
|
||||||
Optional &operator=(const Optional &O) {
|
Optional &operator=(const Optional &O) {
|
||||||
if (!O)
|
if (!O)
|
||||||
Reset();
|
reset();
|
||||||
else
|
else
|
||||||
*this = *O;
|
*this = *O;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Reset() {
|
void reset() {
|
||||||
if (hasVal) {
|
if (hasVal) {
|
||||||
(*this)->~T();
|
(*this)->~T();
|
||||||
hasVal = false;
|
hasVal = false;
|
||||||
@@ -76,7 +76,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
~Optional() {
|
~Optional() {
|
||||||
Reset();
|
reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
const T* getPointer() const { assert(hasVal); return reinterpret_cast<const T*>(storage.buffer); }
|
const T* getPointer() const { assert(hasVal); return reinterpret_cast<const T*>(storage.buffer); }
|
||||||
|
@@ -56,7 +56,7 @@ TEST_F(OptionalTest, ResetTest) {
|
|||||||
EXPECT_EQ(0u, NonDefaultConstructible::CopyAssignments);
|
EXPECT_EQ(0u, NonDefaultConstructible::CopyAssignments);
|
||||||
EXPECT_EQ(1u, NonDefaultConstructible::Destructions);
|
EXPECT_EQ(1u, NonDefaultConstructible::Destructions);
|
||||||
NonDefaultConstructible::ResetCounts();
|
NonDefaultConstructible::ResetCounts();
|
||||||
O.Reset();
|
O.reset();
|
||||||
EXPECT_EQ(0u, NonDefaultConstructible::CopyConstructions);
|
EXPECT_EQ(0u, NonDefaultConstructible::CopyConstructions);
|
||||||
EXPECT_EQ(0u, NonDefaultConstructible::CopyAssignments);
|
EXPECT_EQ(0u, NonDefaultConstructible::CopyAssignments);
|
||||||
EXPECT_EQ(1u, NonDefaultConstructible::Destructions);
|
EXPECT_EQ(1u, NonDefaultConstructible::Destructions);
|
||||||
|
Reference in New Issue
Block a user