From 706b4fc47bbc608932d3b491ae19a3b9cde9497b Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Fri, 17 Jan 2020 20:45:01 +0000 Subject: Vendor import of llvm-project master e26a78e70, the last commit before the llvmorg-11-init tag, from which release/10.x was branched. --- lldb/source/API/SBModule.cpp | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) (limited to 'lldb/source/API/SBModule.cpp') diff --git a/lldb/source/API/SBModule.cpp b/lldb/source/API/SBModule.cpp index 6cc6d2628ace..4e9dfb0c1e62 100644 --- a/lldb/source/API/SBModule.cpp +++ b/lldb/source/API/SBModule.cpp @@ -245,7 +245,7 @@ bool SBModule::GetDescription(SBStream &description) { ModuleSP module_sp(GetSP()); if (module_sp) { - module_sp->GetDescription(&strm); + module_sp->GetDescription(strm.AsRawOstream()); } else strm.PutCString("No value"); @@ -419,16 +419,12 @@ SBValueList SBModule::FindGlobalVariables(SBTarget &target, const char *name, VariableList variable_list; module_sp->FindGlobalVariables(ConstString(name), nullptr, max_matches, variable_list); - const uint32_t match_count = variable_list.GetSize(); - if (match_count > 0) { - for (uint32_t i = 0; i < match_count; ++i) { - lldb::ValueObjectSP valobj_sp; - TargetSP target_sp(target.GetSP()); - valobj_sp = ValueObjectVariable::Create( - target_sp.get(), variable_list.GetVariableAtIndex(i)); - if (valobj_sp) - sb_value_list.Append(SBValue(valobj_sp)); - } + for (const VariableSP &var_sp : variable_list) { + lldb::ValueObjectSP valobj_sp; + TargetSP target_sp(target.GetSP()); + valobj_sp = ValueObjectVariable::Create(target_sp.get(), var_sp); + if (valobj_sp) + sb_value_list.Append(SBValue(valobj_sp)); } } -- cgit v1.3