Skip to content

Commit 00e77be

Browse files
committed
rustc_trans: move save to librustc_save_analysis.
1 parent a6f69f1 commit 00e77be

File tree

11 files changed

+52
-18
lines changed

11 files changed

+52
-18
lines changed

mk/crates.mk

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ TARGET_CRATES := libc std term \
5757
RUSTC_CRATES := rustc rustc_typeck rustc_mir rustc_borrowck rustc_resolve rustc_driver \
5858
rustc_trans rustc_back rustc_llvm rustc_privacy rustc_lint \
5959
rustc_data_structures rustc_front rustc_platform_intrinsics \
60-
rustc_plugin rustc_metadata rustc_passes
60+
rustc_plugin rustc_metadata rustc_passes rustc_save_analysis
6161
HOST_CRATES := syntax syntax_ext $(RUSTC_CRATES) rustdoc fmt_macros \
6262
flate arena graphviz rbml log serialize
6363
TOOLS := compiletest rustdoc rustc rustbook error_index_generator
@@ -102,7 +102,7 @@ DEPS_rustc_data_structures := std log serialize
102102
DEPS_rustc_driver := arena flate getopts graphviz libc rustc rustc_back rustc_borrowck \
103103
rustc_typeck rustc_mir rustc_resolve log syntax serialize rustc_llvm \
104104
rustc_trans rustc_privacy rustc_lint rustc_front rustc_plugin \
105-
rustc_metadata syntax_ext rustc_passes
105+
rustc_metadata syntax_ext rustc_passes rustc_save_analysis
106106
DEPS_rustc_front := std syntax log serialize
107107
DEPS_rustc_lint := rustc log syntax
108108
DEPS_rustc_llvm := native:rustllvm libc std rustc_bitflags
@@ -116,6 +116,7 @@ DEPS_rustc_privacy := rustc rustc_front log syntax
116116
DEPS_rustc_trans := arena flate getopts graphviz libc rustc rustc_back rustc_mir \
117117
log syntax serialize rustc_llvm rustc_front rustc_platform_intrinsics \
118118
rustc_const_eval
119+
DEPS_rustc_save_analysis := rustc log syntax rustc_front
119120
DEPS_rustc_typeck := rustc syntax rustc_front rustc_platform_intrinsics rustc_const_eval
120121

121122
DEPS_rustdoc := rustc rustc_driver native:hoedown serialize getopts \

src/librustc_driver/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ rustc_plugin = { path = "../librustc_plugin" }
2525
rustc_passes = { path = "../librustc_passes" }
2626
rustc_privacy = { path = "../librustc_privacy" }
2727
rustc_resolve = { path = "../librustc_resolve" }
28+
rustc_save_analysis = { path = "../librustc_save_analysis" }
2829
rustc_trans = { path = "../librustc_trans" }
2930
rustc_typeck = { path = "../librustc_typeck" }
3031
rustc_metadata = { path = "../librustc_metadata" }

src/librustc_driver/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ extern crate rustc_privacy;
4848
extern crate rustc_metadata;
4949
extern crate rustc_mir;
5050
extern crate rustc_resolve;
51+
extern crate rustc_save_analysis;
5152
extern crate rustc_trans;
5253
extern crate rustc_typeck;
5354
extern crate serialize;
@@ -62,8 +63,8 @@ use driver::CompileController;
6263
use pretty::{PpMode, UserIdentifiedItem};
6364

6465
use rustc_resolve as resolve;
66+
use rustc_save_analysis as save;
6567
use rustc_trans::back::link;
66-
use rustc_trans::save;
6768
use rustc::session::{config, Session, build_session, CompileResult};
6869
use rustc::session::config::{Input, PrintRequest, OutputType, ErrorOutputType};
6970
use rustc::session::config::{get_unstable_features_setting, OptionStability};

