Include rustc and cranelift version in debuginfo

This commit is contained in:
bjorn3 2021-06-10 10:19:58 +02:00
parent b7180ae39a
commit 84dd22969f
2 changed files with 6 additions and 3 deletions

View File

@ -61,9 +61,11 @@ impl<'tcx> DebugContext<'tcx> {
let mut dwarf = DwarfUnit::new(encoding);
// FIXME: how to get version when building out of tree?
// Normally this would use option_env!("CFG_VERSION").
let producer = format!("cg_clif (rustc {})", "unknown version");
let producer = format!(
"cg_clif (rustc {}, cranelift {})",
rustc_interface::util::version_str().unwrap_or("unknown version"),
cranelift_codegen::VERSION,
);
let comp_dir = tcx.sess.working_dir.to_string_lossy(false).into_owned();
let (name, file_info) = match tcx.sess.local_crate_source_file.clone() {
Some(path) => {

View File

@ -14,6 +14,7 @@ extern crate rustc_fs_util;
extern crate rustc_hir;
extern crate rustc_incremental;
extern crate rustc_index;
extern crate rustc_interface;
extern crate rustc_session;
extern crate rustc_span;
extern crate rustc_target;