aboutsummaryrefslogtreecommitdiff
path: root/llvm/unittests/Support
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/unittests/Support')
-rw-r--r--llvm/unittests/Support/AlignOfTest.cpp16
-rw-r--r--llvm/unittests/Support/AllocatorTest.cpp2
-rw-r--r--llvm/unittests/Support/BinaryStreamTest.cpp2
-rw-r--r--llvm/unittests/Support/Casting.cpp10
-rw-r--r--llvm/unittests/Support/InstructionCostTest.cpp2
-rw-r--r--llvm/unittests/Support/OptimizedStructLayoutTest.cpp2
-rw-r--r--llvm/unittests/Support/YAMLIOTest.cpp4
-rw-r--r--llvm/unittests/Support/raw_ostream_proxy_test.cpp2
8 files changed, 19 insertions, 21 deletions
diff --git a/llvm/unittests/Support/AlignOfTest.cpp b/llvm/unittests/Support/AlignOfTest.cpp
index 979f2cf..53358a28 100644
--- a/llvm/unittests/Support/AlignOfTest.cpp
+++ b/llvm/unittests/Support/AlignOfTest.cpp
@@ -79,14 +79,14 @@ struct V8 : V5, virtual V6, V7 { double zz;
double S6::f() { return 0.0; }
float D2::g() { return 0.0f; }
-V1::~V1() {}
-V2::~V2() {}
-V3::~V3() {}
-V4::~V4() {}
-V5::~V5() {}
-V6::~V6() {}
-V7::~V7() {}
-V8::~V8() {}
+V1::~V1() = default;
+V2::~V2() = default;
+V3::~V3() = default;
+V4::~V4() = default;
+V5::~V5() = default;
+V6::~V6() = default;
+V7::~V7() = default;
+V8::~V8() = default;
template <typename M> struct T { M m; };
diff --git a/llvm/unittests/Support/AllocatorTest.cpp b/llvm/unittests/Support/AllocatorTest.cpp
index 1069e43..2337f34 100644
--- a/llvm/unittests/Support/AllocatorTest.cpp
+++ b/llvm/unittests/Support/AllocatorTest.cpp
@@ -235,7 +235,7 @@ class MockSlabAllocator {
static size_t LastSlabSize;
public:
- ~MockSlabAllocator() { }
+ ~MockSlabAllocator() = default;
void *Allocate(size_t Size, size_t /*Alignment*/) {
// Allocate space for the alignment, the slab, and a void* that goes right
diff --git a/llvm/unittests/Support/BinaryStreamTest.cpp b/llvm/unittests/Support/BinaryStreamTest.cpp
index 70cd403..06ed12b 100644
--- a/llvm/unittests/Support/BinaryStreamTest.cpp
+++ b/llvm/unittests/Support/BinaryStreamTest.cpp
@@ -110,7 +110,7 @@ constexpr uint32_t NumStreams = 2 * NumEndians;
class BinaryStreamTest : public testing::Test {
public:
- BinaryStreamTest() {}
+ BinaryStreamTest() = default;
void SetUp() override {
Streams.clear();
diff --git a/llvm/unittests/Support/Casting.cpp b/llvm/unittests/Support/Casting.cpp
index 18327f6..7906750 100644
--- a/llvm/unittests/Support/Casting.cpp
+++ b/llvm/unittests/Support/Casting.cpp
@@ -23,7 +23,7 @@ template <typename T> IllegalCast *cast(...) { return nullptr; }
// with conversion facility
//
struct bar {
- bar() {}
+ bar() = default;
bar(const bar &) = delete;
struct foo *baz();
struct foo *caz();
@@ -36,7 +36,7 @@ struct foo {
};
struct base {
- virtual ~base() {}
+ virtual ~base() = default;
};
struct derived : public base {
@@ -375,12 +375,12 @@ namespace inferred_upcasting {
class Base {
public:
// No classof. We are testing that the upcast is inferred.
- Base() {}
+ Base() = default;
};
class Derived : public Base {
public:
- Derived() {}
+ Derived() = default;
};
// Even with no explicit classof() in Base, we should still be able to cast
@@ -529,7 +529,7 @@ TEST(CastingTest, smart_dyn_cast_or_null) {
#ifndef NDEBUG
namespace assertion_checks {
struct Base {
- virtual ~Base() {}
+ virtual ~Base() = default;
};
struct Derived : public Base {
diff --git a/llvm/unittests/Support/InstructionCostTest.cpp b/llvm/unittests/Support/InstructionCostTest.cpp
index efe8388..5392689 100644
--- a/llvm/unittests/Support/InstructionCostTest.cpp
+++ b/llvm/unittests/Support/InstructionCostTest.cpp
@@ -14,7 +14,7 @@ using namespace llvm;
namespace {
struct CostTest : public testing::Test {
- CostTest() {}
+ CostTest() = default;
};
} // namespace
diff --git a/llvm/unittests/Support/OptimizedStructLayoutTest.cpp b/llvm/unittests/Support/OptimizedStructLayoutTest.cpp
index e8cd5f4..0bcae0d 100644
--- a/llvm/unittests/Support/OptimizedStructLayoutTest.cpp
+++ b/llvm/unittests/Support/OptimizedStructLayoutTest.cpp
@@ -25,7 +25,7 @@ class LayoutTest {
bool Verified = false;
public:
- LayoutTest() {}
+ LayoutTest() = default;
LayoutTest(const LayoutTest &) = delete;
LayoutTest &operator=(const LayoutTest &) = delete;
~LayoutTest() { assert(Verified); }
diff --git a/llvm/unittests/Support/YAMLIOTest.cpp b/llvm/unittests/Support/YAMLIOTest.cpp
index 283e5f8..7446c07 100644
--- a/llvm/unittests/Support/YAMLIOTest.cpp
+++ b/llvm/unittests/Support/YAMLIOTest.cpp
@@ -3221,12 +3221,12 @@ template <> struct TaggedScalarTraits<Scalar> {
template <> struct CustomMappingTraits<Map> {
static void inputOne(IO &IO, StringRef Key, Map &M) {
- IO.mapRequired(Key.str().c_str(), M[Key]);
+ IO.mapRequired(Key, M[Key]);
}
static void output(IO &IO, Map &M) {
for (auto &N : M)
- IO.mapRequired(N.getKey().str().c_str(), N.getValue());
+ IO.mapRequired(N.getKey(), N.getValue());
}
};
diff --git a/llvm/unittests/Support/raw_ostream_proxy_test.cpp b/llvm/unittests/Support/raw_ostream_proxy_test.cpp
index 864dda7..446e64a 100644
--- a/llvm/unittests/Support/raw_ostream_proxy_test.cpp
+++ b/llvm/unittests/Support/raw_ostream_proxy_test.cpp
@@ -40,8 +40,6 @@ public:
bool IsDisplayed = false;
};
-constexpr size_t BufferedNoPwriteSmallVectorStream::PreferredBufferSize;
-
TEST(raw_ostream_proxyTest, write) {
// Besides confirming that "write" works, this test confirms that the proxy
// takes on the buffer from the stream it's proxying, such that writes to the