diff options
author | Adrian McCarthy <amccarth@google.com> | 2015-11-30 22:18:43 +0000 |
---|---|---|
committer | Adrian McCarthy <amccarth@google.com> | 2015-11-30 22:18:43 +0000 |
commit | fe06b5ad040cdb692aa8738fd619eb2e2c093045 (patch) | |
tree | 9f98d886b943c2be66c18cccda9fffa45635bc89 /lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp | |
parent | a94e6e7eb0bae48ebac1ef1cdcceb04d4b300724 (diff) | |
download | bcm5719-llvm-fe06b5ad040cdb692aa8738fd619eb2e2c093045.tar.gz bcm5719-llvm-fe06b5ad040cdb692aa8738fd619eb2e2c093045.zip |
Fix hang in global static initialization
Differential Revision: http://reviews.llvm.org/D15092
llvm-svn: 254338
Diffstat (limited to 'lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp')
-rw-r--r-- | lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp b/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp index f0593efb35b..3e248dda50e 100644 --- a/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp +++ b/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp @@ -182,7 +182,7 @@ struct RenderScriptRuntime::Element empirical_type<uint32_t> array_size; // Number of items in array, only needed for strucrs ConstString type_name; // Name of type, only needed for structs - static const ConstString FallbackStructName; // Print this as the type name of a struct Element + static const ConstString &GetFallbackStructName(); // Print this as the type name of a struct Element // If we can't resolve the actual struct name }; @@ -250,7 +250,13 @@ struct RenderScriptRuntime::AllocationDetails } }; -const ConstString RenderScriptRuntime::Element::FallbackStructName("struct"); + +const ConstString & +RenderScriptRuntime::Element::GetFallbackStructName() +{ + static const ConstString FallbackStructName("struct"); + return FallbackStructName; +} unsigned int RenderScriptRuntime::AllocationDetails::ID = 1; @@ -1629,7 +1635,7 @@ RenderScriptRuntime::FindStructTypeName(Element& elem, StackFrame* frame_ptr) if (!elem.type_name.IsEmpty()) // Name already set return; else - elem.type_name = Element::FallbackStructName; // Default type name if we don't succeed + elem.type_name = Element::GetFallbackStructName(); // Default type name if we don't succeed // Find all the global variables from the script rs modules VariableList variable_list; @@ -2428,7 +2434,7 @@ RenderScriptRuntime::DumpAllocation(Stream &strm, StackFrame* frame_ptr, const u { strm.Printf("\n(%u, %u, %u) = ", x, y, z); if ((type == Element::RS_TYPE_NONE) && (alloc->element.children.size() > 0) && - (alloc->element.type_name != Element::FallbackStructName)) + (alloc->element.type_name != Element::GetFallbackStructName())) { // Here we are dumping an Element of struct type. // This is done using expression evaluation with the name of the struct type and pointer to element. |