[Lldb-commits] [lldb] r189397 - 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.
Greg Clayton
gclayton at apple.com
Tue Aug 27 12:53:47 PDT 2013
Author: gclayton
Date: Tue Aug 27 14:53:47 2013
New Revision: 189397
URL: http://llvm.org/viewvc/llvm-project?rev=189397&view=rev
Log:
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.
Modified:
lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp
Modified: lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp?rev=189397&r1=189396&r2=189397&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp (original)
+++ lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp Tue Aug 27 14:53:47 2013
@@ -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)
More information about the lldb-commits
mailing list