aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Target/Queue.cpp
diff options
context:
space:
mode:
authorKate Stone <katherine.stone@apple.com>2016-09-06 20:57:50 +0000
committerKate Stone <katherine.stone@apple.com>2016-09-06 20:57:50 +0000
commitb9c1b51e45b845debb76d8658edabca70ca56079 (patch)
treedfcb5a13ef2b014202340f47036da383eaee74aa /lldb/source/Target/Queue.cpp
parentd5aa73376966339caad04013510626ec2e42c760 (diff)
downloadllvm-b9c1b51e45b845debb76d8658edabca70ca56079.zip
llvm-b9c1b51e45b845debb76d8658edabca70ca56079.tar.gz
llvm-b9c1b51e45b845debb76d8658edabca70ca56079.tar.bz2
*** 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
Diffstat (limited to 'lldb/source/Target/Queue.cpp')
-rw-r--r--lldb/source/Target/Queue.cpp137
1 files changed, 47 insertions, 90 deletions
diff --git a/lldb/source/Target/Queue.cpp b/lldb/source/Target/Queue.cpp
index 9d4032a2..45fdbea 100644
--- a/lldb/source/Target/Queue.cpp
+++ b/lldb/source/Target/Queue.cpp
@@ -11,127 +11,84 @@
// C++ Includes
// Other libraries and framework includes
// Project includes
-#include "lldb/Target/Process.h"
#include "lldb/Target/Queue.h"
+#include "lldb/Target/Process.h"
#include "lldb/Target/QueueList.h"
-#include "lldb/Target/Thread.h"
#include "lldb/Target/SystemRuntime.h"
+#include "lldb/Target/Thread.h"
using namespace lldb;
using namespace lldb_private;
-Queue::Queue (ProcessSP process_sp, lldb::queue_id_t queue_id, const char *queue_name) :
- m_process_wp (),
- m_queue_id (queue_id),
- m_queue_name (),
- m_running_work_items_count(0),
- m_pending_work_items_count(0),
- m_pending_items(),
- m_dispatch_queue_t_addr(LLDB_INVALID_ADDRESS),
- m_kind (eQueueKindUnknown)
-{
- if (queue_name)
- m_queue_name = queue_name;
-
- m_process_wp = process_sp;
+Queue::Queue(ProcessSP process_sp, lldb::queue_id_t queue_id,
+ const char *queue_name)
+ : m_process_wp(), m_queue_id(queue_id), m_queue_name(),
+ m_running_work_items_count(0), m_pending_work_items_count(0),
+ m_pending_items(), m_dispatch_queue_t_addr(LLDB_INVALID_ADDRESS),
+ m_kind(eQueueKindUnknown) {
+ if (queue_name)
+ m_queue_name = queue_name;
+
+ m_process_wp = process_sp;
}
Queue::~Queue() = default;
-queue_id_t
-Queue::GetID ()
-{
- return m_queue_id;
-}
+queue_id_t Queue::GetID() { return m_queue_id; }
-const char *
-Queue::GetName ()
-{
- return (m_queue_name.empty() ? nullptr : m_queue_name.c_str());
+const char *Queue::GetName() {
+ return (m_queue_name.empty() ? nullptr : m_queue_name.c_str());
}
-uint32_t
-Queue::GetIndexID ()
-{
- return m_queue_id;
-}
+uint32_t Queue::GetIndexID() { return m_queue_id; }
-std::vector<lldb::ThreadSP>
-Queue::GetThreads ()
-{
- std::vector<ThreadSP> result;
- ProcessSP process_sp = m_process_wp.lock();
- if (process_sp)
- {
- for (ThreadSP thread_sp : process_sp->Threads())
- {
- if (thread_sp->GetQueueID() == m_queue_id)
- {
- result.push_back (thread_sp);
- }
- }
+std::vector<lldb::ThreadSP> Queue::GetThreads() {
+ std::vector<ThreadSP> result;
+ ProcessSP process_sp = m_process_wp.lock();
+ if (process_sp) {
+ for (ThreadSP thread_sp : process_sp->Threads()) {
+ if (thread_sp->GetQueueID() == m_queue_id) {
+ result.push_back(thread_sp);
+ }
}
- return result;
+ }
+ return result;
}
-void
-Queue::SetNumRunningWorkItems (uint32_t count)
-{
- m_running_work_items_count = count;
+void Queue::SetNumRunningWorkItems(uint32_t count) {
+ m_running_work_items_count = count;
}
-uint32_t
-Queue::GetNumRunningWorkItems () const
-{
- return m_running_work_items_count;
+uint32_t Queue::GetNumRunningWorkItems() const {
+ return m_running_work_items_count;
}
-void
-Queue::SetNumPendingWorkItems (uint32_t count)
-{
- m_pending_work_items_count = count;
+void Queue::SetNumPendingWorkItems(uint32_t count) {
+ m_pending_work_items_count = count;
}
-uint32_t
-Queue::GetNumPendingWorkItems () const
-{
- return m_pending_work_items_count;
+uint32_t Queue::GetNumPendingWorkItems() const {
+ return m_pending_work_items_count;
}
-void
-Queue::SetLibdispatchQueueAddress (addr_t dispatch_queue_t_addr)
-{
- m_dispatch_queue_t_addr = dispatch_queue_t_addr;
+void Queue::SetLibdispatchQueueAddress(addr_t dispatch_queue_t_addr) {
+ m_dispatch_queue_t_addr = dispatch_queue_t_addr;
}
-addr_t
-Queue::GetLibdispatchQueueAddress () const
-{
- return m_dispatch_queue_t_addr;
+addr_t Queue::GetLibdispatchQueueAddress() const {
+ return m_dispatch_queue_t_addr;
}
-const std::vector<lldb::QueueItemSP> &
-Queue::GetPendingItems ()
-{
- if (m_pending_items.empty())
- {
- ProcessSP process_sp = m_process_wp.lock();
- if (process_sp && process_sp->GetSystemRuntime())
- {
- process_sp->GetSystemRuntime()->PopulatePendingItemsForQueue (this);
- }
+const std::vector<lldb::QueueItemSP> &Queue::GetPendingItems() {
+ if (m_pending_items.empty()) {
+ ProcessSP process_sp = m_process_wp.lock();
+ if (process_sp && process_sp->GetSystemRuntime()) {
+ process_sp->GetSystemRuntime()->PopulatePendingItemsForQueue(this);
}
- return m_pending_items;
+ }
+ return m_pending_items;
}
-lldb::QueueKind
-Queue::GetKind ()
-{
- return m_kind;
-}
+lldb::QueueKind Queue::GetKind() { return m_kind; }
-void
-Queue::SetKind (lldb::QueueKind kind)
-{
- m_kind = kind;
-}
+void Queue::SetKind(lldb::QueueKind kind) { m_kind = kind; }