Skip to content

Commit 4ffeef9

Browse files
committed
Format
1 parent 7c0894d commit 4ffeef9

File tree

2 files changed

+13
-19
lines changed

2 files changed

+13
-19
lines changed

lldb/include/lldb/Target/Statistics.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,8 @@ struct StatisticsOptions {
182182
class SummaryStatistics {
183183
public:
184184
explicit SummaryStatistics(std::string name, std::string impl_type)
185-
: m_total_time(), m_impl_type(std::move(impl_type)), m_name(std::move(name)), m_count(0) {}
185+
: m_total_time(), m_impl_type(std::move(impl_type)),
186+
m_name(std::move(name)), m_count(0) {}
186187

187188
std::string GetName() const { return m_name; };
188189
double GetTotalTime() const { return m_total_time.get().count(); }
@@ -236,7 +237,7 @@ class SummaryStatisticsCache {
236237
GetSummaryStatisticsForProvider(lldb_private::TypeSummaryImpl &provider) {
237238
std::lock_guard<std::mutex> guard(m_map_mutex);
238239
if (auto iterator = m_summary_stats_map.find(provider.GetName());
239-
iterator != m_summary_stats_map.end())
240+
iterator != m_summary_stats_map.end())
240241
return iterator->second;
241242

242243
auto it = m_summary_stats_map.try_emplace(

lldb/unittests/Target/SummaryStatisticsTest.cpp

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
#include "lldb/DataFormatters/TypeSummary.h"
22
#include "lldb/Target/Statistics.h"
3+
#include "lldb/Utility/Stream.h"
34
#include "lldb/lldb-forward.h"
45
#include "lldb/lldb-private-enumerations.h"
56
#include "lldb/lldb-private.h"
6-
#include "lldb/Utility/Stream.h"
77
#include "llvm/Testing/Support/Error.h"
88
#include "gtest/gtest.h"
99
#include <thread>
@@ -13,30 +13,23 @@ using Duration = std::chrono::duration<double>;
1313

1414
class DummySummaryImpl : public lldb_private::TypeSummaryImpl {
1515
public:
16-
DummySummaryImpl(Duration sleepTime):
17-
TypeSummaryImpl(TypeSummaryImpl::Kind::eSummaryString, TypeSummaryImpl::Flags()),
18-
m_sleepTime(sleepTime) {}
16+
DummySummaryImpl(Duration sleepTime)
17+
: TypeSummaryImpl(TypeSummaryImpl::Kind::eSummaryString,
18+
TypeSummaryImpl::Flags()),
19+
m_sleepTime(sleepTime) {}
1920

20-
std::string GetName() override {
21-
return "DummySummary";
22-
}
21+
std::string GetName() override { return "DummySummary"; }
2322

24-
std::string GetSummaryKindName() override {
25-
return "dummy";
26-
}
23+
std::string GetSummaryKindName() override { return "dummy"; }
2724

28-
std::string GetDescription() override {
29-
return "";
30-
}
25+
std::string GetDescription() override { return ""; }
3126

3227
bool FormatObject(ValueObject *valobj, std::string &dest,
3328
const TypeSummaryOptions &options) override {
3429
return false;
3530
}
3631

37-
void FakeFormat() {
38-
std::this_thread::sleep_for(m_sleepTime);
39-
}
32+
void FakeFormat() { std::this_thread::sleep_for(m_sleepTime); }
4033

4134
private:
4235
Duration m_sleepTime;
@@ -56,7 +49,7 @@ TEST(MultithreadFormatting, Multithread) {
5649
}));
5750
}
5851

59-
for (auto &thread : threads)
52+
for (auto &thread : threads)
6053
thread.join();
6154

6255
auto sp = statistics_cache.GetSummaryStatisticsForProvider(summary);

0 commit comments

Comments
 (0)