diff options
| author | Zachary Turner <zturner@google.com> | 2016-09-21 16:01:28 +0000 |
|---|---|---|
| committer | Zachary Turner <zturner@google.com> | 2016-09-21 16:01:28 +0000 |
| commit | 95eae4235d4cfa5cee67ab6c4e686baf8a57e9e5 (patch) | |
| tree | 0e9d2a42e76e13cf5ed5d6a8f0b935a83e40ea69 /lldb/source/Interpreter/Args.cpp | |
| parent | 07171f21d148d340115ec634be6a7f296799517d (diff) | |
| download | bcm5719-llvm-95eae4235d4cfa5cee67ab6c4e686baf8a57e9e5.tar.gz bcm5719-llvm-95eae4235d4cfa5cee67ab6c4e686baf8a57e9e5.zip | |
Make lldb::Regex use StringRef.
This updates getters and setters to use StringRef instead of
const char *. I tested the build on Linux, Windows, and OSX
and saw no build or test failures. I cannot test any BSD
or Android variants, however I expect the required changes
to be minimal or non-existant.
llvm-svn: 282079
Diffstat (limited to 'lldb/source/Interpreter/Args.cpp')
| -rw-r--r-- | lldb/source/Interpreter/Args.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lldb/source/Interpreter/Args.cpp b/lldb/source/Interpreter/Args.cpp index c34b75e169c..3c2e3558c69 100644 --- a/lldb/source/Interpreter/Args.cpp +++ b/lldb/source/Interpreter/Args.cpp @@ -608,6 +608,8 @@ lldb::addr_t Args::StringToAddress(const ExecutionContext *exe_ctx, Error *error_ptr) { bool error_set = false; if (s && s[0]) { + llvm::StringRef sref = s; + char *end = nullptr; lldb::addr_t addr = ::strtoull(s, &end, 0); if (*end == '\0') { @@ -662,10 +664,10 @@ lldb::addr_t Args::StringToAddress(const ExecutionContext *exe_ctx, // Since the compiler can't handle things like "main + 12" we should // try to do this for now. The compiler doesn't like adding offsets // to function pointer types. - static RegularExpression g_symbol_plus_offset_regex( - "^(.*)([-\\+])[[:space:]]*(0x[0-9A-Fa-f]+|[0-9]+)[[:space:]]*$"); + static RegularExpression g_symbol_plus_offset_regex(llvm::StringRef( + "^(.*)([-\\+])[[:space:]]*(0x[0-9A-Fa-f]+|[0-9]+)[[:space:]]*$")); RegularExpression::Match regex_match(3); - if (g_symbol_plus_offset_regex.Execute(s, ®ex_match)) { + if (g_symbol_plus_offset_regex.Execute(sref, ®ex_match)) { uint64_t offset = 0; bool add = true; std::string name; |

