[llvm] Fix debuginfod build failure when httplib is used. (PR #156107)

via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 29 14:09:36 PDT 2025


https://github.com/zeroomega created https://github.com/llvm/llvm-project/pull/156107

This is a follow up of adbd43250ade1d5357542d8bd7c3dfed212ddec0. The problem is HTTPServer class will lost its implicit move ctor if httplib is used. This patch adds the move ctor explicitly to solve this issue. The default move ctor is not added in the header due to a limitation that "httplib::Server" is a forward declaration and it is incomplete.

>From 5ca0f4ceabde6d2db4b801a0245910df9f62cfe8 Mon Sep 17 00:00:00 2001
From: Haowei Wu <haowei at google.com>
Date: Fri, 29 Aug 2025 14:06:16 -0700
Subject: [PATCH] Fix debuginfod build failure when httplib is used.

This is a follow up of adbd43250ade1d5357542d8bd7c3dfed212ddec0.
The problem is HTTPServer class will lost its implicit move ctor
if httplib is used. This patch adds the move ctor explicitly to
solve this issue.
---
 llvm/include/llvm/Debuginfod/HTTPServer.h | 1 +
 llvm/lib/Debuginfod/HTTPServer.cpp        | 2 ++
 2 files changed, 3 insertions(+)

diff --git a/llvm/include/llvm/Debuginfod/HTTPServer.h b/llvm/include/llvm/Debuginfod/HTTPServer.h
index c200089200ab7..8450735a39605 100644
--- a/llvm/include/llvm/Debuginfod/HTTPServer.h
+++ b/llvm/include/llvm/Debuginfod/HTTPServer.h
@@ -104,6 +104,7 @@ class HTTPServer {
 public:
   HTTPServer();
   ~HTTPServer();
+  HTTPServer(HTTPServer&&);
 
   /// Returns true only if LLVM has been compiled with a working HTTPServer.
   static bool isAvailable();
diff --git a/llvm/lib/Debuginfod/HTTPServer.cpp b/llvm/lib/Debuginfod/HTTPServer.cpp
index 1264353ce4b33..bff95c12066b9 100644
--- a/llvm/lib/Debuginfod/HTTPServer.cpp
+++ b/llvm/lib/Debuginfod/HTTPServer.cpp
@@ -62,6 +62,8 @@ bool llvm::streamFile(HTTPServerRequest &Request, StringRef FilePath) {
   return true;
 }
 
+HTTPServer::HTTPServer(HTTPServer&&) = default;
+
 #ifdef LLVM_ENABLE_HTTPLIB
 
 bool HTTPServer::isAvailable() { return true; }



More information about the llvm-commits mailing list