about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp
diff options
context:
space:
mode:
authorThe Miri Conjob Bot <miri@cron.bot>2023-11-27 05:03:31 +0000
committerThe Miri Conjob Bot <miri@cron.bot>2023-11-27 05:03:31 +0000
commitfa6ecc9f67cb05bf08aaa38d39dd9730991b1444 (patch)
tree88bc4f64134af56c98ce4e82d8e43735d809e984 /compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp
parent1293a6a28100ac51153293882735d3c637fdcb35 (diff)
parentc751bfa015ab9e99f3c7845cebf04eb543648042 (diff)
downloadrust-fa6ecc9f67cb05bf08aaa38d39dd9730991b1444.tar.gz
rust-fa6ecc9f67cb05bf08aaa38d39dd9730991b1444.zip
Merge from rustc
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp')
-rw-r--r--compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp26
1 files changed, 0 insertions, 26 deletions
diff --git a/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp b/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp
index b4c8fb1a2f1..d2cd79b456a 100644
--- a/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp
+++ b/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp
@@ -1562,32 +1562,6 @@ LLVMRustParseBitcodeForLTO(LLVMContextRef Context,
   return wrap(std::move(*SrcOrError).release());
 }
 
-// Find the bitcode section in the object file data and return it as a slice.
-// Fail if the bitcode section is present but empty.
-//
-// On success, the return value is the pointer to the start of the slice and
-// `out_len` is filled with the (non-zero) length. On failure, the return value
-// is `nullptr` and `out_len` is set to zero.
-extern "C" const char*
-LLVMRustGetBitcodeSliceFromObjectData(const char *data,
-                                      size_t len,
-                                      size_t *out_len) {
-  *out_len = 0;
-
-  StringRef Data(data, len);
-  MemoryBufferRef Buffer(Data, ""); // The id is unused.
-
-  Expected<MemoryBufferRef> BitcodeOrError =
-    object::IRObjectFile::findBitcodeInMemBuffer(Buffer);
-  if (!BitcodeOrError) {
-    LLVMRustSetLastError(toString(BitcodeOrError.takeError()).c_str());
-    return nullptr;
-  }
-
-  *out_len = BitcodeOrError->getBufferSize();
-  return BitcodeOrError->getBufferStart();
-}
-
 // Find a section of an object file by name. Fail if the section is missing or
 // empty.
 extern "C" const char *LLVMRustGetSliceFromObjectDataByName(const char *data,