From 822147fcb22d4481278bd3d6d99a392f9715faf8 Mon Sep 17 00:00:00 2001 From: Benjamin Kramer Date: Sat, 11 Apr 2015 18:57:14 +0000 Subject: [PATCH] Mark empty default constructors as =default if it makes the type POD NFC git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234694 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/ADT/EpochTracker.h | 2 +- include/llvm/ADT/Hashing.h | 2 +- include/llvm/ADT/iterator.h | 4 ++-- include/llvm/Support/FileSystem.h | 2 +- lib/Transforms/Instrumentation/GCOVProfiling.cpp | 2 +- lib/Transforms/Scalar/LoadCombine.cpp | 2 +- lib/Transforms/Scalar/LoopStrengthReduce.cpp | 2 -- tools/yaml2obj/yaml2coff.cpp | 5 +---- 8 files changed, 8 insertions(+), 13 deletions(-) diff --git a/include/llvm/ADT/EpochTracker.h b/include/llvm/ADT/EpochTracker.h index d593073317b..582d58179d1 100644 --- a/include/llvm/ADT/EpochTracker.h +++ b/include/llvm/ADT/EpochTracker.h @@ -30,7 +30,7 @@ public: class HandleBase { public: - HandleBase() {} + HandleBase() = default; explicit HandleBase(const DebugEpochBase *) {} bool isHandleInSync() const { return true; } const void *getEpochAddress() const { return nullptr; } diff --git a/include/llvm/ADT/Hashing.h b/include/llvm/ADT/Hashing.h index a1e78642e94..77e6d77b1b8 100644 --- a/include/llvm/ADT/Hashing.h +++ b/include/llvm/ADT/Hashing.h @@ -75,7 +75,7 @@ class hash_code { public: /// \brief Default construct a hash_code. /// Note that this leaves the value uninitialized. - hash_code() {} + hash_code() = default; /// \brief Form a hash code directly from a numerical value. hash_code(size_t value) : value(value) {} diff --git a/include/llvm/ADT/iterator.h b/include/llvm/ADT/iterator.h index e2c9e5ea6bd..54a288df017 100644 --- a/include/llvm/ADT/iterator.h +++ b/include/llvm/ADT/iterator.h @@ -150,7 +150,7 @@ class iterator_adaptor_base protected: WrappedIteratorT I; - iterator_adaptor_base() {} + iterator_adaptor_base() = default; template explicit iterator_adaptor_base( @@ -231,7 +231,7 @@ struct pointee_iterator pointee_iterator, WrappedIteratorT, typename std::iterator_traits::iterator_category, T> { - pointee_iterator() {} + pointee_iterator() = default; template pointee_iterator(U &&u) : pointee_iterator::iterator_adaptor_base(std::forward(u)) {} diff --git a/include/llvm/Support/FileSystem.h b/include/llvm/Support/FileSystem.h index b3b44c46653..a736c324f8a 100644 --- a/include/llvm/Support/FileSystem.h +++ b/include/llvm/Support/FileSystem.h @@ -120,7 +120,7 @@ class UniqueID { uint64_t File; public: - UniqueID() {} + UniqueID() = default; UniqueID(uint64_t Device, uint64_t File) : Device(Device), File(File) {} bool operator==(const UniqueID &Other) const { return Device == Other.Device && File == Other.File; diff --git a/lib/Transforms/Instrumentation/GCOVProfiling.cpp b/lib/Transforms/Instrumentation/GCOVProfiling.cpp index 129afe2a931..b94124fb2f6 100644 --- a/lib/Transforms/Instrumentation/GCOVProfiling.cpp +++ b/lib/Transforms/Instrumentation/GCOVProfiling.cpp @@ -163,7 +163,7 @@ namespace { static const char *const BlockTag; static const char *const EdgeTag; - GCOVRecord() {} + GCOVRecord() = default; void writeBytes(const char *Bytes, int Size) { os->write(Bytes, Size); diff --git a/lib/Transforms/Scalar/LoadCombine.cpp b/lib/Transforms/Scalar/LoadCombine.cpp index 1f33f72d302..c19cd19059b 100644 --- a/lib/Transforms/Scalar/LoadCombine.cpp +++ b/lib/Transforms/Scalar/LoadCombine.cpp @@ -41,9 +41,9 @@ struct PointerOffsetPair { }; struct LoadPOPPair { + LoadPOPPair() = default; LoadPOPPair(LoadInst *L, PointerOffsetPair P, unsigned O) : Load(L), POP(P), InsertOrder(O) {} - LoadPOPPair() {} LoadInst *Load; PointerOffsetPair POP; /// \brief The new load needs to be created before the first load in IR order. diff --git a/lib/Transforms/Scalar/LoopStrengthReduce.cpp b/lib/Transforms/Scalar/LoopStrengthReduce.cpp index 31878d3a85b..099f227af55 100644 --- a/lib/Transforms/Scalar/LoopStrengthReduce.cpp +++ b/lib/Transforms/Scalar/LoopStrengthReduce.cpp @@ -112,8 +112,6 @@ public: /// a particular register. SmallBitVector UsedByIndices; - RegSortData() {} - void print(raw_ostream &OS) const; void dump() const; }; diff --git a/tools/yaml2obj/yaml2coff.cpp b/tools/yaml2obj/yaml2coff.cpp index 6939bc4a345..61d98519255 100644 --- a/tools/yaml2obj/yaml2coff.cpp +++ b/tools/yaml2obj/yaml2coff.cpp @@ -253,10 +253,7 @@ binary_le_impl binary_le(value_type V) { return binary_le_impl(V); } -template -struct zeros_impl { - zeros_impl() {} -}; +template struct zeros_impl {}; template raw_ostream &operator<<(raw_ostream &OS, const zeros_impl &) {