src/librustc_save_analysis/Cargo.toml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[package]
2+
authors = ["The Rust Project Developers"]
3+
name = "rustc_save_analysis"
4+
version = "0.0.0"
5+
6+
[lib]
7+
name = "rustc_save_analysis"
8+
path = "lib.rs"
9+
crate-type = ["dylib"]
10+
11+
[dependencies]
12+
log = { path = "../liblog" }
13+
rustc = { path = "../librustc" }
14+
rustc_front = { path = "../librustc_front" }
15+
syntax = { path = "../libsyntax" }

src/librustc_trans/save/csv_dumper.rs renamed to src/librustc_save_analysis/csv_dumper.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
use std::io::Write;
1212

13-
use middle::def_id::{DefId, DefIndex};
13+
use rustc::middle::def_id::{DefId, DefIndex};
1414
use syntax::codemap::Span;
1515

1616
use super::data::*;

src/librustc_trans/save/data.rs renamed to src/librustc_save_analysis/data.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
1616
use std::hash::Hasher;
1717

18-
use middle::def_id::DefId;
18+
use rustc::middle::def_id::DefId;
1919
use rustc::ty;
2020
use syntax::ast::{CrateNum, NodeId};
2121
use syntax::codemap::Span;
File renamed without changes.

src/librustc_trans/save/dump_visitor.rs renamed to src/librustc_save_analysis/dump_visitor.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,9 @@
2727
//! is used for recording the output in a format-agnostic way (see CsvDumper
2828
//! for an example).
2929
30-
use session::Session;
31-
32-
use middle::def::Def;
33-
use middle::def_id::DefId;
30+
use rustc::middle::def::Def;
31+
use rustc::middle::def_id::DefId;
32+
use rustc::session::Session;
3433
use rustc::ty::{self, TyCtxt};
3534

3635
use std::collections::HashSet;

src/librustc_trans/save/mod.rs renamed to src/librustc_save_analysis/lib.rs

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,37 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
#![crate_name = "rustc_save_analysis"]
12+
#![unstable(feature = "rustc_private", issue = "27812")]
13+
#![crate_type = "dylib"]
14+
#![crate_type = "rlib"]
15+
#![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
16+
html_favicon_url = "https://doc.rust-lang.org/favicon.ico",
17+
html_root_url = "https://doc.rust-lang.org/nightly/")]
18+
#![cfg_attr(not(stage0), deny(warnings))]
19+
20+
#![feature(custom_attribute)]
21+
#![allow(unused_attributes)]
22+
#![feature(rustc_private)]
23+
#![feature(staged_api)]
24+
25+
extern crate rustc;
26+
extern crate rustc_front;
27+
28+
#[macro_use] extern crate log;
29+
#[macro_use] extern crate syntax;
30+
31+
use rustc_front::{hir, lowering};
32+
use rustc::front::map::NodeItem;
33+
use rustc::middle::def::Def;
34+
use rustc::middle::def_id::DefId;
35+
use rustc::session::config::CrateType::CrateTypeExecutable;
1136
use rustc::ty::{self, TyCtxt};
12-
use middle::def::Def;
13-
use middle::def_id::DefId;
1437

1538
use std::env;
1639
use std::fs::{self, File};
1740
use std::path::{Path, PathBuf};
1841

19-
use rustc_front;
20-
use rustc_front::{hir, lowering};
21-
use rustc::front::map::NodeItem;
22-
use rustc::session::config::CrateType::CrateTypeExecutable;
23-
2442
use syntax::ast::{self, NodeId, PatKind};
2543
use syntax::ast_util;
2644
use syntax::codemap::*;

src/librustc_trans/save/span_utils.rs renamed to src/librustc_save_analysis/span_utils.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
use rustc::session::Session;
1212

13-
use save::generated_code;
13+
use generated_code;
1414

1515
use std::cell::Cell;
1616
use std::env;

src/librustc_trans/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ pub mod back {
7676
pub mod diagnostics;
7777

7878
pub mod trans;
79-
pub mod save;
8079

8180
pub mod lib {
8281
pub use llvm;

0 commit comments

Comments
 (0)