[llvm] 09b2419 - [llvm-jitlink] Fix -Wunused-function on Windows

Arthur Eubanks via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 31 09:26:25 PDT 2021


Author: Arthur Eubanks
Date: 2021-03-31T09:26:09-07:00
New Revision: 09b2419360e1bf35037fc7b4299074150e8e68a5

URL: https://github.com/llvm/llvm-project/commit/09b2419360e1bf35037fc7b4299074150e8e68a5
DIFF: https://github.com/llvm/llvm-project/commit/09b2419360e1bf35037fc7b4299074150e8e68a5.diff

LOG: [llvm-jitlink] Fix -Wunused-function on Windows

Reviewed By: sgraenitz

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

Added: 
    

Modified: 
    llvm/tools/llvm-jitlink/llvm-jitlink.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/tools/llvm-jitlink/llvm-jitlink.cpp b/llvm/tools/llvm-jitlink/llvm-jitlink.cpp
index 739083d6537b4..ea263542772cf 100644
--- a/llvm/tools/llvm-jitlink/llvm-jitlink.cpp
+++ b/llvm/tools/llvm-jitlink/llvm-jitlink.cpp
@@ -670,6 +670,7 @@ LLVMJITLinkRemoteTargetProcessControl::LaunchExecutor() {
 #endif
 }
 
+#ifdef LLVM_ON_UNIX
 static Error createTCPSocketError(Twine Details) {
   return make_error<StringError>(
       formatv("Failed to connect TCP socket '{0}': {1}",
@@ -678,12 +679,6 @@ static Error createTCPSocketError(Twine Details) {
 }
 
 static Expected<int> connectTCPSocket(std::string Host, std::string PortStr) {
-#ifndef LLVM_ON_UNIX
-  // FIXME: Add TCP support for Windows.
-  return make_error<StringError>("-" + OutOfProcessExecutorConnect.ArgStr +
-                                     " not supported on non-unix platforms",
-                                 inconvertibleErrorCode());
-#else
   addrinfo *AI;
   addrinfo Hints{};
   Hints.ai_family = AF_INET;
@@ -718,8 +713,8 @@ static Expected<int> connectTCPSocket(std::string Host, std::string PortStr) {
     return createTCPSocketError(std::strerror(errno));
 
   return SockFD;
-#endif
 }
+#endif
 
 Expected<std::unique_ptr<TargetProcessControl>>
 LLVMJITLinkRemoteTargetProcessControl::ConnectToExecutor() {


        


More information about the llvm-commits mailing list