rust/src/librustc/lib.rs

134 lines
3.1 KiB
Rust
Raw Normal View History

2013-02-28 07:15:32 -06:00
// Copyright 2012-2013 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.
//! The Rust compiler.
//!
//! # Note
//!
//! This API is completely unstable and subject to change.
2014-01-07 23:17:52 -06:00
#![crate_name = "rustc"]
#![experimental]
#![comment = "The Rust compiler"]
#![license = "MIT/ASL2"]
#![crate_type = "dylib"]
#![crate_type = "rlib"]
#![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
2014-01-07 23:17:52 -06:00
html_favicon_url = "http://www.rust-lang.org/favicon.ico",
html_root_url = "http://doc.rust-lang.org/nightly/")]
2011-05-05 21:44:00 -05:00
2014-10-14 13:41:50 -05:00
#![feature(default_type_params, globs, if_let, import_shadowing, macro_rules, phase, quote)]
#![feature(slicing_syntax, tuple_indexing, unsafe_destructor)]
#![feature(rustc_diagnostic_macros)]
extern crate arena;
extern crate flate;
extern crate getopts;
extern crate graphviz;
extern crate libc;
extern crate rustc_llvm;
extern crate rustc_back;
extern crate serialize;
extern crate rbml;
2014-06-11 20:47:09 -05:00
#[phase(plugin, link)] extern crate log;
#[phase(plugin, link)] extern crate syntax;
remove seek from std::io::MemWriter, add SeekableMemWriter to librustc Not all users of MemWriter need to seek, but having MemWriter seekable adds between 3-29% in overhead in certain circumstances. This fixes that performance gap by making a non-seekable MemWriter, and creating a new SeekableMemWriter for those circumstances when that functionality is actually needed. ``` test io::mem::test::bench_buf_reader ... bench: 682 ns/iter (+/- 85) test io::mem::test::bench_buf_writer ... bench: 580 ns/iter (+/- 57) test io::mem::test::bench_mem_reader ... bench: 793 ns/iter (+/- 99) test io::mem::test::bench_mem_writer_001_0000 ... bench: 48 ns/iter (+/- 27) test io::mem::test::bench_mem_writer_001_0010 ... bench: 65 ns/iter (+/- 27) = 153 MB/s test io::mem::test::bench_mem_writer_001_0100 ... bench: 132 ns/iter (+/- 12) = 757 MB/s test io::mem::test::bench_mem_writer_001_1000 ... bench: 802 ns/iter (+/- 151) = 1246 MB/s test io::mem::test::bench_mem_writer_100_0000 ... bench: 481 ns/iter (+/- 28) test io::mem::test::bench_mem_writer_100_0010 ... bench: 1957 ns/iter (+/- 126) = 510 MB/s test io::mem::test::bench_mem_writer_100_0100 ... bench: 8222 ns/iter (+/- 434) = 1216 MB/s test io::mem::test::bench_mem_writer_100_1000 ... bench: 82496 ns/iter (+/- 11191) = 1212 MB/s test io::mem::test::bench_seekable_mem_writer_001_0000 ... bench: 48 ns/iter (+/- 2) test io::mem::test::bench_seekable_mem_writer_001_0010 ... bench: 64 ns/iter (+/- 2) = 156 MB/s test io::mem::test::bench_seekable_mem_writer_001_0100 ... bench: 129 ns/iter (+/- 7) = 775 MB/s test io::mem::test::bench_seekable_mem_writer_001_1000 ... bench: 801 ns/iter (+/- 159) = 1248 MB/s test io::mem::test::bench_seekable_mem_writer_100_0000 ... bench: 711 ns/iter (+/- 51) test io::mem::test::bench_seekable_mem_writer_100_0010 ... bench: 2532 ns/iter (+/- 227) = 394 MB/s test io::mem::test::bench_seekable_mem_writer_100_0100 ... bench: 8962 ns/iter (+/- 947) = 1115 MB/s test io::mem::test::bench_seekable_mem_writer_100_1000 ... bench: 85086 ns/iter (+/- 11555) = 1175 MB/s ``` [breaking-change]
2014-07-29 18:31:39 -05:00
#[cfg(test)]
extern crate test;
pub use rustc_llvm as llvm;
mod diagnostics;
2014-07-04 21:41:54 -05:00
pub mod back {
pub use rustc_back::abi;
2014-07-06 23:50:37 -05:00
pub use rustc_back::archive;
2014-07-04 21:41:54 -05:00
pub use rustc_back::arm;
pub use rustc_back::mips;
pub use rustc_back::mipsel;
2014-07-06 20:01:16 -05:00
pub use rustc_back::rpath;
2014-07-04 21:41:54 -05:00
pub use rustc_back::svh;
pub use rustc_back::target_strs;
pub use rustc_back::x86;
pub use rustc_back::x86_64;
}
pub mod middle {
pub mod astencode;
pub mod borrowck;
pub mod cfg;
pub mod check_const;
pub mod check_static_recursion;
pub mod check_loop;
pub mod check_match;
2014-09-01 22:55:07 -05:00
pub mod check_rvalues;
pub mod check_static;
pub mod const_eval;
2013-04-17 17:05:17 -05:00
pub mod dataflow;
pub mod dead;
pub mod def;
pub mod dependency_format;
pub mod effect;
pub mod entry;
pub mod expr_use_visitor;
pub mod fast_reject;
pub mod graph;
pub mod intrinsicck;
pub mod lang_items;
pub mod liveness;
pub mod mem_categorization;
pub mod pat_util;
pub mod privacy;
pub mod reachable;
pub mod region;
pub mod resolve;
pub mod resolve_lifetime;
pub mod stability;
pub mod subst;
pub mod traits;
pub mod ty;
pub mod ty_fold;
pub mod typeck;
pub mod weak_lang_items;
2011-04-19 18:40:46 -05:00
}
pub mod metadata;
pub mod session;
2010-06-23 23:03:09 -05:00
2014-05-26 16:48:54 -05:00
pub mod plugin;
pub mod lint;
pub mod util {
2014-07-07 00:13:55 -05:00
pub use rustc_back::fs;
2014-07-07 00:21:04 -05:00
pub use rustc_back::sha2;
2014-07-07 00:13:55 -05:00
pub mod common;
pub mod ppaux;
pub mod nodemap;
2014-07-22 06:40:51 -05:00
pub mod snapshot_vec;
2010-08-18 13:34:47 -05:00
}
pub mod lib {
2014-07-05 15:24:57 -05:00
pub use llvm;
2010-07-12 19:47:40 -05:00
}
__build_diagnostic_array!(DIAGNOSTICS)
// A private module so that macro-expanded idents like
// `::rustc::lint::Lint` will also work in `rustc` itself.
//
// `libstd` uses the same trick.
#[doc(hidden)]
mod rustc {
pub use lint;
}