summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/LanguageRuntime
diff options
context:
space:
mode:
authorAdrian Prantl <aprantl@apple.com>2019-10-17 19:56:40 +0000
committerAdrian Prantl <aprantl@apple.com>2019-10-17 19:56:40 +0000
commit1ad655e255090620705eb4ce85d869a54d971912 (patch)
tree0aea7b3e59e4569096a15f8ab9f661e4595983b7 /lldb/source/Plugins/LanguageRuntime
parente3905dee0044c8b6c5f3a9cf46b9b6fe45039da6 (diff)
downloadbcm5719-llvm-1ad655e255090620705eb4ce85d869a54d971912.tar.gz
bcm5719-llvm-1ad655e255090620705eb4ce85d869a54d971912.zip
Modernize the rest of the Find.* API (NFC)
This patch removes the size_t return value and the append parameter from the remainder of the Find.* functions in LLDB's internal API. As in the previous patches, this is motivated by the fact that these parameters aren't really used, and in the case of the append parameter were frequently implemented incorrectly. Differential Revision: https://reviews.llvm.org/D69119 llvm-svn: 375160
Diffstat (limited to 'lldb/source/Plugins/LanguageRuntime')
-rw-r--r--lldb/source/Plugins/LanguageRuntime/CPlusPlus/CPPLanguageRuntime.cpp2
-rw-r--r--lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp23
-rw-r--r--lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp5
-rw-r--r--lldb/source/Plugins/LanguageRuntime/ObjC/ObjCLanguageRuntime.cpp4
4 files changed, 20 insertions, 14 deletions
diff --git a/lldb/source/Plugins/LanguageRuntime/CPlusPlus/CPPLanguageRuntime.cpp b/lldb/source/Plugins/LanguageRuntime/CPlusPlus/CPPLanguageRuntime.cpp
index b392282c3eb..f38014505a8 100644
--- a/lldb/source/Plugins/LanguageRuntime/CPlusPlus/CPPLanguageRuntime.cpp
+++ b/lldb/source/Plugins/LanguageRuntime/CPlusPlus/CPPLanguageRuntime.cpp
@@ -231,7 +231,7 @@ CPPLanguageRuntime::FindLibCppStdFunctionCallableInfo(
SymbolContextList scl;
target.GetImages().FindSymbolsMatchingRegExAndType(
- RegularExpression{R"(^)" + func_to_match}, eSymbolTypeAny, scl, true);
+ RegularExpression{R"(^)" + func_to_match}, eSymbolTypeAny, scl);
// Case 1,2 or 3
if (scl.GetSize() >= 1) {
diff --git a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp
index 52ed3628520..8ca9ad7b843 100644
--- a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp
+++ b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp
@@ -223,11 +223,14 @@ Address *AppleObjCRuntime::GetPrintForDebuggerAddr() {
SymbolContextList contexts;
SymbolContext context;
- if ((!modules.FindSymbolsWithNameAndType(ConstString("_NSPrintForDebugger"),
- eSymbolTypeCode, contexts)) &&
- (!modules.FindSymbolsWithNameAndType(ConstString("_CFPrintForDebugger"),
- eSymbolTypeCode, contexts)))
- return nullptr;
+ modules.FindSymbolsWithNameAndType(ConstString("_NSPrintForDebugger"),
+ eSymbolTypeCode, contexts);
+ if (contexts.IsEmpty()) {
+ modules.FindSymbolsWithNameAndType(ConstString("_CFPrintForDebugger"),
+ eSymbolTypeCode, contexts);
+ if (contexts.IsEmpty())
+ return nullptr;
+ }
contexts.GetContextAtIndex(0, context);
@@ -444,10 +447,12 @@ bool AppleObjCRuntime::CalculateHasNewLiteralsAndIndexing() {
SymbolContextList sc_list;
- return target.GetImages().FindSymbolsWithNameAndType(
- s_method_signature, eSymbolTypeCode, sc_list) ||
- target.GetImages().FindSymbolsWithNameAndType(
- s_arclite_method_signature, eSymbolTypeCode, sc_list);
+ target.GetImages().FindSymbolsWithNameAndType(s_method_signature,
+ eSymbolTypeCode, sc_list);
+ if (sc_list.IsEmpty())
+ target.GetImages().FindSymbolsWithNameAndType(s_arclite_method_signature,
+ eSymbolTypeCode, sc_list);
+ return !sc_list.IsEmpty();
}
lldb::SearchFilterSP AppleObjCRuntime::CreateExceptionSearchFilter() {
diff --git a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
index d5a47d16086..9bdbef393e3 100644
--- a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
+++ b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
@@ -2640,8 +2640,9 @@ bool AppleObjCRuntimeV2::GetCFBooleanValuesIfNeeded() {
std::function<lldb::addr_t(ConstString)> get_symbol =
[this](ConstString sym) -> lldb::addr_t {
SymbolContextList sc_list;
- if (GetProcess()->GetTarget().GetImages().FindSymbolsWithNameAndType(
- sym, lldb::eSymbolTypeData, sc_list) == 1) {
+ GetProcess()->GetTarget().GetImages().FindSymbolsWithNameAndType(
+ sym, lldb::eSymbolTypeData, sc_list);
+ if (sc_list.GetSize() == 1) {
SymbolContext sc;
sc_list.GetContextAtIndex(0, sc);
if (sc.symbol)
diff --git a/lldb/source/Plugins/LanguageRuntime/ObjC/ObjCLanguageRuntime.cpp b/lldb/source/Plugins/LanguageRuntime/ObjC/ObjCLanguageRuntime.cpp
index 31aac728460..87ae4c2c6c4 100644
--- a/lldb/source/Plugins/LanguageRuntime/ObjC/ObjCLanguageRuntime.cpp
+++ b/lldb/source/Plugins/LanguageRuntime/ObjC/ObjCLanguageRuntime.cpp
@@ -103,8 +103,8 @@ ObjCLanguageRuntime::LookupInCompleteClassCache(ConstString &name) {
const ModuleList &modules = m_process->GetTarget().GetImages();
SymbolContextList sc_list;
- const size_t matching_symbols =
- modules.FindSymbolsWithNameAndType(name, eSymbolTypeObjCClass, sc_list);
+ modules.FindSymbolsWithNameAndType(name, eSymbolTypeObjCClass, sc_list);
+ const size_t matching_symbols = sc_list.GetSize();
if (matching_symbols) {
SymbolContext sc;
OpenPOWER on IntegriCloud