Sync from rust 84f962a89bac3948ed116f1ad04c2f4793fb69ea

This commit is contained in:
bjorn3 2021-12-20 18:12:18 +01:00
commit bb6d83dac9
2 changed files with 6 additions and 5 deletions

View File

@ -369,7 +369,7 @@ fn define_all_allocs(tcx: TyCtxt<'_>, module: &mut dyn Module, cx: &mut Constant
TodoItem::Static(def_id) => {
//println!("static {:?}", def_id);
let section_name = tcx.codegen_fn_attrs(def_id).link_section.map(|s| s.as_str());
let section_name = tcx.codegen_fn_attrs(def_id).link_section;
let alloc = tcx.eval_static_initializer(def_id).unwrap();
@ -388,6 +388,7 @@ fn define_all_allocs(tcx: TyCtxt<'_>, module: &mut dyn Module, cx: &mut Constant
if let Some(section_name) = section_name {
let (segment_name, section_name) = if tcx.sess.target.is_like_osx {
let section_name = section_name.as_str();
if let Some(names) = section_name.split_once(',') {
names
} else {
@ -397,7 +398,7 @@ fn define_all_allocs(tcx: TyCtxt<'_>, module: &mut dyn Module, cx: &mut Constant
));
}
} else {
("", &*section_name)
("", section_name.as_str())
};
data_ctx.set_segment_section(segment_name, section_name);
}

View File

@ -85,7 +85,7 @@ fn reuse_workproduct_for_cgu(
let work_product = cgu.work_product(tcx);
if let Some(saved_file) = &work_product.saved_file {
let obj_out =
tcx.output_filenames(()).temp_path(OutputType::Object, Some(&cgu.name().as_str()));
tcx.output_filenames(()).temp_path(OutputType::Object, Some(cgu.name().as_str()));
object = Some(obj_out.clone());
let source_file = rustc_incremental::in_incr_comp_dir_sess(&tcx.sess, &saved_file);
if let Err(err) = rustc_fs_util::link_or_copy(&source_file, &obj_out) {
@ -178,7 +178,7 @@ fn module_codegen(
)
});
codegen_global_asm(tcx, &cgu.name().as_str(), &cx.global_asm);
codegen_global_asm(tcx, cgu.name().as_str(), &cx.global_asm);
codegen_result
}
@ -209,7 +209,7 @@ pub(crate) fn run_aot(
cgus.iter()
.map(|cgu| {
let cgu_reuse = determine_cgu_reuse(tcx, cgu);
tcx.sess.cgu_reuse_tracker.set_actual_reuse(&cgu.name().as_str(), cgu_reuse);
tcx.sess.cgu_reuse_tracker.set_actual_reuse(cgu.name().as_str(), cgu_reuse);
match cgu_reuse {
_ if backend_config.disable_incr_cache => {}