diff options
author | Kazu Hirata <kazu@google.com> | 2022-07-23 10:50:26 -0700 |
---|---|---|
committer | Kazu Hirata <kazu@google.com> | 2022-07-23 10:50:27 -0700 |
commit | 71cdb8c6f144b8f78fed1f39dc6b9c153f9023c1 (patch) | |
tree | 1990c574f4c8c672aa63fa7e3bc95a8ddbf37edb /llvm/include | |
parent | a9782fead3205fbcd8512acc057820e4235d8131 (diff) | |
download | llvm-71cdb8c6f144b8f78fed1f39dc6b9c153f9023c1.zip llvm-71cdb8c6f144b8f78fed1f39dc6b9c153f9023c1.tar.gz llvm-71cdb8c6f144b8f78fed1f39dc6b9c153f9023c1.tar.bz2 |
[ADT] Use default member initialization (NFC)
Identified with modernize-use-default-member-init.
Diffstat (limited to 'llvm/include')
-rw-r--r-- | llvm/include/llvm/ADT/APInt.h | 4 | ||||
-rw-r--r-- | llvm/include/llvm/ADT/APSInt.h | 4 | ||||
-rw-r--r-- | llvm/include/llvm/ADT/BitVector.h | 4 | ||||
-rw-r--r-- | llvm/include/llvm/ADT/EpochTracker.h | 6 | ||||
-rw-r--r-- | llvm/include/llvm/ADT/IntEqClasses.h | 4 | ||||
-rw-r--r-- | llvm/include/llvm/ADT/Triple.h | 14 |
6 files changed, 18 insertions, 18 deletions
diff --git a/llvm/include/llvm/ADT/APInt.h b/llvm/include/llvm/ADT/APInt.h index 4155cb2..5bdc154 100644 --- a/llvm/include/llvm/ADT/APInt.h +++ b/llvm/include/llvm/ADT/APInt.h @@ -147,7 +147,7 @@ public: APInt(unsigned numBits, StringRef str, uint8_t radix); /// Default constructor that creates an APInt with a 1-bit zero value. - explicit APInt() : BitWidth(1) { U.VAL = 0; } + explicit APInt() { U.VAL = 0; } /// Copy Constructor. APInt(const APInt &that) : BitWidth(that.BitWidth) { @@ -1824,7 +1824,7 @@ private: uint64_t *pVal; ///< Used to store the >64 bits integer value. } U; - unsigned BitWidth; ///< The number of bits in this APInt. + unsigned BitWidth = 1; ///< The number of bits in this APInt. friend struct DenseMapInfo<APInt, void>; friend class APSInt; diff --git a/llvm/include/llvm/ADT/APSInt.h b/llvm/include/llvm/ADT/APSInt.h index 7b6af43..727d95e 100644 --- a/llvm/include/llvm/ADT/APSInt.h +++ b/llvm/include/llvm/ADT/APSInt.h @@ -21,11 +21,11 @@ namespace llvm { /// An arbitrary precision integer that knows its signedness. class LLVM_NODISCARD APSInt : public APInt { - bool IsUnsigned; + bool IsUnsigned = false; public: /// Default constructor that creates an uninitialized APInt. - explicit APSInt() : IsUnsigned(false) {} + explicit APSInt() = default; /// Create an APSInt with the specified width, default to unsigned. explicit APSInt(uint32_t BitWidth, bool isUnsigned = true) diff --git a/llvm/include/llvm/ADT/BitVector.h b/llvm/include/llvm/ADT/BitVector.h index 9540b39..2ba4857 100644 --- a/llvm/include/llvm/ADT/BitVector.h +++ b/llvm/include/llvm/ADT/BitVector.h @@ -83,7 +83,7 @@ class BitVector { using Storage = SmallVector<BitWord>; Storage Bits; // Actual bits. - unsigned Size; // Size of bitvector in bits. + unsigned Size = 0; // Size of bitvector in bits. public: using size_type = unsigned; @@ -135,7 +135,7 @@ public: } /// BitVector default ctor - Creates an empty bitvector. - BitVector() : Size(0) {} + BitVector() = default; /// BitVector ctor - Creates a bitvector of specified number of bits. All /// bits are initialized to the specified value. diff --git a/llvm/include/llvm/ADT/EpochTracker.h b/llvm/include/llvm/ADT/EpochTracker.h index b46989b..a639d1b 100644 --- a/llvm/include/llvm/ADT/EpochTracker.h +++ b/llvm/include/llvm/ADT/EpochTracker.h @@ -56,11 +56,11 @@ public: /// make an iterator-invalidating modification. /// class HandleBase { - const uint64_t *EpochAddress; - uint64_t EpochAtCreation; + const uint64_t *EpochAddress = nullptr; + uint64_t EpochAtCreation = UINT64_MAX; public: - HandleBase() : EpochAddress(nullptr), EpochAtCreation(UINT64_MAX) {} + HandleBase() = default; explicit HandleBase(const DebugEpochBase *Parent) : EpochAddress(&Parent->Epoch), EpochAtCreation(Parent->Epoch) {} diff --git a/llvm/include/llvm/ADT/IntEqClasses.h b/llvm/include/llvm/ADT/IntEqClasses.h index 84bb58c..9ee8a46 100644 --- a/llvm/include/llvm/ADT/IntEqClasses.h +++ b/llvm/include/llvm/ADT/IntEqClasses.h @@ -35,11 +35,11 @@ class IntEqClasses { /// NumClasses - The number of equivalence classes when compressed, or 0 when /// uncompressed. - unsigned NumClasses; + unsigned NumClasses = 0; public: /// IntEqClasses - Create an equivalence class mapping for 0 .. N-1. - IntEqClasses(unsigned N = 0) : NumClasses(0) { grow(N); } + IntEqClasses(unsigned N = 0) { grow(N); } /// grow - Increase capacity to hold 0 .. N-1, putting new integers in unique /// equivalence classes. diff --git a/llvm/include/llvm/ADT/Triple.h b/llvm/include/llvm/ADT/Triple.h index 9d85a28..ba4584d 100644 --- a/llvm/include/llvm/ADT/Triple.h +++ b/llvm/include/llvm/ADT/Triple.h @@ -283,22 +283,22 @@ private: std::string Data; /// The parsed arch type. - ArchType Arch; + ArchType Arch{}; /// The parsed subarchitecture type. - SubArchType SubArch; + SubArchType SubArch{}; /// The parsed vendor type. - VendorType Vendor; + VendorType Vendor{}; /// The parsed OS type. - OSType OS; + OSType OS{}; /// The parsed Environment type. - EnvironmentType Environment; + EnvironmentType Environment{}; /// The object format type. - ObjectFormatType ObjectFormat; + ObjectFormatType ObjectFormat{}; public: /// @name Constructors @@ -306,7 +306,7 @@ public: /// Default constructor is the same as an empty string and leaves all /// triple fields unknown. - Triple() : Arch(), SubArch(), Vendor(), OS(), Environment(), ObjectFormat() {} + Triple() = default; explicit Triple(const Twine &Str); Triple(const Twine &ArchStr, const Twine &VendorStr, const Twine &OSStr); |