Skip to content

Commit

Permalink
Rollup merge of rust-lang#68881 - eddyb:always-preserve-dbg-vars, r=n…
Browse files Browse the repository at this point in the history
…agisa

rustc_codegen_llvm: always set AlwaysPreserve on all debuginfo variables

Making this depend on the optimization level appears to have been a copy-paste mistake (other LLVM functions called in this module also take a `bool` argument, but there it means something unrelated).
Also see rust-lang#8855 (comment).

I don't believe we have any reason to let LLVM omit user variables from DWARF, and we were already setting this to `true` when LLVM *could* optimize them away, so this PR should have no effect anyway.

r? @michaelwoerister or @nagisa cc @rkruppe @nikomatsakis
  • Loading branch information
Dylan-DPC authored Feb 8, 2020
2 parents 17d7d16 + b82f6c5 commit 5a7e68c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/librustc_codegen_llvm/debuginfo/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,7 @@ impl DebugInfoMethods<'tcx> for CodegenCx<'ll, 'tcx> {
file_metadata,
loc.line as c_uint,
type_metadata,
self.sess().opts.optimize != config::OptLevel::No,
true,
DIFlags::FlagZero,
argument_index,
align.bytes() as u32,
Expand Down

0 comments on commit 5a7e68c

Please sign in to comment.