From df96dd754efc8b06a7a1e78582386eb3e66e1146 Mon Sep 17 00:00:00 2001 From: Greg Clayton Date: Tue, 27 Aug 2013 19:53:47 +0000 Subject: Moved the static s_regex into a function body to allow it to be lazily initialized when/if it is ever used. We try to avoid global constructors when building shared libraries on Darwin. llvm-svn: 189397 --- lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp') diff --git a/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp b/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp index 59f9ad728c9..099b72a73f8 100644 --- a/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp +++ b/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp @@ -369,10 +369,7 @@ public: } } - if (!s_regex.IsValid()) - { - s_regex.Compile("[ \t]*([^ ^\t]+)[ \t]*([^ ^\t].*)?", REG_EXTENDED); - } + static RegularExpression s_regex("[ \t]*([^ ^\t]+)[ \t]*([^ ^\t].*)?", REG_EXTENDED); RegularExpression::Match matches(3); @@ -412,11 +409,9 @@ protected: LazyBool m_does_branch; bool m_is_valid; bool m_using_file_addr; - - static RegularExpression s_regex; }; -RegularExpression InstructionLLVMC::s_regex; + DisassemblerLLVMC::LLVMCDisassembler::LLVMCDisassembler (const char *triple, unsigned flavor, DisassemblerLLVMC &owner): m_is_valid(true) -- cgit v1.2.3