This commit is contained in:
bjorn3 2021-05-24 18:41:45 +02:00
parent 9fc56fb2f4
commit f8c2a7ec00
2 changed files with 6 additions and 12 deletions

View file

@ -350,10 +350,7 @@ impl<'tcx> FunctionCx<'_, '_, 'tcx> {
pub(crate) fn anonymous_str(&mut self, msg: &str) -> Value {
let mut data_ctx = DataContext::new();
data_ctx.define(msg.as_bytes().to_vec().into_boxed_slice());
let msg_id = self
.module
.declare_anonymous_data(false, false)
.unwrap();
let msg_id = self.module.declare_anonymous_data(false, false).unwrap();
// Ignore DuplicateDefinition error, as the data will be the same
let _ = self.module.define_data(msg_id, &data_ctx);

View file

@ -73,9 +73,8 @@ fn reuse_workproduct_for_cgu(
let mut object = None;
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()));
let obj_out =
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(&incr_comp_session_dir, &saved_file);
if let Err(err) = rustc_fs_util::link_or_copy(&source_file, &obj_out) {
@ -281,9 +280,8 @@ pub(crate) fn run_aot(
.as_str()
.to_string();
let tmp_file = tcx
.output_filenames(())
.temp_path(OutputType::Metadata, Some(&metadata_cgu_name));
let tmp_file =
tcx.output_filenames(()).temp_path(OutputType::Metadata, Some(&metadata_cgu_name));
let obj = crate::backend::with_object(tcx.sess, &metadata_cgu_name, |object| {
crate::metadata::write_metadata(tcx, object);
@ -358,8 +356,7 @@ fn codegen_global_asm(tcx: TyCtxt<'_>, cgu_name: &str, global_asm: &str) {
.collect::<Vec<_>>()
.join("\n");
let output_object_file =
tcx.output_filenames(()).temp_path(OutputType::Object, Some(cgu_name));
let output_object_file = tcx.output_filenames(()).temp_path(OutputType::Object, Some(cgu_name));
// Assemble `global_asm`
let global_asm_object_file = add_file_stem_postfix(output_object_file.clone(), ".asm");