Allow writing metadata without llvm

This commit is contained in:
bjorn3 2017-08-13 18:53:50 +02:00
parent a6a7dac5cf
commit cba53f0be5
10 changed files with 95 additions and 14 deletions

View file

@ -77,6 +77,8 @@ pub fn compile_input(sess: &Session,
addl_plugins: Option<Vec<String>>,
control: &CompileController) -> CompileResult {
use rustc_trans::back::write::OngoingCrateTranslation;
use rustc::session::config::CrateType;
macro_rules! controller_entry_point {
($point: ident, $tsess: expr, $make_state: expr, $phase_result: expr) => {{
let state = &mut $make_state;
@ -94,7 +96,6 @@ pub fn compile_input(sess: &Session,
}
if cfg!(not(feature="llvm")) {
use rustc::session::config::CrateType;
if !sess.opts.debugging_opts.no_trans && sess.opts.output_types.should_trans() {
sess.err("LLVM is not supported by this rustc. Please use -Z no-trans to compile")
}

View file

@ -25,6 +25,8 @@
#![feature(rustc_diagnostic_macros)]
#![feature(set_stdio)]
#[cfg(not(feature="llvm"))]
extern crate ar;
extern crate arena;
extern crate getopts;
extern crate graphviz;
@ -157,7 +159,6 @@ pub use rustc_trans::LlvmMetadataLoader as MetadataLoader;
#[cfg(not(feature="llvm"))]
mod no_llvm_metadata_loader {
extern crate ar;
extern crate owning_ref;
use rustc::middle::cstore::MetadataLoader as MetadataLoaderTrait;
@ -166,7 +167,7 @@ mod no_llvm_metadata_loader {
use std::fs::File;
use std::path::Path;
use self::ar::Archive;
use ar::Archive;
use self::owning_ref::{OwningRef, ErasedBoxRef};
pub struct NoLLvmMetadataLoader;