Skip to content

Commit

Permalink
Use cg_ssa for creating the dylib metadata file
Browse files Browse the repository at this point in the history
The new api was introduced in rust-lang/rust#91604
  • Loading branch information
bjorn3 committed Dec 9, 2021
1 parent 95cfeb4 commit 4796207
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 78 deletions.
4 changes: 3 additions & 1 deletion src/driver/aot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
use std::path::PathBuf;

use rustc_ast::{InlineAsmOptions, InlineAsmTemplatePiece};
use rustc_codegen_ssa::back::metadata::create_compressed_metadata_file;
use rustc_codegen_ssa::{CodegenResults, CompiledModule, CrateInfo, ModuleKind};
use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
use rustc_metadata::EncodedMetadata;
Expand Down Expand Up @@ -278,7 +279,8 @@ pub(crate) fn run_aot(
let tmp_file =
tcx.output_filenames(()).temp_path(OutputType::Metadata, Some(&metadata_cgu_name));

let obj = crate::metadata::new_metadata_object(tcx, &metadata_cgu_name, &metadata);
let symbol_name = rustc_middle::middle::exported_symbols::metadata_symbol_name(tcx);
let obj = create_compressed_metadata_file(tcx.sess, &metadata, &symbol_name);

if let Err(err) = std::fs::write(&tmp_file, obj) {
tcx.sess.fatal(&format!("error writing metadata object file: {}", err));
Expand Down
1 change: 0 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ mod inline_asm;
mod intrinsics;
mod linkage;
mod main_shim;
mod metadata;
mod num;
mod optimize;
mod pointer;
Expand Down
76 changes: 0 additions & 76 deletions src/metadata.rs

This file was deleted.

0 comments on commit 4796207

Please sign in to comment.