diff options
author | Greg Clayton <gclayton@apple.com> | 2013-08-27 19:53:47 +0000 |
---|---|---|
committer | Greg Clayton <gclayton@apple.com> | 2013-08-27 19:53:47 +0000 |
commit | df96dd754efc8b06a7a1e78582386eb3e66e1146 (patch) | |
tree | 68ffc6b856dede7572e51d0442f3dd0e33005914 /lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp | |
parent | 4e07b95dafc18f63aca9c1f77a0ecf5b27b97592 (diff) | |
download | bcm5719-llvm-df96dd754efc8b06a7a1e78582386eb3e66e1146.tar.gz bcm5719-llvm-df96dd754efc8b06a7a1e78582386eb3e66e1146.zip |
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
Diffstat (limited to 'lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp')
-rw-r--r-- | lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp | 9 |
1 files changed, 2 insertions, 7 deletions
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) |