Use fixed type for CodegenResults
This also moves the -Zno-link implementation to rustc_interface
This commit is contained in:
parent
f141acf067
commit
69f26b7761
4 changed files with 23 additions and 27 deletions
|
@ -14,7 +14,8 @@ use rustc_middle::arena::Arena;
|
|||
use rustc_middle::dep_graph::DepGraph;
|
||||
use rustc_middle::ty::steal::Steal;
|
||||
use rustc_middle::ty::{GlobalCtxt, ResolverOutputs, TyCtxt};
|
||||
use rustc_session::config::{OutputFilenames, OutputType};
|
||||
use rustc_serialize::json;
|
||||
use rustc_session::config::{self, OutputFilenames, OutputType};
|
||||
use rustc_session::{output::find_crate_name, Session};
|
||||
use rustc_span::symbol::sym;
|
||||
use std::any::Any;
|
||||
|
@ -387,6 +388,19 @@ impl Linker {
|
|||
{
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
if sess.opts.debugging_opts.no_link {
|
||||
// FIXME: use a binary format to encode the `.rlink` file
|
||||
let rlink_data = json::encode(&codegen_results).map_err(|err| {
|
||||
sess.fatal(&format!("failed to encode rlink: {}", err));
|
||||
})?;
|
||||
let rlink_file = self.prepare_outputs.with_extension(config::RLINK_EXT);
|
||||
std::fs::write(&rlink_file, rlink_data).map_err(|err| {
|
||||
sess.fatal(&format!("failed to write file {}: {}", rlink_file.display(), err));
|
||||
})?;
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
self.codegen_backend.link(&self.sess, codegen_results, &self.prepare_outputs)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue