[lldb] [Utility/UriParser] Replace port==-1 with llvm::None

Use llvm::Optional<uint16_t> instead of int for port number
in UriParser::Parse(), and use llvm::None to indicate missing port
instead of a magic value of -1.

Differential Revision: https://reviews.llvm.org/D112309
This commit is contained in:
Michał Górny
2021-10-22 14:00:07 +02:00
parent 43f8845dd3
commit ff569ed030
11 changed files with 31 additions and 32 deletions

View File

@@ -155,7 +155,7 @@ Status PlatformAndroid::ConnectRemote(Args &args) {
if (!m_remote_platform_sp)
m_remote_platform_sp = PlatformSP(new PlatformAndroidRemoteGDBServer());
int port;
llvm::Optional<uint16_t> port;
llvm::StringRef scheme, host, path;
const char *url = args.GetArgumentAtIndex(0);
if (!url)