Added copy constructors and assignment operators to all lldb::SB* classes
so we don't end up with weak exports with some compilers.
git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@118312 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/API/SBSourceManager.cpp b/source/API/SBSourceManager.cpp
index 701665e..32f792d 100644
--- a/source/API/SBSourceManager.cpp
+++ b/source/API/SBSourceManager.cpp
@@ -20,8 +20,8 @@
using namespace lldb_private;
-SBSourceManager::SBSourceManager (SourceManager& source_manager) :
- m_opaque_ref (source_manager)
+SBSourceManager::SBSourceManager (SourceManager* source_manager) :
+ m_opaque_ptr (source_manager)
{
}
@@ -29,6 +29,18 @@
{
}
+SBSourceManager::SBSourceManager(const SBSourceManager &rhs) :
+ m_opaque_ptr (rhs.m_opaque_ptr)
+{
+}
+
+const SBSourceManager &
+SBSourceManager::operator = (const SBSourceManager &rhs)
+{
+ m_opaque_ptr = rhs.m_opaque_ptr;
+ return *this;
+}
+
size_t
SBSourceManager::DisplaySourceLinesWithLineNumbers
(
@@ -40,6 +52,9 @@
FILE *f
)
{
+ if (m_opaque_ptr == NULL)
+ return 0;
+
if (f == NULL)
return 0;
@@ -48,18 +63,12 @@
StreamFile str (f);
- return m_opaque_ref.DisplaySourceLinesWithLineNumbers (*file,
- line,
- context_before,
- context_after,
- current_line_cstr,
- &str);
+ return m_opaque_ptr->DisplaySourceLinesWithLineNumbers (*file,
+ line,
+ context_before,
+ context_after,
+ current_line_cstr,
+ &str);
}
return 0;
}
-
-SourceManager &
-SBSourceManager::GetLLDBManager ()
-{
- return m_opaque_ref;
-}