[lldb] Use value_or instead of getValueOr (NFC)

This commit is contained in:
Kazu Hirata
2022-06-19 09:12:01 -07:00
parent 0399473de8
commit aa88161b37
37 changed files with 87 additions and 86 deletions

View File

@@ -100,10 +100,10 @@ BreakpointResolverFileLine::SerializeToStructuredData() {
options_dict_sp->AddStringItem(GetKey(OptionNames::FileName),
m_location_spec.GetFileSpec().GetPath());
options_dict_sp->AddIntegerItem(GetKey(OptionNames::LineNumber),
m_location_spec.GetLine().getValueOr(0));
m_location_spec.GetLine().value_or(0));
options_dict_sp->AddIntegerItem(
GetKey(OptionNames::Column),
m_location_spec.GetColumn().getValueOr(LLDB_INVALID_COLUMN_NUMBER));
m_location_spec.GetColumn().value_or(LLDB_INVALID_COLUMN_NUMBER));
options_dict_sp->AddBooleanItem(GetKey(OptionNames::Inlines),
m_location_spec.GetCheckInlines());
options_dict_sp->AddBooleanItem(GetKey(OptionNames::ExactMatch),
@@ -227,7 +227,7 @@ Searcher::CallbackReturn BreakpointResolverFileLine::SearchCallback(
// file. So we go through the match list and pull out the sets that have the
// same file spec in their line_entry and treat each set separately.
const uint32_t line = m_location_spec.GetLine().getValueOr(0);
const uint32_t line = m_location_spec.GetLine().value_or(0);
const llvm::Optional<uint16_t> column = m_location_spec.GetColumn();
// We'll create a new SourceLocationSpec that can take into account the
@@ -238,7 +238,7 @@ Searcher::CallbackReturn BreakpointResolverFileLine::SearchCallback(
if (is_relative)
search_file_spec.GetDirectory().Clear();
SourceLocationSpec search_location_spec(
search_file_spec, m_location_spec.GetLine().getValueOr(0),
search_file_spec, m_location_spec.GetLine().value_or(0),
m_location_spec.GetColumn(), m_location_spec.GetCheckInlines(),
m_location_spec.GetExactMatch());
@@ -272,7 +272,7 @@ lldb::SearchDepth BreakpointResolverFileLine::GetDepth() {
void BreakpointResolverFileLine::GetDescription(Stream *s) {
s->Printf("file = '%s', line = %u, ",
m_location_spec.GetFileSpec().GetPath().c_str(),
m_location_spec.GetLine().getValueOr(0));
m_location_spec.GetLine().value_or(0));
auto column = m_location_spec.GetColumn();
if (column)
s->Printf("column = %u, ", *column);