[Support] Modernize TimeRecord (NFC)
authorKazu Hirata <kazu@google.com>
Sun, 16 Apr 2023 18:40:32 +0000 (11:40 -0700)
committerKazu Hirata <kazu@google.com>
Sun, 16 Apr 2023 18:40:32 +0000 (11:40 -0700)
Identified with modernize-use-default-member-init.

llvm/include/llvm/Support/Timer.h

index d72af35..1a32832 100644 (file)
@@ -23,15 +23,13 @@ class TimerGroup;
 class raw_ostream;
 
 class TimeRecord {
-  double WallTime;               ///< Wall clock time elapsed in seconds.
-  double UserTime;               ///< User time elapsed.
-  double SystemTime;             ///< System time elapsed.
-  ssize_t MemUsed;               ///< Memory allocated (in bytes).
-  uint64_t InstructionsExecuted; ///< Number of instructions executed
+  double WallTime = 0.0;             ///< Wall clock time elapsed in seconds.
+  double UserTime = 0.0;             ///< User time elapsed.
+  double SystemTime = 0.0;           ///< System time elapsed.
+  ssize_t MemUsed = 0;               ///< Memory allocated (in bytes).
+  uint64_t InstructionsExecuted = 0; ///< Number of instructions executed
 public:
-  TimeRecord()
-      : WallTime(0), UserTime(0), SystemTime(0), MemUsed(0),
-        InstructionsExecuted(0) {}
+  TimeRecord() = default;
 
   /// Get the current time and memory usage.  If Start is true we get the memory
   /// usage before the time, otherwise we get time before memory usage.  This