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

Michał Górny via All-commits all-commits at lists.llvm.org
Fri Sep 24 05:58:41 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 5f1c8d8a432deacfeada5e5a3794d0c938171c37
      https://github.com/llvm/llvm-project/commit/5f1c8d8a432deacfeada5e5a3794d0c938171c37
  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