diff options
author | Kamil Rytarowski <n54@gmx.com> | 2017-02-06 17:55:02 +0000 |
---|---|---|
committer | Kamil Rytarowski <n54@gmx.com> | 2017-02-06 17:55:02 +0000 |
commit | c5f28e2a05f2ebff09e1cd02a5faa84369c5c655 (patch) | |
tree | 2b060755745a90c26bf922b6baca662106b581cd /lldb/source/Plugins/Language/Go/GoLanguage.cpp | |
parent | d3464bf9adc283bd5f75756bf99074f195117509 (diff) | |
download | bcm5719-llvm-c5f28e2a05f2ebff09e1cd02a5faa84369c5c655.tar.gz bcm5719-llvm-c5f28e2a05f2ebff09e1cd02a5faa84369c5c655.zip |
Switch std::call_once to llvm::call_once
Summary:
The std::call_once implementation in libstdc++ has problems on few systems: NetBSD, OpenBSD and Linux PPC. LLVM ships with a homegrown implementation llvm::call_once to help on these platforms.
This change is required in the NetBSD LLDB port. std::call_once with libstdc++ results with crashing the debugger.
Sponsored by <The NetBSD Foundation>
Reviewers: labath, joerg, emaste, mehdi_amini, clayborg
Reviewed By: labath, clayborg
Subscribers: #lldb
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D29288
llvm-svn: 294202
Diffstat (limited to 'lldb/source/Plugins/Language/Go/GoLanguage.cpp')
-rw-r--r-- | lldb/source/Plugins/Language/Go/GoLanguage.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lldb/source/Plugins/Language/Go/GoLanguage.cpp b/lldb/source/Plugins/Language/Go/GoLanguage.cpp index a1f97c21c94..66b4530abc7 100644 --- a/lldb/source/Plugins/Language/Go/GoLanguage.cpp +++ b/lldb/source/Plugins/Language/Go/GoLanguage.cpp @@ -15,6 +15,7 @@ // Other libraries and framework includes #include "llvm/ADT/StringRef.h" +#include "llvm/Support/Threading.h" // Project includes #include "GoLanguage.h" @@ -62,10 +63,10 @@ Language *GoLanguage::CreateInstance(lldb::LanguageType language) { HardcodedFormatters::HardcodedSummaryFinder GoLanguage::GetHardcodedSummaries() { - static std::once_flag g_initialize; + static llvm::once_flag g_initialize; static HardcodedFormatters::HardcodedSummaryFinder g_formatters; - std::call_once(g_initialize, []() -> void { + llvm::call_once(g_initialize, []() -> void { g_formatters.push_back( [](lldb_private::ValueObject &valobj, lldb::DynamicValueType, FormatManager &) -> TypeSummaryImpl::SharedPointer { @@ -104,10 +105,10 @@ GoLanguage::GetHardcodedSummaries() { HardcodedFormatters::HardcodedSyntheticFinder GoLanguage::GetHardcodedSynthetics() { - static std::once_flag g_initialize; + static llvm::once_flag g_initialize; static HardcodedFormatters::HardcodedSyntheticFinder g_formatters; - std::call_once(g_initialize, []() -> void { + llvm::call_once(g_initialize, []() -> void { g_formatters.push_back( [](lldb_private::ValueObject &valobj, lldb::DynamicValueType, FormatManager &fmt_mgr) -> SyntheticChildren::SharedPointer { |