Following the discussion in D112753, this moves the HTTPClient from Support to Debuginfod library so that tools depending on Support do not automatically depend on Curl as well. This also removes `HTTPClient::initialize()` and `HTTPClient::cleanup()` from `InitLLVM` so these steps should be implemented by user tools instead.
Reviewed By: phosek
Differential Revision: https://reviews.llvm.org/D115131
+# Link LibCURL if the user wants it
+if (LLVM_ENABLE_CURL)
+ set(imported_libs ${CURL_LIBRARIES})
+endif()
+
add_llvm_component_library(LLVMDebuginfod
Debuginfod.cpp
+ HTTPClient.cpp
ADDITIONAL_HEADER_DIRS
${LLVM_MAIN_INCLUDE_DIR}/llvm/Debuginfod
+ LINK_LIBS
+ ${imported_libs}
+
LINK_COMPONENTS
Support
)
+
+set(llvm_system_libs ${system_libs})
#include "llvm/Debuginfod/Debuginfod.h"
#include "llvm/ADT/StringRef.h"
+#include "llvm/Debuginfod/HTTPClient.h"
#include "llvm/Support/CachePruning.h"
#include "llvm/Support/Caching.h"
#include "llvm/Support/Error.h"
#include "llvm/Support/FileUtilities.h"
-#include "llvm/Support/HTTPClient.h"
#include "llvm/Support/xxhash.h"
namespace llvm {
-//===-- llvm/Support/HTTPClient.cpp - HTTP client library -------*- C++ -*-===//
+//===-- llvm/Debuginfod/HTTPClient.cpp - HTTP client library ----*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
///
//===----------------------------------------------------------------------===//
-#include "llvm/Support/HTTPClient.h"
+#include "llvm/Debuginfod/HTTPClient.h"
#include "llvm/ADT/APInt.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/Errc.h"
set(system_libs ${system_libs} ${Z3_LIBRARIES})
endif()
-# Link LibCURL if the user wants it
-if (LLVM_ENABLE_CURL)
- set(system_libs ${system_libs} ${CURL_LIBRARIES})
-endif()
-
# Override the C runtime allocator on Windows and embed it into LLVM tools & libraries
if(LLVM_INTEGRATED_CRT_ALLOC)
if (CMAKE_BUILD_TYPE AND NOT ${LLVM_USE_CRT_${uppercase_CMAKE_BUILD_TYPE}} MATCHES "^(MT|MTd)$")
GlobPattern.cpp
GraphWriter.cpp
Hashing.cpp
- HTTPClient.cpp
InitLLVM.cpp
InstructionCost.cpp
IntEqClasses.cpp
#include "llvm/Support/InitLLVM.h"
#include "llvm/Support/Error.h"
-#include "llvm/Support/HTTPClient.h"
#include "llvm/Support/ManagedStatic.h"
#include "llvm/Support/PrettyStackTrace.h"
#include "llvm/Support/Process.h"
Argc = Args.size() - 1;
Argv = Args.data();
#endif
-
- HTTPClient::initialize();
}
-InitLLVM::~InitLLVM() {
- HTTPClient::cleanup();
- llvm_shutdown();
-}
+InitLLVM::~InitLLVM() { llvm_shutdown(); }
)
add_llvm_unittest(DebuginfodTests
+ HTTPClientTests.cpp
DebuginfodTests.cpp
)
-//===-- llvm/unittest/Support/DebuginfodTests.cpp - unit tests --*- C++ -*-===//
+//===-- llvm/unittest/Support/DebuginfodTests.cpp - unit tests ------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
//===----------------------------------------------------------------------===//
#include "llvm/Debuginfod/Debuginfod.h"
+#include "llvm/Debuginfod/HTTPClient.h"
#include "llvm/Support/FileSystem.h"
-#include "llvm/Support/HTTPClient.h"
#include "llvm/Support/Path.h"
#include "llvm/Testing/Support/Error.h"
#include "gtest/gtest.h"
-//===-- llvm/unittest/Support/HTTPClient.cpp - unit tests -------*- C++ -*-===//
+//===-- llvm/unittest/Debuginfod/HTTPClientTests.cpp - unit tests ---------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
//
//===----------------------------------------------------------------------===//
-#include "llvm/Support/HTTPClient.h"
+#include "llvm/Debuginfod/HTTPClient.h"
#include "llvm/Support/Errc.h"
#include "llvm/Testing/Support/Error.h"
#include "gtest/gtest.h"
GlobPatternTest.cpp
HashBuilderTest.cpp
Host.cpp
- HTTPClient.cpp
IndexedAccessorTest.cpp
InstructionCostTest.cpp
ItaniumManglingCanonicalizerTest.cpp