about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-12-20 21:00:14 +0000
committerbors <bors@rust-lang.org>2024-12-20 21:00:14 +0000
commit5f23ef7d3f7a8c3e0ca5c4e1978829c0448a3686 (patch)
treef09961843930f17b66d00271853fa5799bcb7426 /compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
parentbad2aa47219ae54d51d353e145d33d0a1792327d (diff)
parent10a7405fdefddfc341e37b9a640e4a086cf8da27 (diff)
downloadrust-5f23ef7d3f7a8c3e0ca5c4e1978829c0448a3686.tar.gz
rust-5f23ef7d3f7a8c3e0ca5c4e1978829c0448a3686.zip
Auto merge of #134582 - matthiaskrgr:rollup-i0oyqjw, r=matthiaskrgr
Rollup of 8 pull requests

Successful merges:

 - #134556 ([tiny] fix missing ns units in bootstrap's benchmark rendering)
 - #134560 (mri: add track_caller to thread spawning methods for better backtraces)
 - #134561 (Reduce the amount of explicit FatalError.raise())
 - #134562 (tests/codegen/asm: Remove uses of rustc_attrs and lang_items features by using minicore)
 - #134567 (Remove some dead code around import library generation)
 - #134570 (remove reference to dangling from slice::Iter)
 - #134573 (unimplement `PointerLike` for trait objects)
 - #134574 (next-solver: disable unnecessary hack)

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp')
-rw-r--r--compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp50
1 files changed, 0 insertions, 50 deletions
diff --git a/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp b/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
index b79205ff946..36441a95adb 100644
--- a/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
+++ b/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
@@ -1796,56 +1796,6 @@ extern "C" LLVMValueRef LLVMRustBuildMaxNum(LLVMBuilderRef B, LLVMValueRef LHS,
   return wrap(unwrap(B)->CreateMaxNum(unwrap(LHS), unwrap(RHS)));
 }
 
-// This struct contains all necessary info about a symbol exported from a DLL.
-struct LLVMRustCOFFShortExport {
-  const char *name;
-  bool ordinal_present;
-  // The value of `ordinal` is only meaningful if `ordinal_present` is true.
-  uint16_t ordinal;
-};
-
-// Machine must be a COFF machine type, as defined in PE specs.
-extern "C" LLVMRustResult
-LLVMRustWriteImportLibrary(const char *ImportName, const char *Path,
-                           const LLVMRustCOFFShortExport *Exports,
-                           size_t NumExports, uint16_t Machine, bool MinGW) {
-  std::vector<llvm::object::COFFShortExport> ConvertedExports;
-  ConvertedExports.reserve(NumExports);
-
-  for (size_t i = 0; i < NumExports; ++i) {
-    bool ordinal_present = Exports[i].ordinal_present;
-    uint16_t ordinal = ordinal_present ? Exports[i].ordinal : 0;
-    ConvertedExports.push_back(llvm::object::COFFShortExport{
-        Exports[i].name, // Name
-        std::string{},   // ExtName
-        std::string{},   // SymbolName
-        std::string{},   // AliasTarget
-#if LLVM_VERSION_GE(19, 0)
-        std::string{}, // ExportAs
-#endif
-        ordinal,         // Ordinal
-        ordinal_present, // Noname
-        false,           // Data
-        false,           // Private
-        false            // Constant
-    });
-  }
-
-  auto Error = llvm::object::writeImportLibrary(
-      ImportName, Path, ConvertedExports,
-      static_cast<llvm::COFF::MachineTypes>(Machine), MinGW);
-  if (Error) {
-    std::string errorString;
-    auto stream = llvm::raw_string_ostream(errorString);
-    stream << Error;
-    stream.flush();
-    LLVMRustSetLastError(errorString.c_str());
-    return LLVMRustResult::Failure;
-  } else {
-    return LLVMRustResult::Success;
-  }
-}
-
 // Transfers ownership of DiagnosticHandler unique_ptr to the caller.
 extern "C" DiagnosticHandler *
 LLVMRustContextGetDiagnosticHandler(LLVMContextRef C) {