summaryrefslogtreecommitdiff
path: root/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
diff options
context:
space:
mode:
authorfee1-dead <ent3rm4n@gmail.com>2022-09-25 22:06:38 +0800
committerGitHub <noreply@github.com>2022-09-25 22:06:38 +0800
commit07467c530850446e6888f447ad313d75d33c4e19 (patch)
tree0712c42c6a5ede3afd2ec5e862c309dad3f6ea0c /compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
parentda884d25da54295eca9f21b8ddc0679eef83c761 (diff)
parent00bb9fc2be81b8beb257fdf220ed3f2386ab0930 (diff)
downloadrust-07467c530850446e6888f447ad313d75d33c4e19.tar.gz
Rollup merge of #101997 - cuviper:drop-legacy-pm, r=nikic
Remove support for legacy PM This removes support for optimizing with LLVM's legacy pass manager, as well as the unstable `-Znew-llvm-pass-manager` option. We have been defaulting to the new PM since LLVM 13 (except for s390x that waited for 14), and LLVM 15 removed support altogether. The only place we still use the legacy PM is for writing the output file, just like `llc` does. cc #74705 r? ``@nikic``
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();
}