forked from OSchip/llvm-project
[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 llvm-svn: 320066
This commit is contained in:
parent
6d9ac1b1eb
commit
c218ee58ac
|
@ -37,24 +37,7 @@ namespace lldb
|
|||
{
|
||||
class SBBreakpointNameImpl {
|
||||
public:
|
||||
SBBreakpointNameImpl(SBTarget &sb_target, const char *name)
|
||||
{
|
||||
if (!name || name[0] == '\0')
|
||||
return;
|
||||
m_name.assign(name);
|
||||
|
||||
if (!sb_target.IsValid())
|
||||
return;
|
||||
|
||||
TargetSP target_sp = sb_target.GetSP();
|
||||
if (!target_sp)
|
||||
return;
|
||||
|
||||
m_target_wp = target_sp;
|
||||
}
|
||||
|
||||
SBBreakpointNameImpl(TargetSP target_sp, const char *name)
|
||||
{
|
||||
SBBreakpointNameImpl(TargetSP target_sp, const char *name) {
|
||||
if (!name || name[0] == '\0')
|
||||
return;
|
||||
m_name.assign(name);
|
||||
|
@ -64,16 +47,11 @@ public:
|
|||
|
||||
m_target_wp = target_sp;
|
||||
}
|
||||
|
||||
bool operator==(const SBBreakpointNameImpl &rhs) {
|
||||
return m_name == rhs.m_name
|
||||
&& m_target_wp.lock() == rhs.m_target_wp.lock();
|
||||
}
|
||||
|
||||
bool operator!=(const SBBreakpointNameImpl &rhs) {
|
||||
return m_name != rhs.m_name
|
||||
|| m_target_wp.lock() != rhs.m_target_wp.lock();
|
||||
}
|
||||
|
||||
SBBreakpointNameImpl(SBTarget &sb_target, const char *name);
|
||||
bool operator==(const SBBreakpointNameImpl &rhs);
|
||||
bool operator!=(const SBBreakpointNameImpl &rhs);
|
||||
|
||||
// For now we take a simple approach and only keep the name, and relook
|
||||
// up the location when we need it.
|
||||
|
||||
|
@ -88,33 +66,48 @@ public:
|
|||
bool IsValid() const {
|
||||
return !m_name.empty() && m_target_wp.lock();
|
||||
}
|
||||
|
||||
lldb_private::BreakpointName *GetBreakpointName()
|
||||
{
|
||||
if (!IsValid())
|
||||
return nullptr;
|
||||
TargetSP target_sp = GetTarget();
|
||||
if (!target_sp)
|
||||
return nullptr;
|
||||
Status error;
|
||||
return target_sp->FindBreakpointName(ConstString(m_name), true, error);
|
||||
}
|
||||
|
||||
const lldb_private::BreakpointName *GetBreakpointName() const
|
||||
{
|
||||
if (!IsValid())
|
||||
return nullptr;
|
||||
TargetSP target_sp = GetTarget();
|
||||
if (!target_sp)
|
||||
return nullptr;
|
||||
Status error;
|
||||
return target_sp->FindBreakpointName(ConstString(m_name), true, error);
|
||||
}
|
||||
|
||||
|
||||
lldb_private::BreakpointName *GetBreakpointName() const;
|
||||
|
||||
private:
|
||||
TargetWP m_target_wp;
|
||||
std::string m_name;
|
||||
};
|
||||
|
||||
SBBreakpointNameImpl::SBBreakpointNameImpl(SBTarget &sb_target,
|
||||
const char *name) {
|
||||
if (!name || name[0] == '\0')
|
||||
return;
|
||||
m_name.assign(name);
|
||||
|
||||
if (!sb_target.IsValid())
|
||||
return;
|
||||
|
||||
TargetSP target_sp = sb_target.GetSP();
|
||||
if (!target_sp)
|
||||
return;
|
||||
|
||||
m_target_wp = target_sp;
|
||||
}
|
||||
|
||||
bool SBBreakpointNameImpl::operator==(const SBBreakpointNameImpl &rhs) {
|
||||
return m_name == rhs.m_name && m_target_wp.lock() == rhs.m_target_wp.lock();
|
||||
}
|
||||
|
||||
bool SBBreakpointNameImpl::operator!=(const SBBreakpointNameImpl &rhs) {
|
||||
return m_name != rhs.m_name || m_target_wp.lock() != rhs.m_target_wp.lock();
|
||||
}
|
||||
|
||||
lldb_private::BreakpointName *SBBreakpointNameImpl::GetBreakpointName() const {
|
||||
if (!IsValid())
|
||||
return nullptr;
|
||||
TargetSP target_sp = GetTarget();
|
||||
if (!target_sp)
|
||||
return nullptr;
|
||||
Status error;
|
||||
return target_sp->FindBreakpointName(ConstString(m_name), true, error);
|
||||
}
|
||||
|
||||
} // namespace lldb
|
||||
|
||||
SBBreakpointName::SBBreakpointName() {}
|
||||
|
|
Loading…
Reference in New Issue