about summary refs log tree commit diff
path: root/src/librustc_codegen_ssa/back/write.rs
diff options
context:
space:
mode:
authorTomasz Miąsko <tomasz.miasko@gmail.com>2020-05-13 00:00:00 +0000
committerTomasz Miąsko <tomasz.miasko@gmail.com>2020-05-14 15:23:24 +0200
commitbbb63d4554b03feee481bc799a04f183abaff1d4 (patch)
tree9350d4e05c20c9649ba506920b5710976be8afd2 /src/librustc_codegen_ssa/back/write.rs
parent23ffeea307c31f0c20ebb5a15d5171e0c414629d (diff)
downloadrust-bbb63d4554b03feee481bc799a04f183abaff1d4.tar.gz
rust-bbb63d4554b03feee481bc799a04f183abaff1d4.zip
Consistently use LLVM lifetime markers during codegen
Ensure that inliner inserts lifetime markers if they have been emitted during
codegen. Otherwise if allocas from inlined functions are merged together,
lifetime markers from one function might invalidate load & stores performed
by the other one.
Diffstat (limited to 'src/librustc_codegen_ssa/back/write.rs')
-rw-r--r--src/librustc_codegen_ssa/back/write.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/librustc_codegen_ssa/back/write.rs b/src/librustc_codegen_ssa/back/write.rs
index 6210559251d..a88fef5aaac 100644
--- a/src/librustc_codegen_ssa/back/write.rs
+++ b/src/librustc_codegen_ssa/back/write.rs
@@ -110,6 +110,7 @@ pub struct ModuleConfig {
     pub merge_functions: bool,
     pub inline_threshold: Option<usize>,
     pub new_llvm_pass_manager: bool,
+    pub emit_lifetime_markers: bool,
 }
 
 impl ModuleConfig {
@@ -244,6 +245,7 @@ impl ModuleConfig {
 
             inline_threshold: sess.opts.cg.inline_threshold,
             new_llvm_pass_manager: sess.opts.debugging_opts.new_llvm_pass_manager,
+            emit_lifetime_markers: sess.emit_lifetime_markers(),
         }
     }