Provide a default constructor for TimeValue. This was used, but only in
[oota-llvm.git] / include / llvm / Support / Process.h
index 6b29f57fc1c881c9597c0d5d30eca10afe48ab41..ea8da6d4c5b5fe830ba77c307756a17fe2a27343 100644 (file)
@@ -64,6 +64,23 @@ public:
   /// \brief Get the operating system specific identifier for this process.
   virtual id_type get_id() = 0;
 
+  /// \brief Get the user time consumed by this process.
+  ///
+  /// Note that this is often an approximation and may be zero on platforms
+  /// where we don't have good support for the functionality.
+  virtual TimeValue get_user_time() const = 0;
+
+  /// \brief Get the system time consumed by this process.
+  ///
+  /// Note that this is often an approximation and may be zero on platforms
+  /// where we don't have good support for the functionality.
+  virtual TimeValue get_system_time() const = 0;
+
+  /// \brief Get the wall time consumed by this process.
+  ///
+  /// Note that this is often an approximation and may be zero on platforms
+  /// where we don't have good support for the functionality.
+  virtual TimeValue get_wall_time() const = 0;
 
   /// \name Static factory routines for processes.
   /// @{
@@ -88,8 +105,31 @@ class self_process : public process {
 
 public:
   virtual id_type get_id();
+  virtual TimeValue get_user_time() const;
+  virtual TimeValue get_system_time() const;
+  virtual TimeValue get_wall_time() const;
+
+  /// \name Process configuration (sysconf on POSIX)
+  /// @{
+
+  /// \brief Get the virtual memory page size.
+  ///
+  /// Query the operating system for this process's page size.
+  size_t page_size() const { return PageSize; };
+
+  /// @}
 
 private:
+  /// \name Cached process state.
+  /// @{
+
+  /// \brief Cached page size, this cannot vary during the life of the process.
+  size_t PageSize;
+
+  /// @}
+
+  /// \brief Constructor, used by \c process::get_self() only.
+  self_process();
 };
 
 
@@ -97,12 +137,6 @@ private:
 /// current executing process.
 class Process {
 public:
-  /// \brief Get the virtual memory page size
-  /// This static function will return the operating system's virtual memory
-  /// page size.
-  /// \returns The number of bytes in a virtual memory page.
-  static unsigned GetPageSize();
-
   /// \brief Return process memory usage.
   /// This static function will return the total amount of memory allocated
   /// by the process. This only counts the memory allocated via the malloc,