[MLIR][NVVM] Add Op for TMA Store with reduction (#118853)
[llvm-project.git] / lldb / source / API / SBWatchpointOptions.cpp
blob62e9c21a857957df75a9419d7b87aa86a78710f6
1 //===-- SBWatchpointOptions.cpp -------------------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
9 #include "lldb/API/SBWatchpointOptions.h"
10 #include "lldb/Breakpoint/Watchpoint.h"
11 #include "lldb/Utility/Instrumentation.h"
13 #include "Utils.h"
15 using namespace lldb;
16 using namespace lldb_private;
18 class WatchpointOptionsImpl {
19 public:
20 bool m_read = false;
21 bool m_write = false;
22 bool m_modify = false;
26 SBWatchpointOptions::SBWatchpointOptions()
27 : m_opaque_up(new WatchpointOptionsImpl()) {
28 LLDB_INSTRUMENT_VA(this);
31 SBWatchpointOptions::SBWatchpointOptions(const SBWatchpointOptions &rhs) {
32 LLDB_INSTRUMENT_VA(this, rhs);
34 m_opaque_up = clone(rhs.m_opaque_up);
37 const SBWatchpointOptions &
38 SBWatchpointOptions::operator=(const SBWatchpointOptions &rhs) {
39 LLDB_INSTRUMENT_VA(this, rhs);
41 if (this != &rhs)
42 m_opaque_up = clone(rhs.m_opaque_up);
43 return *this;
46 SBWatchpointOptions::~SBWatchpointOptions() = default;
48 void SBWatchpointOptions::SetWatchpointTypeRead(bool read) {
49 m_opaque_up->m_read = read;
51 bool SBWatchpointOptions::GetWatchpointTypeRead() const {
52 return m_opaque_up->m_read;
55 void SBWatchpointOptions::SetWatchpointTypeWrite(
56 WatchpointWriteType write_type) {
57 if (write_type == eWatchpointWriteTypeOnModify) {
58 m_opaque_up->m_write = false;
59 m_opaque_up->m_modify = true;
60 } else if (write_type == eWatchpointWriteTypeAlways) {
61 m_opaque_up->m_write = true;
62 m_opaque_up->m_modify = false;
63 } else
64 m_opaque_up->m_write = m_opaque_up->m_modify = false;
67 WatchpointWriteType SBWatchpointOptions::GetWatchpointTypeWrite() const {
68 if (m_opaque_up->m_modify)
69 return eWatchpointWriteTypeOnModify;
70 if (m_opaque_up->m_write)
71 return eWatchpointWriteTypeAlways;
72 return eWatchpointWriteTypeDisabled;