summaryrefslogtreecommitdiffstats
path: root/libcxx/src/debug.cpp
diff options
context:
space:
mode:
authorLouis Dionne <ldionne@apple.com>2019-04-17 18:20:19 +0000
committerLouis Dionne <ldionne@apple.com>2019-04-17 18:20:19 +0000
commit81875a67b0d1bd43cca96b5e321a4af06b9299cd (patch)
treeef6b15900dc630a0ac388a3fb63f74a4dadfd61d /libcxx/src/debug.cpp
parent05a358cdcd55d1ee0a0d92383aa49489479c6362 (diff)
downloadbcm5719-llvm-81875a67b0d1bd43cca96b5e321a4af06b9299cd.tar.gz
bcm5719-llvm-81875a67b0d1bd43cca96b5e321a4af06b9299cd.zip
[libc++] Use the no_destroy attribute to avoid destroying debug DB statics
Summary: Otherwise, we can run into problems when the program has static variables that need to use the debug database during their deinitialization, if the debug DB has already been deinitialized. Reviewers: EricWF Subscribers: christof, jkorous, dexonsmith, libcxx-commits Tags: #libc Differential Revision: https://reviews.llvm.org/D60830 llvm-svn: 358602
Diffstat (limited to 'libcxx/src/debug.cpp')
-rw-r--r--libcxx/src/debug.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/libcxx/src/debug.cpp b/libcxx/src/debug.cpp
index 93fa1a8e0d4..7fdf90c37d9 100644
--- a/libcxx/src/debug.cpp
+++ b/libcxx/src/debug.cpp
@@ -42,7 +42,7 @@ _LIBCPP_FUNC_VIS
__libcpp_db*
__get_db()
{
- static __libcpp_db db;
+ static _LIBCPP_NO_DESTROY __libcpp_db db;
return &db;
}
@@ -64,7 +64,7 @@ typedef lock_guard<mutex_type> RLock;
mutex_type&
mut()
{
- static mutex_type m;
+ static _LIBCPP_NO_DESTROY mutex_type m;
return m;
}
#endif // !_LIBCPP_HAS_NO_THREADS
OpenPOWER on IntegriCloud