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
This commit is contained in:
Kamil Rytarowski
2017-02-06 17:55:02 +00:00
parent d3464bf9ad
commit c5f28e2a05
36 changed files with 157 additions and 111 deletions

View File

@@ -15,6 +15,7 @@
// Other libraries and framework includes
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/Threading.h"
// Project includes
#include "JavaFormatterFunctions.h"
@@ -64,10 +65,10 @@ bool JavaLanguage::IsNilReference(ValueObject &valobj) {
}
lldb::TypeCategoryImplSP JavaLanguage::GetFormatters() {
static std::once_flag g_initialize;
static llvm::once_flag g_initialize;
static TypeCategoryImplSP g_category;
std::call_once(g_initialize, [this]() -> void {
llvm::call_once(g_initialize, [this]() -> void {
DataVisualization::Categories::GetCategory(GetPluginName(), g_category);
if (g_category) {
llvm::StringRef array_regexp("^.*\\[\\]&?$");