aboutsummaryrefslogtreecommitdiff
path: root/lldb/source
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source')
-rw-r--r--lldb/source/API/SBMemoryRegionInfo.cpp8
-rw-r--r--lldb/source/Breakpoint/BreakpointIDList.cpp6
-rw-r--r--lldb/source/Commands/CommandObjectFrame.cpp10
-rw-r--r--lldb/source/Commands/CommandObjectMemory.cpp4
-rw-r--r--lldb/source/Core/DataFileCache.cpp6
-rw-r--r--lldb/source/Core/DumpDataExtractor.cpp8
-rw-r--r--lldb/source/Core/ValueObjectChild.cpp8
-rw-r--r--lldb/source/Host/common/File.cpp11
-rw-r--r--lldb/source/Host/common/Terminal.cpp4
-rw-r--r--lldb/source/Plugins/ABI/X86/ABIX86.cpp4
-rw-r--r--lldb/source/Plugins/Disassembler/LLVMC/DisassemblerLLVMC.cpp8
-rw-r--r--lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp12
-rw-r--r--lldb/source/Plugins/Language/CPlusPlus/CPlusPlusNameParser.cpp14
-rw-r--r--lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp4
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp8
-rw-r--r--lldb/source/Plugins/SymbolFile/Breakpad/SymbolFileBreakpad.cpp4
-rw-r--r--lldb/source/Target/Thread.cpp3
-rw-r--r--lldb/source/Target/UnixSignals.cpp7
-rw-r--r--lldb/source/Utility/SelectHelper.cpp12
19 files changed, 68 insertions, 73 deletions
diff --git a/lldb/source/API/SBMemoryRegionInfo.cpp b/lldb/source/API/SBMemoryRegionInfo.cpp
index d0f7437..f4d78cf 100644
--- a/lldb/source/API/SBMemoryRegionInfo.cpp
+++ b/lldb/source/API/SBMemoryRegionInfo.cpp
@@ -135,8 +135,8 @@ uint32_t SBMemoryRegionInfo::GetNumDirtyPages() {
uint32_t num_dirty_pages = 0;
const llvm::Optional<std::vector<addr_t>> &dirty_page_list =
m_opaque_up->GetDirtyPageList();
- if (dirty_page_list.hasValue())
- num_dirty_pages = dirty_page_list.getValue().size();
+ if (dirty_page_list)
+ num_dirty_pages = dirty_page_list->size();
return num_dirty_pages;
}
@@ -147,8 +147,8 @@ addr_t SBMemoryRegionInfo::GetDirtyPageAddressAtIndex(uint32_t idx) {
addr_t dirty_page_addr = LLDB_INVALID_ADDRESS;
const llvm::Optional<std::vector<addr_t>> &dirty_page_list =
m_opaque_up->GetDirtyPageList();
- if (dirty_page_list.hasValue() && idx < dirty_page_list.getValue().size())
- dirty_page_addr = dirty_page_list.getValue()[idx];
+ if (dirty_page_list && idx < dirty_page_list->size())
+ dirty_page_addr = dirty_page_list.value()[idx];
return dirty_page_addr;
}
diff --git a/lldb/source/Breakpoint/BreakpointIDList.cpp b/lldb/source/Breakpoint/BreakpointIDList.cpp
index b434056..20f75662 100644
--- a/lldb/source/Breakpoint/BreakpointIDList.cpp
+++ b/lldb/source/Breakpoint/BreakpointIDList.cpp
@@ -192,16 +192,14 @@ void BreakpointIDList::FindAndReplaceIDRanges(Args &old_args, Target *target,
auto start_bp = BreakpointID::ParseCanonicalReference(range_from);
auto end_bp = BreakpointID::ParseCanonicalReference(range_to);
- if (!start_bp.hasValue() ||
- !target->GetBreakpointByID(start_bp->GetBreakpointID())) {
+ if (!start_bp || !target->GetBreakpointByID(start_bp->GetBreakpointID())) {
new_args.Clear();
result.AppendErrorWithFormat("'%s' is not a valid breakpoint ID.\n",
range_from.str().c_str());
return;
}
- if (!end_bp.hasValue() ||
- !target->GetBreakpointByID(end_bp->GetBreakpointID())) {
+ if (!end_bp || !target->GetBreakpointByID(end_bp->GetBreakpointID())) {
new_args.Clear();
result.AppendErrorWithFormat("'%s' is not a valid breakpoint ID.\n",
range_to.str().c_str());
diff --git a/lldb/source/Commands/CommandObjectFrame.cpp b/lldb/source/Commands/CommandObjectFrame.cpp
index 4081e87..dfe1e14 100644
--- a/lldb/source/Commands/CommandObjectFrame.cpp
+++ b/lldb/source/Commands/CommandObjectFrame.cpp
@@ -137,16 +137,16 @@ protected:
ValueObjectSP valobj_sp;
- if (m_options.address.hasValue()) {
- if (m_options.reg.hasValue() || m_options.offset.hasValue()) {
+ if (m_options.address) {
+ if (m_options.reg || m_options.offset) {
result.AppendError(
"`frame diagnose --address` is incompatible with other arguments.");
return false;
}
- valobj_sp = frame_sp->GuessValueForAddress(m_options.address.getValue());
- } else if (m_options.reg.hasValue()) {
+ valobj_sp = frame_sp->GuessValueForAddress(*m_options.address);
+ } else if (m_options.reg) {
valobj_sp = frame_sp->GuessValueForRegisterAndOffset(
- m_options.reg.getValue(), m_options.offset.value_or(0));
+ m_options.reg.value(), m_options.offset.value_or(0));
} else {
StopInfoSP stop_info_sp = thread->GetStopInfo();
if (!stop_info_sp) {
diff --git a/lldb/source/Commands/CommandObjectMemory.cpp b/lldb/source/Commands/CommandObjectMemory.cpp
index 117b5f4..be887f1 100644
--- a/lldb/source/Commands/CommandObjectMemory.cpp
+++ b/lldb/source/Commands/CommandObjectMemory.cpp
@@ -1737,8 +1737,8 @@ protected:
const llvm::Optional<std::vector<addr_t>> &dirty_page_list =
range_info.GetDirtyPageList();
- if (dirty_page_list.hasValue()) {
- const size_t page_count = dirty_page_list.getValue().size();
+ if (dirty_page_list) {
+ const size_t page_count = dirty_page_list->size();
result.AppendMessageWithFormat(
"Modified memory (dirty) page list provided, %zu entries.\n",
page_count);
diff --git a/lldb/source/Core/DataFileCache.cpp b/lldb/source/Core/DataFileCache.cpp
index 5f8568f..b38adfd 100644
--- a/lldb/source/Core/DataFileCache.cpp
+++ b/lldb/source/Core/DataFileCache.cpp
@@ -203,17 +203,17 @@ bool CacheSignature::Encode(DataEncoder &encoder) const {
if (!IsValid())
return false; // Invalid signature, return false!
- if (m_uuid.hasValue()) {
+ if (m_uuid) {
llvm::ArrayRef<uint8_t> uuid_bytes = m_uuid->GetBytes();
encoder.AppendU8(eSignatureUUID);
encoder.AppendU8(uuid_bytes.size());
encoder.AppendData(uuid_bytes);
}
- if (m_mod_time.hasValue()) {
+ if (m_mod_time) {
encoder.AppendU8(eSignatureModTime);
encoder.AppendU32(*m_mod_time);
}
- if (m_obj_mod_time.hasValue()) {
+ if (m_obj_mod_time) {
encoder.AppendU8(eSignatureObjectModTime);
encoder.AppendU32(*m_obj_mod_time);
}
diff --git a/lldb/source/Core/DumpDataExtractor.cpp b/lldb/source/Core/DumpDataExtractor.cpp
index 211e16a..f96c232 100644
--- a/lldb/source/Core/DumpDataExtractor.cpp
+++ b/lldb/source/Core/DumpDataExtractor.cpp
@@ -118,8 +118,8 @@ static lldb::offset_t DumpAPInt(Stream *s, const DataExtractor &data,
lldb::offset_t offset, lldb::offset_t byte_size,
bool is_signed, unsigned radix) {
llvm::Optional<llvm::APInt> apint = GetAPInt(data, &offset, byte_size);
- if (apint.hasValue()) {
- std::string apint_str = toString(apint.getValue(), radix, is_signed);
+ if (apint) {
+ std::string apint_str = toString(*apint, radix, is_signed);
switch (radix) {
case 2:
s->Write("0b", 2);
@@ -670,8 +670,8 @@ lldb::offset_t lldb_private::DumpDataExtractor(
(llvm::APFloat::getSizeInBits(semantics) + 7) / 8;
llvm::Optional<llvm::APInt> apint =
GetAPInt(DE, &offset, semantics_byte_size);
- if (apint.hasValue()) {
- llvm::APFloat apfloat(semantics, apint.getValue());
+ if (apint) {
+ llvm::APFloat apfloat(semantics, *apint);
apfloat.toString(sv, format_precision, format_max_padding);
if (!sv.empty()) {
s->Printf("%*.*s", (int)sv.size(), (int)sv.size(), sv.data());
diff --git a/lldb/source/Core/ValueObjectChild.cpp b/lldb/source/Core/ValueObjectChild.cpp
index a2beeb0..f0c91e4 100644
--- a/lldb/source/Core/ValueObjectChild.cpp
+++ b/lldb/source/Core/ValueObjectChild.cpp
@@ -82,8 +82,8 @@ ConstString ValueObjectChild::GetDisplayTypeName() {
}
LazyBool ValueObjectChild::CanUpdateWithInvalidExecutionContext() {
- if (m_can_update_with_invalid_exe_ctx.hasValue())
- return m_can_update_with_invalid_exe_ctx.getValue();
+ if (m_can_update_with_invalid_exe_ctx)
+ return *m_can_update_with_invalid_exe_ctx;
if (m_parent) {
ValueObject *opinionated_parent =
m_parent->FollowParentChain([](ValueObject *valobj) -> bool {
@@ -93,11 +93,11 @@ LazyBool ValueObjectChild::CanUpdateWithInvalidExecutionContext() {
if (opinionated_parent)
return (m_can_update_with_invalid_exe_ctx =
opinionated_parent->CanUpdateWithInvalidExecutionContext())
- .getValue();
+ .value();
}
return (m_can_update_with_invalid_exe_ctx =
this->ValueObject::CanUpdateWithInvalidExecutionContext())
- .getValue();
+ .value();
}
bool ValueObjectChild::UpdateValue() {
diff --git a/lldb/source/Host/common/File.cpp b/lldb/source/Host/common/File.cpp
index 760fb98..476ab23 100644
--- a/lldb/source/Host/common/File.cpp
+++ b/lldb/source/Host/common/File.cpp
@@ -833,22 +833,19 @@ SerialPort::Create(int fd, OpenOptions options, Options serial_options,
if (llvm::Error error = term.SetRaw())
return std::move(error);
if (serial_options.BaudRate) {
- if (llvm::Error error =
- term.SetBaudRate(serial_options.BaudRate.getValue()))
+ if (llvm::Error error = term.SetBaudRate(*serial_options.BaudRate))
return std::move(error);
}
if (serial_options.Parity) {
- if (llvm::Error error = term.SetParity(serial_options.Parity.getValue()))
+ if (llvm::Error error = term.SetParity(*serial_options.Parity))
return std::move(error);
}
if (serial_options.ParityCheck) {
- if (llvm::Error error =
- term.SetParityCheck(serial_options.ParityCheck.getValue()))
+ if (llvm::Error error = term.SetParityCheck(*serial_options.ParityCheck))
return std::move(error);
}
if (serial_options.StopBits) {
- if (llvm::Error error =
- term.SetStopBits(serial_options.StopBits.getValue()))
+ if (llvm::Error error = term.SetStopBits(*serial_options.StopBits))
return std::move(error);
}
diff --git a/lldb/source/Host/common/Terminal.cpp b/lldb/source/Host/common/Terminal.cpp
index 831e9df..6eb7332 100644
--- a/lldb/source/Host/common/Terminal.cpp
+++ b/lldb/source/Host/common/Terminal.cpp
@@ -281,11 +281,11 @@ llvm::Error Terminal::SetBaudRate(unsigned int baud_rate) {
return llvm::createStringError(llvm::inconvertibleErrorCode(),
"baud rate %d unsupported by the platform",
baud_rate);
- if (::cfsetispeed(&fd_termios, val.getValue()) != 0)
+ if (::cfsetispeed(&fd_termios, *val) != 0)
return llvm::createStringError(
std::error_code(errno, std::generic_category()),
"setting input baud rate failed");
- if (::cfsetospeed(&fd_termios, val.getValue()) != 0)
+ if (::cfsetospeed(&fd_termios, *val) != 0)
return llvm::createStringError(
std::error_code(errno, std::generic_category()),
"setting output baud rate failed");
diff --git a/lldb/source/Plugins/ABI/X86/ABIX86.cpp b/lldb/source/Plugins/ABI/X86/ABIX86.cpp
index 2cd653f..64c5d5a 100644
--- a/lldb/source/Plugins/ABI/X86/ABIX86.cpp
+++ b/lldb/source/Plugins/ABI/X86/ABIX86.cpp
@@ -100,8 +100,8 @@ addCombinedRegisters(std::vector<DynamicRegisterInfo::Register> &regs,
if (regdata1->subreg_name != regdata2->subreg_name)
continue;
- uint32_t base_index1 = regdata1->base_index.getValue();
- uint32_t base_index2 = regdata2->base_index.getValue();
+ uint32_t base_index1 = *regdata1->base_index;
+ uint32_t base_index2 = *regdata2->base_index;
if (regs[base_index1].byte_size != base_size ||
regs[base_index2].byte_size != base_size)
continue;
diff --git a/lldb/source/Plugins/Disassembler/LLVMC/DisassemblerLLVMC.cpp b/lldb/source/Plugins/Disassembler/LLVMC/DisassemblerLLVMC.cpp
index e4c7e8f..1f5addc 100644
--- a/lldb/source/Plugins/Disassembler/LLVMC/DisassemblerLLVMC.cpp
+++ b/lldb/source/Plugins/Disassembler/LLVMC/DisassemblerLLVMC.cpp
@@ -1382,14 +1382,14 @@ const char *DisassemblerLLVMC::SymbolLookup(uint64_t value, uint64_t *type_ptr,
// the ADRP's register and this ADD's register are the same,
// then this is a pc-relative address calculation.
if (*type_ptr == LLVMDisassembler_ReferenceType_In_ARM64_ADDXri &&
- m_adrp_insn.hasValue() && m_adrp_address == pc - 4 &&
- (m_adrp_insn.getValue() & 0x1f) == ((value >> 5) & 0x1f)) {
+ m_adrp_insn && m_adrp_address == pc - 4 &&
+ (*m_adrp_insn & 0x1f) == ((value >> 5) & 0x1f)) {
uint32_t addxri_inst;
uint64_t adrp_imm, addxri_imm;
// Get immlo and immhi bits, OR them together to get the ADRP imm
// value.
- adrp_imm = ((m_adrp_insn.getValue() & 0x00ffffe0) >> 3) |
- ((m_adrp_insn.getValue() >> 29) & 0x3);
+ adrp_imm =
+ ((*m_adrp_insn & 0x00ffffe0) >> 3) | ((*m_adrp_insn >> 29) & 0x3);
// if high bit of immhi after right-shifting set, sign extend
if (adrp_imm & (1ULL << 20))
adrp_imm |= ~((1ULL << 21) - 1);
diff --git a/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp b/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
index 82f8258..4f23ff4 100644
--- a/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
+++ b/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
@@ -218,10 +218,10 @@ void CPlusPlusLanguage::MethodName::Parse() {
} else {
CPlusPlusNameParser parser(m_full.GetStringRef());
if (auto function = parser.ParseAsFunctionDefinition()) {
- m_basename = function.getValue().name.basename;
- m_context = function.getValue().name.context;
- m_arguments = function.getValue().arguments;
- m_qualifiers = function.getValue().qualifiers;
+ m_basename = function->name.basename;
+ m_context = function->name.context;
+ m_arguments = function->arguments;
+ m_qualifiers = function->qualifiers;
m_parse_error = false;
} else {
m_parse_error = true;
@@ -329,8 +329,8 @@ bool CPlusPlusLanguage::ExtractContextAndIdentifier(
CPlusPlusNameParser parser(name);
if (auto full_name = parser.ParseAsFullName()) {
- identifier = full_name.getValue().basename;
- context = full_name.getValue().context;
+ identifier = full_name->basename;
+ context = full_name->context;
return true;
}
return false;
diff --git a/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusNameParser.cpp b/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusNameParser.cpp
index eca36ff..3a1fde2 100644
--- a/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusNameParser.cpp
+++ b/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusNameParser.cpp
@@ -55,8 +55,8 @@ Optional<ParsedName> CPlusPlusNameParser::ParseAsFullName() {
if (HasMoreTokens())
return None;
ParsedName result;
- result.basename = GetTextForRange(name_ranges.getValue().basename_range);
- result.context = GetTextForRange(name_ranges.getValue().context_range);
+ result.basename = GetTextForRange(name_ranges->basename_range);
+ result.context = GetTextForRange(name_ranges->context_range);
return result;
}
@@ -125,8 +125,8 @@ CPlusPlusNameParser::ParseFunctionImpl(bool expect_return_type) {
size_t end_position = GetCurrentPosition();
ParsedFunction result;
- result.name.basename = GetTextForRange(maybe_name.getValue().basename_range);
- result.name.context = GetTextForRange(maybe_name.getValue().context_range);
+ result.name.basename = GetTextForRange(maybe_name->basename_range);
+ result.name.context = GetTextForRange(maybe_name->context_range);
result.arguments = GetTextForRange(Range(argument_start, qualifiers_start));
result.qualifiers = GetTextForRange(Range(qualifiers_start, end_position));
start_position.Remove();
@@ -616,10 +616,10 @@ CPlusPlusNameParser::ParseFullNameImpl() {
state == State::AfterTemplate) {
ParsedNameRanges result;
if (last_coloncolon_position) {
- result.context_range = Range(start_position.GetSavedPosition(),
- last_coloncolon_position.getValue());
+ result.context_range =
+ Range(start_position.GetSavedPosition(), *last_coloncolon_position);
result.basename_range =
- Range(last_coloncolon_position.getValue() + 1, GetCurrentPosition());
+ Range(*last_coloncolon_position + 1, GetCurrentPosition());
} else {
result.basename_range =
Range(start_position.GetSavedPosition(), GetCurrentPosition());
diff --git a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
index fdebfcd3..045bdd4 100644
--- a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
+++ b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
@@ -6516,8 +6516,8 @@ bool ObjectFileMachO::SaveCore(const lldb::ProcessSP &process_sp,
addr_t pagesize = range_info.GetPageSize();
const llvm::Optional<std::vector<addr_t>> &dirty_page_list =
range_info.GetDirtyPageList();
- if (dirty_pages_only && dirty_page_list.hasValue()) {
- for (addr_t dirtypage : dirty_page_list.getValue()) {
+ if (dirty_pages_only && dirty_page_list) {
+ for (addr_t dirtypage : *dirty_page_list) {
page_object obj;
obj.addr = dirtypage;
obj.size = pagesize;
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
index 9f159f6..c44ace9 100644
--- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
@@ -2722,12 +2722,12 @@ bool GDBRemoteCommunicationClient::SetCurrentThread(uint64_t tid,
return true;
llvm::Optional<PidTid> ret = SendSetCurrentThreadPacket(tid, pid, 'g');
- if (ret.hasValue()) {
+ if (ret) {
if (ret->pid != LLDB_INVALID_PROCESS_ID)
m_curr_pid = ret->pid;
m_curr_tid = ret->tid;
}
- return ret.hasValue();
+ return ret.has_value();
}
bool GDBRemoteCommunicationClient::SetCurrentThreadForRun(uint64_t tid,
@@ -2737,12 +2737,12 @@ bool GDBRemoteCommunicationClient::SetCurrentThreadForRun(uint64_t tid,
return true;
llvm::Optional<PidTid> ret = SendSetCurrentThreadPacket(tid, pid, 'c');
- if (ret.hasValue()) {
+ if (ret) {
if (ret->pid != LLDB_INVALID_PROCESS_ID)
m_curr_pid_run = ret->pid;
m_curr_tid_run = ret->tid;
}
- return ret.hasValue();
+ return ret.has_value();
}
bool GDBRemoteCommunicationClient::GetStopReply(
diff --git a/lldb/source/Plugins/SymbolFile/Breakpad/SymbolFileBreakpad.cpp b/lldb/source/Plugins/SymbolFile/Breakpad/SymbolFileBreakpad.cpp
index 11175a4..b5615c3 100644
--- a/lldb/source/Plugins/SymbolFile/Breakpad/SymbolFileBreakpad.cpp
+++ b/lldb/source/Plugins/SymbolFile/Breakpad/SymbolFileBreakpad.cpp
@@ -674,9 +674,9 @@ SymbolFileBreakpad::ParseCFIUnwindPlan(const Bookmark &bookmark,
plan_sp->AppendRow(row_sp);
for (++It; It != End; ++It) {
llvm::Optional<StackCFIRecord> record = StackCFIRecord::parse(*It);
- if (!record.hasValue())
+ if (!record)
return nullptr;
- if (record->Size.hasValue())
+ if (record->Size)
break;
row_sp = std::make_shared<UnwindPlan::Row>(*row_sp);
diff --git a/lldb/source/Target/Thread.cpp b/lldb/source/Target/Thread.cpp
index 3803748..247913c 100644
--- a/lldb/source/Target/Thread.cpp
+++ b/lldb/source/Target/Thread.cpp
@@ -2022,7 +2022,8 @@ lldb::ValueObjectSP Thread::GetSiginfoValue() {
llvm::Optional<uint64_t> type_size = type.GetByteSize(nullptr);
assert(type_size);
- llvm::Expected<std::unique_ptr<llvm::MemoryBuffer>> data = GetSiginfo(type_size.getValue());
+ llvm::Expected<std::unique_ptr<llvm::MemoryBuffer>> data =
+ GetSiginfo(*type_size);
if (!data)
return ValueObjectConstResult::Create(&target, Status(data.takeError()));
diff --git a/lldb/source/Target/UnixSignals.cpp b/lldb/source/Target/UnixSignals.cpp
index de1fdb8..a92138a 100644
--- a/lldb/source/Target/UnixSignals.cpp
+++ b/lldb/source/Target/UnixSignals.cpp
@@ -300,14 +300,13 @@ UnixSignals::GetFilteredSignals(llvm::Optional<bool> should_suppress,
// If any of filtering conditions are not met, we move on to the next
// signal.
- if (should_suppress.hasValue() &&
- signal_suppress != should_suppress.getValue())
+ if (should_suppress && signal_suppress != *should_suppress)
continue;
- if (should_stop.hasValue() && signal_stop != should_stop.getValue())
+ if (should_stop && signal_stop != *should_stop)
continue;
- if (should_notify.hasValue() && signal_notify != should_notify.getValue())
+ if (should_notify && signal_notify != *should_notify)
continue;
result.push_back(signo);
diff --git a/lldb/source/Utility/SelectHelper.cpp b/lldb/source/Utility/SelectHelper.cpp
index eee6895..69b2abf 100644
--- a/lldb/source/Utility/SelectHelper.cpp
+++ b/lldb/source/Utility/SelectHelper.cpp
@@ -161,15 +161,15 @@ lldb_private::Status SelectHelper::Select() {
fd_set write_fdset;
fd_set error_fdset;
- if (max_read_fd.hasValue()) {
+ if (max_read_fd) {
FD_ZERO(&read_fdset);
read_fdset_ptr = &read_fdset;
}
- if (max_write_fd.hasValue()) {
+ if (max_write_fd) {
FD_ZERO(&write_fdset);
write_fdset_ptr = &write_fdset;
}
- if (max_error_fd.hasValue()) {
+ if (max_error_fd) {
FD_ZERO(&error_fdset);
error_fdset_ptr = &error_fdset;
}
@@ -195,10 +195,10 @@ lldb_private::Status SelectHelper::Select() {
while (true) {
using namespace std::chrono;
// Setup out relative timeout based on the end time if we have one
- if (m_end_time.hasValue()) {
+ if (m_end_time) {
tv_ptr = &tv;
- const auto remaining_dur = duration_cast<microseconds>(
- m_end_time.getValue() - steady_clock::now());
+ const auto remaining_dur =
+ duration_cast<microseconds>(*m_end_time - steady_clock::now());
if (remaining_dur.count() > 0) {
// Wait for a specific amount of time
const auto dur_secs = duration_cast<seconds>(remaining_dur);