Separate the driver into its own crate that uses trans, typeck.
This commit is contained in:
parent
93eb4333a0
commit
61edb0ccb7
17
mk/crates.mk
17
mk/crates.mk
@ -53,8 +53,8 @@ TARGET_CRATES := libc std flate arena term \
|
||||
serialize getopts collections test time rand \
|
||||
log regex graphviz core rbml alloc rustrt \
|
||||
unicode
|
||||
HOST_CRATES := syntax rustc rustc_typeck rustc_trans rustdoc regex_macros fmt_macros \
|
||||
rustc_llvm rustc_back
|
||||
RUSTC_CRATES := rustc rustc_typeck rustc_driver rustc_trans rustc_back rustc_llvm
|
||||
HOST_CRATES := syntax $(RUSTC_CRATES) rustdoc regex_macros fmt_macros
|
||||
CRATES := $(TARGET_CRATES) $(HOST_CRATES)
|
||||
TOOLS := compiletest rustdoc rustc
|
||||
|
||||
@ -67,14 +67,16 @@ DEPS_std := core libc rand alloc collections rustrt unicode \
|
||||
native:rust_builtin native:backtrace
|
||||
DEPS_graphviz := std
|
||||
DEPS_syntax := std term serialize log fmt_macros arena libc
|
||||
DEPS_rustc_driver := arena flate getopts graphviz libc rustc rustc_back \
|
||||
rustc_typeck log syntax serialize rustc_llvm rustc_trans
|
||||
DEPS_rustc_trans := arena flate getopts graphviz libc rustc rustc_back \
|
||||
rustc_typeck log syntax serialize rustc_llvm
|
||||
log syntax serialize rustc_llvm
|
||||
DEPS_rustc_typeck := rustc syntax
|
||||
DEPS_rustc := syntax flate arena serialize getopts rbml \
|
||||
time log graphviz rustc_llvm rustc_back
|
||||
DEPS_rustc_llvm := native:rustllvm libc std
|
||||
DEPS_rustc_back := std syntax rustc_llvm flate log libc
|
||||
DEPS_rustdoc := rustc rustc_trans native:hoedown serialize getopts \
|
||||
DEPS_rustdoc := rustc rustc_driver native:hoedown serialize getopts \
|
||||
test time
|
||||
DEPS_flate := std native:miniz
|
||||
DEPS_arena := std
|
||||
@ -96,7 +98,7 @@ DEPS_fmt_macros = std
|
||||
|
||||
TOOL_DEPS_compiletest := test getopts
|
||||
TOOL_DEPS_rustdoc := rustdoc
|
||||
TOOL_DEPS_rustc := rustc_trans
|
||||
TOOL_DEPS_rustc := rustc_driver
|
||||
TOOL_SOURCE_compiletest := $(S)src/compiletest/compiletest.rs
|
||||
TOOL_SOURCE_rustdoc := $(S)src/driver/driver.rs
|
||||
TOOL_SOURCE_rustc := $(S)src/driver/driver.rs
|
||||
@ -115,8 +117,9 @@ ONLY_RLIB_unicode := 1
|
||||
DOC_CRATES := $(filter-out rustc, \
|
||||
$(filter-out rustc_trans, \
|
||||
$(filter-out rustc_typeck, \
|
||||
$(filter-out syntax, $(CRATES)))))
|
||||
COMPILER_DOC_CRATES := rustc rustc_trans rustc_typeck syntax
|
||||
$(filter-out rustc_driver, \
|
||||
$(filter-out syntax, $(CRATES))))))
|
||||
COMPILER_DOC_CRATES := rustc rustc_trans rustc_typeck rustc_driver syntax
|
||||
|
||||
# This macro creates some simple definitions for each crate being built, just
|
||||
# some munging of all of the parameters above.
|
||||
|
@ -12,6 +12,6 @@
|
||||
extern crate "rustdoc" as this;
|
||||
|
||||
#[cfg(rustc)]
|
||||
extern crate "rustc_trans" as this;
|
||||
extern crate "rustc_driver" as this;
|
||||
|
||||
fn main() { this::main() }
|
||||
|
@ -8,22 +8,22 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use back::link;
|
||||
use back::write;
|
||||
use session::Session;
|
||||
use session::config::{mod, Input, OutputFilenames};
|
||||
use lint;
|
||||
use metadata::creader;
|
||||
use middle::{stability, ty, reachable};
|
||||
use middle::dependency_format;
|
||||
use middle;
|
||||
use plugin::load::Plugins;
|
||||
use plugin::registry::Registry;
|
||||
use plugin;
|
||||
use rustc::session::Session;
|
||||
use rustc::session::config::{mod, Input, OutputFilenames};
|
||||
use rustc::lint;
|
||||
use rustc::metadata::creader;
|
||||
use rustc::middle::{stability, ty, reachable};
|
||||
use rustc::middle::dependency_format;
|
||||
use rustc::middle;
|
||||
use rustc::plugin::load::Plugins;
|
||||
use rustc::plugin::registry::Registry;
|
||||
use rustc::plugin;
|
||||
use rustc::util::common::time;
|
||||
use rustc_trans::back::link;
|
||||
use rustc_trans::back::write;
|
||||
use rustc_trans::save;
|
||||
use rustc_trans::trans;
|
||||
use rustc_typeck as typeck;
|
||||
use trans;
|
||||
|
||||
use util::common::time;
|
||||
|
||||
use serialize::{json, Encodable};
|
||||
|
||||
@ -31,7 +31,6 @@ use std::io;
|
||||
use std::io::fs;
|
||||
use std::os;
|
||||
use arena::TypedArena;
|
||||
use save;
|
||||
use syntax::ast;
|
||||
use syntax::ast_map;
|
||||
use syntax::attr;
|
@ -1,4 +1,4 @@
|
||||
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
|
||||
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
@ -8,15 +8,46 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
//! The Rust compiler.
|
||||
//!
|
||||
//! # Note
|
||||
//!
|
||||
//! This API is completely unstable and subject to change.
|
||||
|
||||
#![crate_name = "rustc_driver"]
|
||||
#![experimental]
|
||||
#![crate_type = "dylib"]
|
||||
#![crate_type = "rlib"]
|
||||
#![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
|
||||
html_favicon_url = "http://www.rust-lang.org/favicon.ico",
|
||||
html_root_url = "http://doc.rust-lang.org/nightly/")]
|
||||
|
||||
#![feature(default_type_params, globs, if_let, import_shadowing, macro_rules, phase, quote)]
|
||||
#![feature(slicing_syntax, unsafe_destructor)]
|
||||
#![feature(rustc_diagnostic_macros)]
|
||||
|
||||
extern crate arena;
|
||||
extern crate flate;
|
||||
extern crate getopts;
|
||||
extern crate graphviz;
|
||||
extern crate libc;
|
||||
extern crate rustc;
|
||||
extern crate rustc_typeck;
|
||||
extern crate rustc_back;
|
||||
extern crate rustc_trans;
|
||||
#[phase(plugin, link)] extern crate log;
|
||||
#[phase(plugin, link)] extern crate syntax;
|
||||
extern crate serialize;
|
||||
extern crate "rustc_llvm" as llvm;
|
||||
|
||||
pub use syntax::diagnostic;
|
||||
|
||||
use back::link;
|
||||
use session::{config, Session, build_session};
|
||||
use session::config::Input;
|
||||
use lint::Lint;
|
||||
use lint;
|
||||
use metadata;
|
||||
|
||||
use rustc_trans::back::link;
|
||||
use rustc::session::{config, Session, build_session};
|
||||
use rustc::session::config::Input;
|
||||
use rustc::lint::Lint;
|
||||
use rustc::lint;
|
||||
use rustc::metadata;
|
||||
use rustc::DIAGNOSTICS;
|
||||
|
||||
use std::any::AnyRefExt;
|
||||
@ -24,14 +55,15 @@ use std::io;
|
||||
use std::os;
|
||||
use std::task::TaskBuilder;
|
||||
|
||||
use session::early_error;
|
||||
use rustc::session::early_error;
|
||||
|
||||
use syntax::ast;
|
||||
use syntax::parse;
|
||||
use syntax::diagnostic::Emitter;
|
||||
use syntax::diagnostics;
|
||||
|
||||
use getopts;
|
||||
#[cfg(test)]
|
||||
pub mod test;
|
||||
|
||||
pub mod driver;
|
||||
pub mod pretty;
|
||||
@ -507,3 +539,9 @@ pub fn monitor(f: proc():Send) {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn main() {
|
||||
let args = std::os::args();
|
||||
let result = run(args);
|
||||
std::os::set_exit_status(result);
|
||||
}
|
||||
|
10
src/librustc_driver/mod.rs
Normal file
10
src/librustc_driver/mod.rs
Normal file
@ -0,0 +1,10 @@
|
||||
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
@ -15,19 +15,18 @@ pub use self::PpSourceMode::*;
|
||||
pub use self::PpMode::*;
|
||||
use self::NodesMatchingUII::*;
|
||||
|
||||
use back::link;
|
||||
use rustc_trans::back::link;
|
||||
|
||||
use session::Session;
|
||||
use session::config::{mod, Input};
|
||||
use driver::driver::{mod};
|
||||
use driver;
|
||||
|
||||
use middle::ty;
|
||||
use middle::borrowck::{mod, FnPartsWithCFG};
|
||||
use middle::borrowck::graphviz as borrowck_dot;
|
||||
use middle::cfg;
|
||||
use middle::cfg::graphviz::LabelledCFG;
|
||||
|
||||
use util::ppaux;
|
||||
use rustc::middle::ty;
|
||||
use rustc::middle::borrowck::{mod, FnPartsWithCFG};
|
||||
use rustc::middle::borrowck::graphviz as borrowck_dot;
|
||||
use rustc::middle::cfg;
|
||||
use rustc::middle::cfg::graphviz::LabelledCFG;
|
||||
use rustc::session::Session;
|
||||
use rustc::session::config::{mod, Input};
|
||||
use rustc::util::ppaux;
|
||||
|
||||
use syntax::ast;
|
||||
use syntax::ast_map::{mod, blocks, NodePrinter};
|
@ -32,7 +32,6 @@ extern crate getopts;
|
||||
extern crate graphviz;
|
||||
extern crate libc;
|
||||
extern crate rustc;
|
||||
extern crate rustc_typeck;
|
||||
extern crate rustc_back;
|
||||
#[phase(plugin, link)] extern crate log;
|
||||
#[phase(plugin, link)] extern crate syntax;
|
||||
@ -66,17 +65,7 @@ pub mod back {
|
||||
|
||||
pub mod trans;
|
||||
pub mod save;
|
||||
pub mod driver;
|
||||
|
||||
pub mod lib {
|
||||
pub use llvm;
|
||||
}
|
||||
|
||||
pub fn main() {
|
||||
let args = std::os::args();
|
||||
let result = driver::run(args);
|
||||
std::os::set_exit_status(result);
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
pub mod test;
|
||||
|
@ -9,7 +9,7 @@
|
||||
// except according to those terms.
|
||||
pub use self::MaybeTyped::*;
|
||||
|
||||
use rustc_trans::driver::driver;
|
||||
use rustc_driver::driver;
|
||||
use rustc::session::{mod, config};
|
||||
use rustc::middle::{privacy, ty};
|
||||
use rustc::lint;
|
||||
|
@ -21,6 +21,7 @@ extern crate getopts;
|
||||
extern crate libc;
|
||||
extern crate rustc;
|
||||
extern crate rustc_trans;
|
||||
extern crate rustc_driver;
|
||||
extern crate serialize;
|
||||
extern crate syntax;
|
||||
extern crate "test" as testing;
|
||||
@ -163,7 +164,7 @@ pub fn main_args(args: &[String]) -> int {
|
||||
usage(args[0].as_slice());
|
||||
return 0;
|
||||
} else if matches.opt_present("version") {
|
||||
match rustc_trans::driver::version("rustdoc", &matches) {
|
||||
match rustc_driver::version("rustdoc", &matches) {
|
||||
Some(err) => {
|
||||
println!("{}", err);
|
||||
return 1
|
||||
|
@ -19,7 +19,7 @@ use std::string::String;
|
||||
use std::collections::{HashSet, HashMap};
|
||||
use testing;
|
||||
use rustc::session::{mod, config};
|
||||
use rustc_trans::driver::driver;
|
||||
use rustc_driver::driver;
|
||||
use syntax::ast;
|
||||
use syntax::codemap::{CodeMap, dummy_spanned};
|
||||
use syntax::diagnostic;
|
||||
|
Loading…
Reference in New Issue
Block a user