Skip to content
This repository was archived by the owner on May 21, 2019. It is now read-only.
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 36bc90c

Browse files
committedDec 7, 2017
[SBBreakpoint] Outline some functions to prevent to be exported.
They're hidden, so all they cause is a linker warning. ld: warning: cannot export hidden symbol lldb::SBBreakpointNameImpl::operator==(lldb::SBBreakpointNameImpl const&) from tools/lldb/source/API/CMakeFiles/liblldb.dir/SBBreakpointName.cpp.o git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@320066 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 12aa58f commit 36bc90c

File tree

1 file changed

+44
-51
lines changed

1 file changed

+44
-51
lines changed
 

‎source/API/SBBreakpointName.cpp

Lines changed: 44 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -37,24 +37,7 @@ namespace lldb
3737
{
3838
class SBBreakpointNameImpl {
3939
public:
40-
SBBreakpointNameImpl(SBTarget &sb_target, const char *name)
41-
{
42-
if (!name || name[0] == '\0')
43-
return;
44-
m_name.assign(name);
45-
46-
if (!sb_target.IsValid())
47-
return;
48-
49-
TargetSP target_sp = sb_target.GetSP();
50-
if (!target_sp)
51-
return;
52-
53-
m_target_wp = target_sp;
54-
}
55-
56-
SBBreakpointNameImpl(TargetSP target_sp, const char *name)
57-
{
40+
SBBreakpointNameImpl(TargetSP target_sp, const char *name) {
5841
if (!name || name[0] == '\0')
5942
return;
6043
m_name.assign(name);
@@ -64,16 +47,11 @@ class SBBreakpointNameImpl {
6447

6548
m_target_wp = target_sp;
6649
}
67-
68-
bool operator==(const SBBreakpointNameImpl &rhs) {
69-
return m_name == rhs.m_name
70-
&& m_target_wp.lock() == rhs.m_target_wp.lock();
71-
}
72-
73-
bool operator!=(const SBBreakpointNameImpl &rhs) {
74-
return m_name != rhs.m_name
75-
|| m_target_wp.lock() != rhs.m_target_wp.lock();
76-
}
50+
51+
SBBreakpointNameImpl(SBTarget &sb_target, const char *name);
52+
bool operator==(const SBBreakpointNameImpl &rhs);
53+
bool operator!=(const SBBreakpointNameImpl &rhs);
54+
7755
// For now we take a simple approach and only keep the name, and relook
7856
// up the location when we need it.
7957

@@ -88,33 +66,48 @@ class SBBreakpointNameImpl {
8866
bool IsValid() const {
8967
return !m_name.empty() && m_target_wp.lock();
9068
}
91-
92-
lldb_private::BreakpointName *GetBreakpointName()
93-
{
94-
if (!IsValid())
95-
return nullptr;
96-
TargetSP target_sp = GetTarget();
97-
if (!target_sp)
98-
return nullptr;
99-
Status error;
100-
return target_sp->FindBreakpointName(ConstString(m_name), true, error);
101-
}
102-
103-
const lldb_private::BreakpointName *GetBreakpointName() const
104-
{
105-
if (!IsValid())
106-
return nullptr;
107-
TargetSP target_sp = GetTarget();
108-
if (!target_sp)
109-
return nullptr;
110-
Status error;
111-
return target_sp->FindBreakpointName(ConstString(m_name), true, error);
112-
}
113-
69+
70+
lldb_private::BreakpointName *GetBreakpointName() const;
71+
11472
private:
11573
TargetWP m_target_wp;
11674
std::string m_name;
11775
};
76+
77+
SBBreakpointNameImpl::SBBreakpointNameImpl(SBTarget &sb_target,
78+
const char *name) {
79+
if (!name || name[0] == '\0')
80+
return;
81+
m_name.assign(name);
82+
83+
if (!sb_target.IsValid())
84+
return;
85+
86+
TargetSP target_sp = sb_target.GetSP();
87+
if (!target_sp)
88+
return;
89+
90+
m_target_wp = target_sp;
91+
}
92+
93+
bool SBBreakpointNameImpl::operator==(const SBBreakpointNameImpl &rhs) {
94+
return m_name == rhs.m_name && m_target_wp.lock() == rhs.m_target_wp.lock();
95+
}
96+
97+
bool SBBreakpointNameImpl::operator!=(const SBBreakpointNameImpl &rhs) {
98+
return m_name != rhs.m_name || m_target_wp.lock() != rhs.m_target_wp.lock();
99+
}
100+
101+
lldb_private::BreakpointName *SBBreakpointNameImpl::GetBreakpointName() const {
102+
if (!IsValid())
103+
return nullptr;
104+
TargetSP target_sp = GetTarget();
105+
if (!target_sp)
106+
return nullptr;
107+
Status error;
108+
return target_sp->FindBreakpointName(ConstString(m_name), true, error);
109+
}
110+
118111
} // namespace lldb
119112

120113
SBBreakpointName::SBBreakpointName() {}

0 commit comments

Comments
 (0)
This repository has been archived.