diff options
| author | bors <bors@rust-lang.org> | 2019-12-01 00:39:18 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2019-12-01 00:39:18 +0000 |
| commit | 135ccbaca86ed4b9c0efaf0cd31442eae57ffad7 (patch) | |
| tree | f5d91a593d425871fff9e1b68ac2e9f982d6c8e1 /src/librustc_codegen_llvm | |
| parent | d8bdb3fdcbd88eb16e1a6669236122c41ed2aed3 (diff) | |
| parent | b772b5b19d769e7062b032e6e73f6466b26d78bd (diff) | |
| download | rust-135ccbaca86ed4b9c0efaf0cd31442eae57ffad7.tar.gz rust-135ccbaca86ed4b9c0efaf0cd31442eae57ffad7.zip | |
Auto merge of #66908 - Centril:rollup-26givp6, r=Centril
Rollup of 9 pull requests Successful merges: - #66612 (Initial implementation of or-pattern usefulness checking) - #66705 (Atomic as_mut_ptr) - #66759 (impl TrustedLen for vec::Drain) - #66858 (Use LLVMAddAnalysisPasses instead of Rust's wrapper) - #66870 (SimplifyArmIdentity only for locals with the same type) - #66883 (rustc_typeck: gate AnonConst's generics on feature(const_generics).) - #66889 (Make python-generated source files compatible with rustfmt) - #66894 (Remove unneeded prelude imports in libcore tests) - #66895 (Feature gating *declarations* => new crate `rustc_feature`) Failed merges: - #66905 (rustc_plugin: Remove some remaining plugin features) r? @ghost
Diffstat (limited to 'src/librustc_codegen_llvm')
| -rw-r--r-- | src/librustc_codegen_llvm/back/lto.rs | 2 | ||||
| -rw-r--r-- | src/librustc_codegen_llvm/back/write.rs | 6 | ||||
| -rw-r--r-- | src/librustc_codegen_llvm/lib.rs | 1 | ||||
| -rw-r--r-- | src/librustc_codegen_llvm/llvm/ffi.rs | 3 | ||||
| -rw-r--r-- | src/librustc_codegen_llvm/llvm_util.rs | 2 |
5 files changed, 8 insertions, 6 deletions
diff --git a/src/librustc_codegen_llvm/back/lto.rs b/src/librustc_codegen_llvm/back/lto.rs index b3be3d09f17..d0b065ccc84 100644 --- a/src/librustc_codegen_llvm/back/lto.rs +++ b/src/librustc_codegen_llvm/back/lto.rs @@ -541,7 +541,7 @@ pub(crate) fn run_pass_manager(cgcx: &CodegenContext<LlvmCodegenBackend>, debug!("running the pass manager"); unsafe { let pm = llvm::LLVMCreatePassManager(); - llvm::LLVMRustAddAnalysisPasses(module.module_llvm.tm, pm, module.module_llvm.llmod()); + llvm::LLVMAddAnalysisPasses(module.module_llvm.tm, pm); if config.verify_llvm_ir { let pass = llvm::LLVMRustFindAndCreatePass("verify\0".as_ptr().cast()); diff --git a/src/librustc_codegen_llvm/back/write.rs b/src/librustc_codegen_llvm/back/write.rs index 6cc7b0b4b1e..5dfb04a4436 100644 --- a/src/librustc_codegen_llvm/back/write.rs +++ b/src/librustc_codegen_llvm/back/write.rs @@ -384,8 +384,8 @@ pub(crate) unsafe fn optimize(cgcx: &CodegenContext<LlvmCodegenBackend>, // we'll get errors in LLVM. let using_thin_buffers = config.bitcode_needed(); if !config.no_prepopulate_passes { - llvm::LLVMRustAddAnalysisPasses(tm, fpm, llmod); - llvm::LLVMRustAddAnalysisPasses(tm, mpm, llmod); + llvm::LLVMAddAnalysisPasses(tm, fpm); + llvm::LLVMAddAnalysisPasses(tm, mpm); let opt_level = to_llvm_opt_settings(opt_level).0; let prepare_for_thin_lto = cgcx.lto == Lto::Thin || cgcx.lto == Lto::ThinLocal || (cgcx.lto != Lto::Fat && cgcx.opts.cg.linker_plugin_lto.enabled()); @@ -509,7 +509,7 @@ pub(crate) unsafe fn codegen(cgcx: &CodegenContext<LlvmCodegenBackend>, where F: FnOnce(&'ll mut PassManager<'ll>) -> R, { let cpm = llvm::LLVMCreatePassManager(); - llvm::LLVMRustAddAnalysisPasses(tm, cpm, llmod); + llvm::LLVMAddAnalysisPasses(tm, cpm); llvm::LLVMRustAddLibraryInfo(cpm, llmod, no_builtins); f(cpm) } diff --git a/src/librustc_codegen_llvm/lib.rs b/src/librustc_codegen_llvm/lib.rs index e7562c399b2..acc221f0657 100644 --- a/src/librustc_codegen_llvm/lib.rs +++ b/src/librustc_codegen_llvm/lib.rs @@ -30,6 +30,7 @@ extern crate libc; #[macro_use] extern crate rustc; extern crate rustc_target; #[macro_use] extern crate rustc_data_structures; +extern crate rustc_feature; extern crate rustc_index; extern crate rustc_incremental; extern crate rustc_codegen_utils; diff --git a/src/librustc_codegen_llvm/llvm/ffi.rs b/src/librustc_codegen_llvm/llvm/ffi.rs index 241ca695e5f..a49e863fa21 100644 --- a/src/librustc_codegen_llvm/llvm/ffi.rs +++ b/src/librustc_codegen_llvm/llvm/ffi.rs @@ -1341,6 +1341,8 @@ extern "C" { pub fn LLVMInitializePasses(); + pub fn LLVMAddAnalysisPasses(T: &'a TargetMachine, PM: &PassManager<'a>); + pub fn LLVMPassManagerBuilderCreate() -> &'static mut PassManagerBuilder; pub fn LLVMPassManagerBuilderDispose(PMB: &'static mut PassManagerBuilder); pub fn LLVMPassManagerBuilderSetSizeLevel(PMB: &PassManagerBuilder, Value: Bool); @@ -1703,7 +1705,6 @@ extern "C" { EmitStackSizeSection: bool) -> Option<&'static mut TargetMachine>; pub fn LLVMRustDisposeTargetMachine(T: &'static mut TargetMachine); - pub fn LLVMRustAddAnalysisPasses(T: &'a TargetMachine, PM: &PassManager<'a>, M: &'a Module); pub fn LLVMRustAddBuilderLibraryInfo(PMB: &'a PassManagerBuilder, M: &'a Module, DisableSimplifyLibCalls: bool); diff --git a/src/librustc_codegen_llvm/llvm_util.rs b/src/librustc_codegen_llvm/llvm_util.rs index 290ca409261..7bff9e69dd5 100644 --- a/src/librustc_codegen_llvm/llvm_util.rs +++ b/src/librustc_codegen_llvm/llvm_util.rs @@ -6,7 +6,7 @@ use rustc::session::config::PrintRequest; use rustc_target::spec::{MergeFunctions, PanicStrategy}; use libc::c_int; use std::ffi::CString; -use syntax::feature_gate::UnstableFeatures; +use rustc_feature::UnstableFeatures; use syntax::symbol::sym; use std::str; |
