diff options
author | Jonas Devlieghere <jonas@devlieghere.com> | 2019-08-16 21:25:36 +0000 |
---|---|---|
committer | Jonas Devlieghere <jonas@devlieghere.com> | 2019-08-16 21:25:36 +0000 |
commit | 3af3f1e8e253d93cb655388af69f4ed1722b4f51 (patch) | |
tree | 44b9e8ecf404119a1a81b54e27ea6559a5f5dd9a /lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp | |
parent | 250aafa2c4a1bc2395edfe8d4365545bbe56fffe (diff) | |
download | bcm5719-llvm-3af3f1e8e253d93cb655388af69f4ed1722b4f51.tar.gz bcm5719-llvm-3af3f1e8e253d93cb655388af69f4ed1722b4f51.zip |
[Utility] Reimplement RegularExpression on top of llvm::Regex
Originally I wanted to remove the RegularExpression class in Utility and
replace it with llvm::Regex. However, during that transition I noticed
that there are several places where need the regular expression string.
So instead I propose to keep the RegularExpression class and make it a
thin wrapper around llvm::Regex.
This patch also removes the workaround for empty regular expressions.
The result is that we are now (more or less) POSIX conformant.
Differential revision: https://reviews.llvm.org/D66174
llvm-svn: 369153
Diffstat (limited to 'lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp')
-rw-r--r-- | lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp b/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp index 44c75fc953c..87ba029f59e 100644 --- a/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp +++ b/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp @@ -381,11 +381,10 @@ public: static RegularExpression s_regex( llvm::StringRef("[ \t]*([^ ^\t]+)[ \t]*([^ ^\t].*)?")); - RegularExpression::Match matches(3); - + llvm::SmallVector<llvm::StringRef, 4> matches; if (s_regex.Execute(out_string, &matches)) { - matches.GetMatchAtIndex(out_string.c_str(), 1, m_opcode_name); - matches.GetMatchAtIndex(out_string.c_str(), 2, m_mnemonics); + m_opcode_name = matches[1].str(); + m_mnemonics = matches[2].str(); } } } |