*** This commit represents a complete reformatting of the LLDB source code
*** to conform to clang-format’s LLVM style. This kind of mass change has
*** two obvious implications:
Firstly, merging this particular commit into a downstream fork may be a huge
effort. Alternatively, it may be worth merging all changes up to this commit,
performing the same reformatting operation locally, and then discarding the
merge for this particular commit. The commands used to accomplish this
reformatting were as follows (with current working directory as the root of
the repository):
find . \( -iname "*.c" -or -iname "*.cpp" -or -iname "*.h" -or -iname "*.mm" \) -exec clang-format -i {} +
find . -iname "*.py" -exec autopep8 --in-place --aggressive --aggressive {} + ;
The version of clang-format used was 3.9.0, and autopep8 was 1.2.4.
Secondly, “blame” style tools will generally point to this commit instead of
a meaningful prior commit. There are alternatives available that will attempt
to look through this change and find the appropriate prior commit. YMMV.
llvm-svn: 280751
diff --git a/lldb/tools/lldb-perf/lib/MemoryGauge.h b/lldb/tools/lldb-perf/lib/MemoryGauge.h
index a1221b6..beed624 100644
--- a/lldb/tools/lldb-perf/lib/MemoryGauge.h
+++ b/lldb/tools/lldb-perf/lib/MemoryGauge.h
@@ -17,131 +17,76 @@
namespace lldb_perf {
-class MemoryStats
-{
+class MemoryStats {
public:
- MemoryStats (mach_vm_size_t virtual_size = 0,
- mach_vm_size_t resident_size = 0,
- mach_vm_size_t max_resident_size = 0);
- MemoryStats (const MemoryStats& rhs);
-
- MemoryStats&
- operator = (const MemoryStats& rhs);
+ MemoryStats(mach_vm_size_t virtual_size = 0, mach_vm_size_t resident_size = 0,
+ mach_vm_size_t max_resident_size = 0);
+ MemoryStats(const MemoryStats &rhs);
- MemoryStats&
- operator += (const MemoryStats& rhs);
+ MemoryStats &operator=(const MemoryStats &rhs);
- MemoryStats
- operator - (const MemoryStats& rhs);
+ MemoryStats &operator+=(const MemoryStats &rhs);
- MemoryStats
- operator + (const MemoryStats& rhs);
-
- MemoryStats
- operator / (size_t rhs);
-
- MemoryStats
- operator * (const MemoryStats& rhs);
-
- mach_vm_size_t
- GetVirtualSize () const
- {
- return m_virtual_size;
- }
-
- mach_vm_size_t
- GetResidentSize () const
- {
- return m_resident_size;
- }
-
- mach_vm_size_t
- GetMaxResidentSize () const
- {
- return m_max_resident_size;
- }
-
- void
- SetVirtualSize (mach_vm_size_t vs)
- {
- m_virtual_size = vs;
- }
-
- void
- SetResidentSize (mach_vm_size_t rs)
- {
- m_resident_size = rs;
- }
-
- void
- SetMaxResidentSize (mach_vm_size_t mrs)
- {
- m_max_resident_size = mrs;
- }
-
- Results::ResultSP
- GetResult (const char *name, const char *description) const;
+ MemoryStats operator-(const MemoryStats &rhs);
+
+ MemoryStats operator+(const MemoryStats &rhs);
+
+ MemoryStats operator/(size_t rhs);
+
+ MemoryStats operator*(const MemoryStats &rhs);
+
+ mach_vm_size_t GetVirtualSize() const { return m_virtual_size; }
+
+ mach_vm_size_t GetResidentSize() const { return m_resident_size; }
+
+ mach_vm_size_t GetMaxResidentSize() const { return m_max_resident_size; }
+
+ void SetVirtualSize(mach_vm_size_t vs) { m_virtual_size = vs; }
+
+ void SetResidentSize(mach_vm_size_t rs) { m_resident_size = rs; }
+
+ void SetMaxResidentSize(mach_vm_size_t mrs) { m_max_resident_size = mrs; }
+
+ Results::ResultSP GetResult(const char *name, const char *description) const;
+
private:
- mach_vm_size_t m_virtual_size;
- mach_vm_size_t m_resident_size;
- mach_vm_size_t m_max_resident_size;
+ mach_vm_size_t m_virtual_size;
+ mach_vm_size_t m_resident_size;
+ mach_vm_size_t m_max_resident_size;
};
-
-class MemoryGauge : public Gauge<MemoryStats>
-{
+
+class MemoryGauge : public Gauge<MemoryStats> {
public:
- MemoryGauge ();
-
- virtual
- ~MemoryGauge ()
- {
- }
-
- void
- Start ();
-
- ValueType
- Stop ();
-
- virtual ValueType
- GetStartValue() const
- {
- return m_start;
- }
+ MemoryGauge();
- virtual ValueType
- GetStopValue() const
- {
- return m_stop;
- }
+ virtual ~MemoryGauge() {}
- virtual ValueType
- GetDeltaValue() const;
+ void Start();
+
+ ValueType Stop();
+
+ virtual ValueType GetStartValue() const { return m_start; }
+
+ virtual ValueType GetStopValue() const { return m_stop; }
+
+ virtual ValueType GetDeltaValue() const;
private:
- enum class State
- {
- eNeverUsed,
- eCounting,
- eStopped
- };
-
- ValueType
- Now ();
-
- State m_state;
- ValueType m_start;
- ValueType m_stop;
- ValueType m_delta;
+ enum class State { eNeverUsed, eCounting, eStopped };
+
+ ValueType Now();
+
+ State m_state;
+ ValueType m_start;
+ ValueType m_stop;
+ ValueType m_delta;
};
template <>
-Results::ResultSP
-GetResult (const char *description, MemoryStats value);
-
+Results::ResultSP GetResult(const char *description, MemoryStats value);
+
} // namespace lldb_perf
-lldb_perf::MemoryStats
-sqrt (const lldb_perf::MemoryStats& arg);
+lldb_perf::MemoryStats sqrt(const lldb_perf::MemoryStats &arg);
#endif // #ifndef __PerfTestDriver__MemoryGauge__