summaryrefslogtreecommitdiffstats
path: root/contrib/llvm/tools/lldb/source/Utility/SharingPtr.cpp
diff options
context:
space:
mode:
authoremaste <emaste@FreeBSD.org>2014-03-19 13:11:35 +0000
committeremaste <emaste@FreeBSD.org>2014-03-19 13:11:35 +0000
commit958843c32b7a29741f2e45996b5b3e89f9e108b0 (patch)
tree95ae4ffabc848a86b94be3ad3cd42471cdb66b06 /contrib/llvm/tools/lldb/source/Utility/SharingPtr.cpp
parent2a9993c246f3a2463ccd6b8786781e5b97a35065 (diff)
downloadFreeBSD-src-958843c32b7a29741f2e45996b5b3e89f9e108b0.zip
FreeBSD-src-958843c32b7a29741f2e45996b5b3e89f9e108b0.tar.gz
MFC r258054: Update LLDB to upstream r194122 snapshot
Inludes minor changes relative to upstream, for compatibility with FreeBSD's in-tree LLVM 3.3: - Reverted LLDB r191806, restoring use of previous API. - Reverted part of LLDB r189317, restoring previous enum names. - Work around missing LLVM r192504, using previous registerEHFrames API (limited functionality). - Removed PlatformWindows header include and init/terminate calls. Sponsored by: DARPA, AFRL
Diffstat (limited to 'contrib/llvm/tools/lldb/source/Utility/SharingPtr.cpp')
-rw-r--r--contrib/llvm/tools/lldb/source/Utility/SharingPtr.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/contrib/llvm/tools/lldb/source/Utility/SharingPtr.cpp b/contrib/llvm/tools/lldb/source/Utility/SharingPtr.cpp
index f64d7e3..be237ce 100644
--- a/contrib/llvm/tools/lldb/source/Utility/SharingPtr.cpp
+++ b/contrib/llvm/tools/lldb/source/Utility/SharingPtr.cpp
@@ -138,13 +138,21 @@ namespace imp
void
shared_count::add_shared()
{
- increment(shared_owners_);
+#ifdef _MSC_VER
+ _InterlockedIncrement(&shared_owners_);
+#else
+ ++shared_owners_;
+#endif
}
void
shared_count::release_shared()
{
- if (decrement(shared_owners_) == -1)
+#ifdef _MSC_VER
+ if (_InterlockedDecrement(&shared_owners_) == -1)
+#else
+ if (--shared_owners_ == -1)
+#endif
{
on_zero_shared();
delete this;
OpenPOWER on IntegriCloud