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/API/SBTarget.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/API/SBTarget.cpp')
-rw-r--r-- | lldb/source/API/SBTarget.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/lldb/source/API/SBTarget.cpp b/lldb/source/API/SBTarget.cpp index 9449e9aff2d..8616d22d0e3 100644 --- a/lldb/source/API/SBTarget.cpp +++ b/lldb/source/API/SBTarget.cpp @@ -869,7 +869,7 @@ lldb::SBBreakpoint SBTarget::BreakpointCreateByRegex( TargetSP target_sp(GetSP()); if (target_sp && symbol_name_regex && symbol_name_regex[0]) { std::lock_guard<std::recursive_mutex> guard(target_sp->GetAPIMutex()); - RegularExpression regexp(symbol_name_regex); + RegularExpression regexp((llvm::StringRef(symbol_name_regex))); const bool internal = false; const bool hardware = false; const LazyBool skip_prologue = eLazyBoolCalculate; @@ -978,7 +978,7 @@ lldb::SBBreakpoint SBTarget::BreakpointCreateBySourceRegex( std::lock_guard<std::recursive_mutex> guard(target_sp->GetAPIMutex()); const bool hardware = false; const LazyBool move_to_nearest_code = eLazyBoolCalculate; - RegularExpression regexp(source_regex); + RegularExpression regexp((llvm::StringRef(source_regex))); std::unordered_set<std::string> func_names_set; for (size_t i = 0; i < func_names.GetSize(); i++) { func_names_set.insert(func_names.GetStringAtIndex(i)); @@ -1599,18 +1599,19 @@ lldb::SBSymbolContextList SBTarget::FindGlobalFunctions(const char *name, MatchType matchtype) { lldb::SBSymbolContextList sb_sc_list; if (name && name[0]) { + llvm::StringRef name_ref(name); TargetSP target_sp(GetSP()); if (target_sp) { std::string regexstr; switch (matchtype) { case eMatchTypeRegex: - target_sp->GetImages().FindFunctions(RegularExpression(name), true, + target_sp->GetImages().FindFunctions(RegularExpression(name_ref), true, true, true, *sb_sc_list); break; case eMatchTypeStartsWith: regexstr = llvm::Regex::escape(name) + ".*"; - target_sp->GetImages().FindFunctions( - RegularExpression(regexstr.c_str()), true, true, true, *sb_sc_list); + target_sp->GetImages().FindFunctions(RegularExpression(regexstr), true, + true, true, *sb_sc_list); break; default: target_sp->GetImages().FindFunctions(ConstString(name), @@ -1778,6 +1779,7 @@ SBValueList SBTarget::FindGlobalVariables(const char *name, TargetSP target_sp(GetSP()); if (name && target_sp) { + llvm::StringRef name_ref(name); VariableList variable_list; const bool append = true; @@ -1790,13 +1792,12 @@ SBValueList SBTarget::FindGlobalVariables(const char *name, break; case eMatchTypeRegex: match_count = target_sp->GetImages().FindGlobalVariables( - RegularExpression(name), append, max_matches, variable_list); + RegularExpression(name_ref), append, max_matches, variable_list); break; case eMatchTypeStartsWith: regexstr = llvm::Regex::escape(name) + ".*"; match_count = target_sp->GetImages().FindGlobalVariables( - RegularExpression(regexstr.c_str()), append, max_matches, - variable_list); + RegularExpression(regexstr), append, max_matches, variable_list); break; } |