[Lldb-commits] [lldb] 8600014 - [lldb] Use Optional::{has_value, value, value_or}
Kazu Hirata via lldb-commits
lldb-commits at lists.llvm.org
Fri Sep 23 09:10:49 PDT 2022
Author: Kazu Hirata
Date: 2022-09-23T09:10:40-07:00
New Revision: 8600014b78d314e53fd941f93811492caeba2d0f
URL: https://github.com/llvm/llvm-project/commit/8600014b78d314e53fd941f93811492caeba2d0f
DIFF: https://github.com/llvm/llvm-project/commit/8600014b78d314e53fd941f93811492caeba2d0f.diff
LOG: [lldb] Use Optional::{has_value,value,value_or}
Added:
Modified:
lldb/source/Breakpoint/BreakpointResolverFileLine.cpp
lldb/source/Target/PathMappingList.cpp
Removed:
################################################################################
diff --git a/lldb/source/Breakpoint/BreakpointResolverFileLine.cpp b/lldb/source/Breakpoint/BreakpointResolverFileLine.cpp
index f911697f5ddc5..9e1fbcb70dc19 100644
--- a/lldb/source/Breakpoint/BreakpointResolverFileLine.cpp
+++ b/lldb/source/Breakpoint/BreakpointResolverFileLine.cpp
@@ -240,13 +240,13 @@ void BreakpointResolverFileLine::DeduceSourceMapping(
// Adding back any potentially reverse mapping stripped prefix.
// for new_mapping_to.
- if (m_removed_prefix_opt.hasValue())
- llvm::sys::path::append(new_mapping_to, m_removed_prefix_opt.getValue());
+ if (m_removed_prefix_opt.has_value())
+ llvm::sys::path::append(new_mapping_to, m_removed_prefix_opt.value());
llvm::Optional<llvm::StringRef> new_mapping_from_opt =
check_suffix(sc_file_dir, request_file_dir, case_sensitive);
if (new_mapping_from_opt) {
- new_mapping_from = new_mapping_from_opt.getValue();
+ new_mapping_from = new_mapping_from_opt.value();
if (new_mapping_to.empty())
new_mapping_to = ".";
} else {
@@ -254,7 +254,7 @@ void BreakpointResolverFileLine::DeduceSourceMapping(
check_suffix(request_file_dir, sc_file_dir, case_sensitive);
if (new_mapping_to_opt) {
new_mapping_from = ".";
- llvm::sys::path::append(new_mapping_to, new_mapping_to_opt.getValue());
+ llvm::sys::path::append(new_mapping_to, new_mapping_to_opt.value());
}
}
diff --git a/lldb/source/Target/PathMappingList.cpp b/lldb/source/Target/PathMappingList.cpp
index d2d60822b237e..cbee5934846a0 100644
--- a/lldb/source/Target/PathMappingList.cpp
+++ b/lldb/source/Target/PathMappingList.cpp
@@ -229,7 +229,7 @@ PathMappingList::ReverseRemapPath(const FileSpec &file, FileSpec &fixed) const {
if (!path_ref.consume_front(it.second.GetStringRef()))
continue;
auto orig_file = it.first.GetStringRef();
- auto orig_style = FileSpec::GuessPathStyle(orig_file).getValueOr(
+ auto orig_style = FileSpec::GuessPathStyle(orig_file).value_or(
llvm::sys::path::Style::native);
fixed.SetFile(orig_file, orig_style);
AppendPathComponents(fixed, path_ref, orig_style);
More information about the lldb-commits
mailing list