From 6f7eaaad0459ef493a1036872d4cc298369262d1 Mon Sep 17 00:00:00 2001 From: Alexey Samsonov Date: Fri, 30 Oct 2015 18:52:31 +0000 Subject: [PATCH] Revert "Apply modernize-use-default to compiler-rt." This reverts commit r250823. Replacing at least some of empty constructors with "= default" variants is a semantical change which we don't want. E.g. __tsan::ClockBlock contains a union of large arrays, and it's critical for correctness and performance that we don't memset() these arrays in the constructor. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@251717 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/asan/asan_fake_stack.h | 2 +- lib/msan/msan_allocator.h | 2 +- lib/sanitizer_common/sanitizer_bitvector.h | 4 ++-- lib/tsan/rtl/tsan_clock.h | 3 ++- lib/tsan/rtl/tsan_mutex.cc | 5 +++-- lib/tsan/rtl/tsan_report.cc | 5 +++-- lib/tsan/rtl/tsan_rtl_thread.cc | 3 ++- lib/ubsan/ubsan_diag.h | 2 +- 8 files changed, 15 insertions(+), 11 deletions(-) diff --git a/lib/asan/asan_fake_stack.h b/lib/asan/asan_fake_stack.h index bf1a66cb..3b1d9eb3 100644 --- a/lib/asan/asan_fake_stack.h +++ b/lib/asan/asan_fake_stack.h @@ -155,7 +155,7 @@ class FakeStack { void ForEachFakeFrame(RangeIteratorCallback callback, void *arg); private: - FakeStack() = default; + FakeStack() { } static const uptr kFlagsOffset = 4096; // This is were the flags begin. // Must match the number of uses of DEFINE_STACK_MALLOC_FREE_WITH_CLASS_ID COMPILER_CHECK(kNumberOfSizeClasses == 11); diff --git a/lib/msan/msan_allocator.h b/lib/msan/msan_allocator.h index a9a27e10..407942e5 100644 --- a/lib/msan/msan_allocator.h +++ b/lib/msan/msan_allocator.h @@ -26,7 +26,7 @@ struct MsanThreadLocalMallocStorage { private: // These objects are allocated via mmap() and are zero-initialized. - MsanThreadLocalMallocStorage() = default; + MsanThreadLocalMallocStorage() {} }; } // namespace __msan diff --git a/lib/sanitizer_common/sanitizer_bitvector.h b/lib/sanitizer_common/sanitizer_bitvector.h index ef61486b..d8472732 100644 --- a/lib/sanitizer_common/sanitizer_bitvector.h +++ b/lib/sanitizer_common/sanitizer_bitvector.h @@ -87,7 +87,7 @@ class BasicBitVector { // } class Iterator { public: - Iterator() = default; + Iterator() { } explicit Iterator(const BasicBitVector &bv) : bv_(bv) {} bool hasNext() const { return !bv_.empty(); } uptr next() { return bv_.getAndClearFirstOne(); } @@ -273,7 +273,7 @@ class TwoLevelBitVector { // } class Iterator { public: - Iterator() = default; + Iterator() { } explicit Iterator(const TwoLevelBitVector &bv) : bv_(bv), i0_(0), i1_(0) { it1_.clear(); it2_.clear(); diff --git a/lib/tsan/rtl/tsan_clock.h b/lib/tsan/rtl/tsan_clock.h index fd650933..4e352cb8 100644 --- a/lib/tsan/rtl/tsan_clock.h +++ b/lib/tsan/rtl/tsan_clock.h @@ -33,7 +33,8 @@ struct ClockBlock { ClockElem clock[kClockCount]; }; - ClockBlock() = default; + ClockBlock() { + } }; typedef DenseSlabAlloc ClockAlloc; diff --git a/lib/tsan/rtl/tsan_mutex.cc b/lib/tsan/rtl/tsan_mutex.cc index e18f6fa7..9dd24803 100644 --- a/lib/tsan/rtl/tsan_mutex.cc +++ b/lib/tsan/rtl/tsan_mutex.cc @@ -126,8 +126,9 @@ void InitializeMutex() { #endif } -// Rely on zero initialization because some mutexes can be locked before ctor. -InternalDeadlockDetector::InternalDeadlockDetector() = default; +InternalDeadlockDetector::InternalDeadlockDetector() { + // Rely on zero initialization because some mutexes can be locked before ctor. +} #if SANITIZER_DEBUG && !SANITIZER_GO void InternalDeadlockDetector::Lock(MutexType t) { diff --git a/lib/tsan/rtl/tsan_report.cc b/lib/tsan/rtl/tsan_report.cc index 9445c409..f4b06878 100644 --- a/lib/tsan/rtl/tsan_report.cc +++ b/lib/tsan/rtl/tsan_report.cc @@ -67,8 +67,9 @@ ReportMop::ReportMop() : mset(MBlockReportMutex) { } -// FIXME(dvyukov): it must be leaking a lot of memory. -ReportDesc::~ReportDesc() = default; +ReportDesc::~ReportDesc() { + // FIXME(dvyukov): it must be leaking a lot of memory. +} #ifndef SANITIZER_GO diff --git a/lib/tsan/rtl/tsan_rtl_thread.cc b/lib/tsan/rtl/tsan_rtl_thread.cc index a167ce19..66c78cfd 100644 --- a/lib/tsan/rtl/tsan_rtl_thread.cc +++ b/lib/tsan/rtl/tsan_rtl_thread.cc @@ -31,7 +31,8 @@ ThreadContext::ThreadContext(int tid) } #ifndef SANITIZER_GO -ThreadContext::~ThreadContext() = default; +ThreadContext::~ThreadContext() { +} #endif void ThreadContext::OnDead() { diff --git a/lib/ubsan/ubsan_diag.h b/lib/ubsan/ubsan_diag.h index daa5ab2b..2aa62eb7 100644 --- a/lib/ubsan/ubsan_diag.h +++ b/lib/ubsan/ubsan_diag.h @@ -150,7 +150,7 @@ public: /// An individual diagnostic message argument. struct Arg { - Arg() = default; + Arg() {} Arg(const char *String) : Kind(AK_String), String(String) {} Arg(TypeName TN) : Kind(AK_TypeName), String(TN.getName()) {} Arg(UIntMax UInt) : Kind(AK_UInt), UInt(UInt) {}