This revision was automatically updated to reflect the committed changes. Closed by commit rL284601: Simplify GetGlobalProperties functions of Thread/Process/Target (authored by labath).
Changed prior to commit: https://reviews.llvm.org/D17710?vs=49356&id=75157#toc Repository: rL LLVM https://reviews.llvm.org/D17710 Files: lldb/trunk/source/Target/Process.cpp lldb/trunk/source/Target/Target.cpp lldb/trunk/source/Target/Thread.cpp Index: lldb/trunk/source/Target/Target.cpp =================================================================== --- lldb/trunk/source/Target/Target.cpp +++ lldb/trunk/source/Target/Target.cpp @@ -2643,11 +2643,8 @@ const TargetPropertiesSP &Target::GetGlobalProperties() { // NOTE: intentional leak so we don't crash if global destructor chain gets // called as other threads still use the result of this function - static TargetPropertiesSP *g_settings_sp_ptr = nullptr; - static std::once_flag g_once_flag; - std::call_once(g_once_flag, []() { - g_settings_sp_ptr = new TargetPropertiesSP(new TargetProperties(nullptr)); - }); + static TargetPropertiesSP *g_settings_sp_ptr = + new TargetPropertiesSP(new TargetProperties(nullptr)); return *g_settings_sp_ptr; } Index: lldb/trunk/source/Target/Thread.cpp =================================================================== --- lldb/trunk/source/Target/Thread.cpp +++ lldb/trunk/source/Target/Thread.cpp @@ -58,11 +58,8 @@ const ThreadPropertiesSP &Thread::GetGlobalProperties() { // NOTE: intentional leak so we don't crash if global destructor chain gets // called as other threads still use the result of this function - static ThreadPropertiesSP *g_settings_sp_ptr = nullptr; - static std::once_flag g_once_flag; - std::call_once(g_once_flag, []() { - g_settings_sp_ptr = new ThreadPropertiesSP(new ThreadProperties(true)); - }); + static ThreadPropertiesSP *g_settings_sp_ptr = + new ThreadPropertiesSP(new ThreadProperties(true)); return *g_settings_sp_ptr; } Index: lldb/trunk/source/Target/Process.cpp =================================================================== --- lldb/trunk/source/Target/Process.cpp +++ lldb/trunk/source/Target/Process.cpp @@ -812,11 +812,8 @@ const ProcessPropertiesSP &Process::GetGlobalProperties() { // NOTE: intentional leak so we don't crash if global destructor chain gets // called as other threads still use the result of this function - static ProcessPropertiesSP *g_settings_sp_ptr = nullptr; - static std::once_flag g_once_flag; - std::call_once(g_once_flag, []() { - g_settings_sp_ptr = new ProcessPropertiesSP(new ProcessProperties(nullptr)); - }); + static ProcessPropertiesSP *g_settings_sp_ptr = + new ProcessPropertiesSP(new ProcessProperties(nullptr)); return *g_settings_sp_ptr; }
Index: lldb/trunk/source/Target/Target.cpp =================================================================== --- lldb/trunk/source/Target/Target.cpp +++ lldb/trunk/source/Target/Target.cpp @@ -2643,11 +2643,8 @@ const TargetPropertiesSP &Target::GetGlobalProperties() { // NOTE: intentional leak so we don't crash if global destructor chain gets // called as other threads still use the result of this function - static TargetPropertiesSP *g_settings_sp_ptr = nullptr; - static std::once_flag g_once_flag; - std::call_once(g_once_flag, []() { - g_settings_sp_ptr = new TargetPropertiesSP(new TargetProperties(nullptr)); - }); + static TargetPropertiesSP *g_settings_sp_ptr = + new TargetPropertiesSP(new TargetProperties(nullptr)); return *g_settings_sp_ptr; } Index: lldb/trunk/source/Target/Thread.cpp =================================================================== --- lldb/trunk/source/Target/Thread.cpp +++ lldb/trunk/source/Target/Thread.cpp @@ -58,11 +58,8 @@ const ThreadPropertiesSP &Thread::GetGlobalProperties() { // NOTE: intentional leak so we don't crash if global destructor chain gets // called as other threads still use the result of this function - static ThreadPropertiesSP *g_settings_sp_ptr = nullptr; - static std::once_flag g_once_flag; - std::call_once(g_once_flag, []() { - g_settings_sp_ptr = new ThreadPropertiesSP(new ThreadProperties(true)); - }); + static ThreadPropertiesSP *g_settings_sp_ptr = + new ThreadPropertiesSP(new ThreadProperties(true)); return *g_settings_sp_ptr; } Index: lldb/trunk/source/Target/Process.cpp =================================================================== --- lldb/trunk/source/Target/Process.cpp +++ lldb/trunk/source/Target/Process.cpp @@ -812,11 +812,8 @@ const ProcessPropertiesSP &Process::GetGlobalProperties() { // NOTE: intentional leak so we don't crash if global destructor chain gets // called as other threads still use the result of this function - static ProcessPropertiesSP *g_settings_sp_ptr = nullptr; - static std::once_flag g_once_flag; - std::call_once(g_once_flag, []() { - g_settings_sp_ptr = new ProcessPropertiesSP(new ProcessProperties(nullptr)); - }); + static ProcessPropertiesSP *g_settings_sp_ptr = + new ProcessPropertiesSP(new ProcessProperties(nullptr)); return *g_settings_sp_ptr; }
_______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits