[Lldb-commits] [lldb] r320066 - [SBBreakpoint] Outline some functions to prevent to be exported.
Davide Italiano via lldb-commits
lldb-commits at lists.llvm.org
Thu Dec 7 10:06:06 PST 2017
Author: davide
Date: Thu Dec 7 10:06:06 2017
New Revision: 320066
URL: http://llvm.org/viewvc/llvm-project?rev=320066&view=rev
Log:
[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
Modified:
lldb/trunk/source/API/SBBreakpointName.cpp
Modified: lldb/trunk/source/API/SBBreakpointName.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBBreakpointName.cpp?rev=320066&r1=320065&r2=320066&view=diff
==============================================================================
--- lldb/trunk/source/API/SBBreakpointName.cpp (original)
+++ lldb/trunk/source/API/SBBreakpointName.cpp Thu Dec 7 10:06:06 2017
@@ -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() {}
More information about the lldb-commits
mailing list