From bbb63d4554b03feee481bc799a04f183abaff1d4 Mon Sep 17 00:00:00 2001 From: Tomasz Miąsko Date: Wed, 13 May 2020 00:00:00 +0000 Subject: 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. --- src/librustc_codegen_ssa/back/write.rs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/librustc_codegen_ssa') 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, 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(), } } -- cgit 1.4.1-3-g733a5