[llvm] e740cb1 - [Support] Modernize TimeRecord (NFC)

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Sun Apr 16 11:40:43 PDT 2023


Author: Kazu Hirata
Date: 2023-04-16T11:40:32-07:00
New Revision: e740cb1d75aac413651b81fe97e823d12de595b6

URL: https://github.com/llvm/llvm-project/commit/e740cb1d75aac413651b81fe97e823d12de595b6
DIFF: https://github.com/llvm/llvm-project/commit/e740cb1d75aac413651b81fe97e823d12de595b6.diff

LOG: [Support] Modernize TimeRecord (NFC)

Identified with modernize-use-default-member-init.

Added: 
    

Modified: 
    llvm/include/llvm/Support/Timer.h

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/Support/Timer.h b/llvm/include/llvm/Support/Timer.h
index d72af3541af07..1a32832b6c653 100644
--- a/llvm/include/llvm/Support/Timer.h
+++ b/llvm/include/llvm/Support/Timer.h
@@ -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


        


More information about the llvm-commits mailing list