Switched over to using the new lldb::SharingPtr from Howard Hinnant.
We need to put this in LLDB since we need to vend this in our API
because our public API uses shared pointers to our private objects.
Removed a deprecated file: include/lldb/Host/Types.h
Added the new SharingPtr.cpp/.h files into source/Utility.
Added a shell script build phase that fixes up all headers in the
LLDB.framework.
git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@105895 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Utility/SharingPtr.cpp b/source/Utility/SharingPtr.cpp
new file mode 100644
index 0000000..431fdc1
--- /dev/null
+++ b/source/Utility/SharingPtr.cpp
@@ -0,0 +1,53 @@
+//===---------------------SharingPtr.cpp ------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include "SharingPtr.h"
+
+namespace lldb {
+
+namespace imp
+{
+
+template <class T>
+inline T
+increment(T& t)
+{
+ return __sync_add_and_fetch(&t, 1);
+}
+
+template <class T>
+inline T
+decrement(T& t)
+{
+ return __sync_add_and_fetch(&t, -1);
+}
+
+shared_count::~shared_count()
+{
+}
+
+void
+shared_count::add_shared()
+{
+ increment(shared_owners_);
+}
+
+void
+shared_count::release_shared()
+{
+ if (decrement(shared_owners_) == -1)
+ {
+ on_zero_shared();
+ delete this;
+ }
+}
+
+} // imp
+
+} // namespace lldb