Skip to content

Conversation

zeroomega
Copy link
Contributor

This is a follow up of adbd432. 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.

@llvmbot
Copy link
Member

llvmbot commented Aug 29, 2025

@llvm/pr-subscribers-debuginfo

Author: Haowei (zeroomega)

Changes

This is a follow up of adbd432. 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.


Full diff: https://github.com/llvm/llvm-project/pull/156107.diff

2 Files Affected:

  • (modified) llvm/include/llvm/Debuginfod/HTTPServer.h (+1)
  • (modified) llvm/lib/Debuginfod/HTTPServer.cpp (+2)
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; }

Copy link

github-actions bot commented Aug 29, 2025

✅ With the latest revision this PR passed the C/C++ code formatter.

This is a follow up of adbd432.
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.
@zeroomega zeroomega merged commit 79d25ff into llvm:main Aug 29, 2025
7 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants