Skip to content

Commit

Permalink
Rollup merge of #74119 - nnethercote:rm-Compiler-compile, r=Mark-Simu…
Browse files Browse the repository at this point in the history
…lacrum

Remove `Compiler::compile()`.

It's unused.

r? @Mark-Simulacrum
  • Loading branch information
Manishearth authored Jul 15, 2020
2 parents 1527126 + 6582240 commit 0bb16c8
Showing 1 changed file with 0 additions and 34 deletions.
34 changes: 0 additions & 34 deletions src/librustc_interface/queries.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ use rustc_session::{output::find_crate_name, Session};
use rustc_span::symbol::sym;
use std::any::Any;
use std::cell::{Ref, RefCell, RefMut};
use std::mem;
use std::rc::Rc;

/// Represent the result of a query.
Expand Down Expand Up @@ -395,37 +394,4 @@ impl Compiler {

ret
}

// This method is different to all the other methods in `Compiler` because
// it lacks a `Queries` entry. It's also not currently used. It does serve
// as an example of how `Compiler` can be used, with additional steps added
// between some passes. And see `rustc_driver::run_compiler` for a more
// complex example.
pub fn compile(&self) -> Result<()> {
let linker = self.enter(|queries| {
queries.prepare_outputs()?;

if self.session().opts.output_types.contains_key(&OutputType::DepInfo)
&& self.session().opts.output_types.len() == 1
{
return Ok(None);
}

queries.global_ctxt()?;

// Drop AST after creating GlobalCtxt to free memory.
mem::drop(queries.expansion()?.take());

queries.ongoing_codegen()?;

let linker = queries.linker()?;
Ok(Some(linker))
})?;

if let Some(linker) = linker {
linker.link()?
}

Ok(())
}
}

0 comments on commit 0bb16c8

Please sign in to comment.