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>2022-10-21 10:21:17 +0000
committerbors <bors@rust-lang.org>2022-10-21 10:21:17 +0000
commitbefc94e691ae36c2fad134e1cdf483b7bdeeb74f (patch)
tree295eb20dddee89560f4e67c9fc14937611688207 /compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
parent53e357748675b387b6d25fe563b960cb7a7a0aea (diff)
parentbb911ce32aeef2d691af993d0a1696d8402998a9 (diff)
downloadrust-befc94e691ae36c2fad134e1cdf483b7bdeeb74f.tar.gz
rust-befc94e691ae36c2fad134e1cdf483b7bdeeb74f.zip
Auto merge of #2607 - RalfJung:rustup, r=RalfJung
Rustup
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp')
-rw-r--r--compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp b/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
index b2cfcf53c59..6f36281af23 100644
--- a/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
+++ b/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
@@ -12,7 +12,7 @@
 #include "llvm/Object/COFFImportFile.h"
 #include "llvm/Object/ObjectFile.h"
 #include "llvm/Pass.h"
-#include "llvm/Bitcode/BitcodeWriterPass.h"
+#include "llvm/Bitcode/BitcodeWriter.h"
 #include "llvm/Support/Signals.h"
 #include "llvm/ADT/Optional.h"
 
@@ -1670,11 +1670,7 @@ LLVMRustModuleBufferCreate(LLVMModuleRef M) {
   auto Ret = std::make_unique<LLVMRustModuleBuffer>();
   {
     raw_string_ostream OS(Ret->data);
-    {
-      legacy::PassManager PM;
-      PM.add(createBitcodeWriterPass(OS));
-      PM.run(*unwrap(M));
-    }
+    WriteBitcodeToFile(*unwrap(M), OS);
   }
   return Ret.release();
 }