[all-commits] [llvm/llvm-project] a6daf9: [lldb] [Host] Refactor Socket::DecodeHostAndPort()...

Michał Górny via All-commits all-commits at lists.llvm.org
Fri Sep 24 04:25:12 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a6daf99228bc16fb7f2596d67a0d00fef327ace5
      https://github.com/llvm/llvm-project/commit/a6daf99228bc16fb7f2596d67a0d00fef327ace5
  Author: Michał Górny <mgorny at moritz.systems>
  Date:   2021-09-24 (Fri, 24 Sep 2021)

  Changed paths:
    M lldb/include/lldb/Host/Socket.h
    M lldb/source/Host/common/Socket.cpp
    M lldb/source/Host/common/TCPSocket.cpp
    M lldb/source/Host/common/UDPSocket.cpp
    M lldb/tools/lldb-server/Acceptor.cpp
    M lldb/unittests/Host/SocketTest.cpp

  Log Message:
  -----------
  [lldb] [Host] Refactor Socket::DecodeHostAndPort() to use LLVM API

Refactor Socket::DecodeHostAndPort() to use LLVM API over redundant
LLDB API.  In particular, this means llvm::Regex, llvm::Error return
type and llvm::to_integer().

While at it, change the port type from int32_t to uint16_t.  The method
never returns any value outside this range, and using the correct type
allows us to rely on getAsInteger()'s implicit overflow check.

Differential Revision: https://reviews.llvm.org/D110391




More information about the All-commits mailing list