From 2fe8327406050d2585d2ced910a678e28caefcf5 Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Sat, 7 Jan 2023 14:18:35 -0800 Subject: [lldb] Use std::optional instead of llvm::Optional (NFC) This patch replaces (llvm::|)Optional< with std::optional<. I'll post a separate patch to clean up the "using" declarations, #include "llvm/ADT/Optional.h", etc. This is part of an effort to migrate from llvm::Optional to std::optional: https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716 --- .../Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp') diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp index c038ff7..f712406 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp @@ -267,12 +267,12 @@ GDBRemoteCommunicationServerCommon::Handle_qHostInfo( } #endif - if (llvm::Optional s = HostInfo::GetOSBuildString()) { + if (std::optional s = HostInfo::GetOSBuildString()) { response.PutCString("os_build:"); response.PutStringAsRawHex8(*s); response.PutChar(';'); } - if (llvm::Optional s = HostInfo::GetOSKernelDescription()) { + if (std::optional s = HostInfo::GetOSKernelDescription()) { response.PutCString("os_kernel:"); response.PutStringAsRawHex8(*s); response.PutChar(';'); @@ -433,7 +433,7 @@ GDBRemoteCommunicationServerCommon::Handle_qUserName( packet.SetFilePos(::strlen("qUserName:")); uint32_t uid = packet.GetU32(UINT32_MAX); if (uid != UINT32_MAX) { - if (llvm::Optional name = + if (std::optional name = HostInfo::GetUserIDResolver().GetUserName(uid)) { StreamString response; response.PutStringAsRawHex8(*name); @@ -453,7 +453,7 @@ GDBRemoteCommunicationServerCommon::Handle_qGroupName( packet.SetFilePos(::strlen("qGroupName:")); uint32_t gid = packet.GetU32(UINT32_MAX); if (gid != UINT32_MAX) { - if (llvm::Optional name = + if (std::optional name = HostInfo::GetUserIDResolver().GetGroupName(gid)) { StreamString response; response.PutStringAsRawHex8(*name); -- cgit v1.1