diff options
| author | Nikita Popov <nikita.ppv@gmail.com> | 2019-07-13 20:17:16 +0200 |
|---|---|---|
| committer | Nikita Popov <nikita.ppv@gmail.com> | 2019-07-15 09:45:14 +0200 |
| commit | a5c3956a75f59d83da73bbd42d053774a28c4de7 (patch) | |
| tree | b6bbe1c5f96b8b5978b73f05d280bfd8cf1756a2 /src/librustc_codegen_llvm/llvm | |
| parent | 2c102cb4ab537f7d71c60165108e2e50d1c92e93 (diff) | |
| download | rust-a5c3956a75f59d83da73bbd42d053774a28c4de7.tar.gz rust-a5c3956a75f59d83da73bbd42d053774a28c4de7.zip | |
Don't add extra passes into the function pass manager
Exception for specific cases like linting, additional passes should be going into the module pass manager (even if they are function passes). The separate function pass manager is only used for very early optimization passes. Rather than apparending passes to the MPM, use the OptimizerLast and EnabledOnOptLevel0 pass manager builder extension hooks, which allow adding passes directly before finalization (alias canonicalization and name-anon-globals). The main effect and purpose of this change is to add sanitizer passes at the end of the pipeline, which is where they belong. In LLVM 9 the address sanitizer can't be used as a pass in the early function pass manager, because it has a dependence on a module-level analysis pass.
Diffstat (limited to 'src/librustc_codegen_llvm/llvm')
| -rw-r--r-- | src/librustc_codegen_llvm/llvm/ffi.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/librustc_codegen_llvm/llvm/ffi.rs b/src/librustc_codegen_llvm/llvm/ffi.rs index 2b22925f449..5d82698d8ef 100644 --- a/src/librustc_codegen_llvm/llvm/ffi.rs +++ b/src/librustc_codegen_llvm/llvm/ffi.rs @@ -1668,6 +1668,9 @@ extern "C" { pub fn LLVMRustPassKind(Pass: &Pass) -> PassKind; pub fn LLVMRustFindAndCreatePass(Pass: *const c_char) -> Option<&'static mut Pass>; pub fn LLVMRustAddPass(PM: &PassManager<'_>, Pass: &'static mut Pass); + pub fn LLVMRustAddLastExtensionPasses(PMB: &PassManagerBuilder, + Passes: *const &'static mut Pass, + NumPasses: size_t); pub fn LLVMRustHasFeature(T: &TargetMachine, s: *const c_char) -> bool; |
