Skip to content

Commit d47a219

Browse files
committed
[lldb] Fix returns in AddObjectFileToReflectionContext
At some point the return type of AddObjectFileToReflectionContext was changed from bool to std::optional<uint32_t>. However the return statements werent updated, and returns that should be "none" were being implictly being converted to some(0).
1 parent 0a6c83e commit d47a219

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lldb/source/Plugins/LanguageRuntime/Swift/SwiftLanguageRuntime.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -722,7 +722,7 @@ SwiftLanguageRuntimeImpl::AddObjectFileToReflectionContext(
722722

723723
auto obj_file_format = GetObjectFileFormat(obj_format_type);
724724
if (!obj_file_format)
725-
return false;
725+
return {};
726726

727727
bool should_register_with_symbol_obj_file = [&]() -> bool {
728728
if (!m_process.GetTarget().GetSwiftReadMetadataFromDSYM())
@@ -772,15 +772,15 @@ SwiftLanguageRuntimeImpl::AddObjectFileToReflectionContext(
772772
}
773773

774774
if (!maybe_segment_name)
775-
return false;
775+
return {};
776776

777777
llvm::StringRef segment_name = *maybe_segment_name;
778778

779779
auto lldb_memory_reader = GetMemoryReader();
780780
auto maybe_start_and_end = lldb_memory_reader->addModuleToAddressMap(
781781
module, should_register_with_symbol_obj_file);
782782
if (!maybe_start_and_end)
783-
return false;
783+
return {};
784784

785785
uint64_t start_address, end_address;
786786
std::tie(start_address, end_address) = *maybe_start_and_end;
@@ -794,7 +794,7 @@ SwiftLanguageRuntimeImpl::AddObjectFileToReflectionContext(
794794
});
795795

796796
if (segment_iter == section_list->end())
797-
return false;
797+
return {};
798798

799799
auto *segment = segment_iter->get();
800800
Section *maybe_secondary_segment = nullptr;

0 commit comments

Comments
 (0)