Skip to content

Commit 995f039

Browse files
committed
---
yaml --- r: 152484 b: refs/heads/try2 c: 984e9af h: refs/heads/master v: v3
1 parent bdad629 commit 995f039

File tree

13 files changed

+2534
-39
lines changed

13 files changed

+2534
-39
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 5d9bceb1440b6bb5759bc3c1e5ad2170a199d0ce
8+
refs/heads/try2: 984e9afae5098192a789dc39d44cec8225067896
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/.travis.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ install:
1212
- sudo apt-get update -qq
1313
- sudo apt-get install -qq --force-yes -y llvm-$LLVM_VERSION
1414
llvm-${LLVM_VERSION}-dev clang-$LLVM_VERSION lldb-$LLVM_VERSION
15+
libjemalloc-dev
1516

1617

1718
# All of the llvm tools are suffixed with "-$VERS" which we don't want, so
@@ -28,7 +29,7 @@ before_script:
2829
- ln -nsf /usr/bin/llc-$LLVM_VERSION local-llvm/bin/llc
2930
- ln -nsf /usr/include/llvm-$LLVM_VERSION local-llvm/include
3031
- ./configure --disable-optimize-tests --llvm-root=`pwd`/local-llvm
31-
--enable-fast-make --enable-clang
32+
--enable-fast-make --enable-clang --jemalloc-root=/usr/lib
3233

3334
# Tidy everything up first, then build a few things, and then run a few tests.
3435
# Note that this is meant to run in a "fairly small" amount of time, so this

branches/try2/src/librustc/driver/config.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,8 @@ debugging_opts!(
172172
LTO,
173173
AST_JSON,
174174
AST_JSON_NOEXPAND,
175-
LS
175+
LS,
176+
SAVE_ANALYSIS
176177
]
177178
0
178179
)
@@ -206,7 +207,9 @@ pub fn debugging_opts_map() -> Vec<(&'static str, &'static str, u64)> {
206207
("lto", "Perform LLVM link-time optimizations", LTO),
207208
("ast-json", "Print the AST as JSON and halt", AST_JSON),
208209
("ast-json-noexpand", "Print the pre-expansion AST as JSON and halt", AST_JSON_NOEXPAND),
209-
("ls", "List the symbols defined by a library crate", LS))
210+
("ls", "List the symbols defined by a library crate", LS),
211+
("save-analysis", "Write syntax and type analysis information \
212+
in addition to normal output", SAVE_ANALYSIS))
210213
}
211214

212215
/// Declare a macro that will define all CodegenOptions fields and parsers all

branches/try2/src/librustc/driver/driver.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ pub fn compile_input(sess: Session,
8787
if stop_after_phase_2(&sess) { return; }
8888

8989
let analysis = phase_3_run_analysis_passes(sess, &expanded_crate, ast_map);
90+
phase_save_analysis(&analysis.ty_cx.sess, &expanded_crate, &analysis, outdir);
9091
if stop_after_phase_3(&analysis.ty_cx.sess) { return; }
9192
let (tcx, trans) = phase_4_translate_to_llvm(expanded_crate,
9293
analysis, &outputs);
@@ -370,6 +371,17 @@ pub fn phase_3_run_analysis_passes(sess: Session,
370371
}
371372
}
372373

374+
pub fn phase_save_analysis(sess: &Session,
375+
krate: &ast::Crate,
376+
analysis: &CrateAnalysis,
377+
odir: &Option<Path>) {
378+
if (sess.opts.debugging_opts & config::SAVE_ANALYSIS) == 0 {
379+
return;
380+
}
381+
time(sess.time_passes(), "save analysis", krate, |krate|
382+
middle::save::process_crate(sess, krate, analysis, odir));
383+
}
384+
373385
pub struct CrateTranslation {
374386
pub context: ContextRef,
375387
pub module: ModuleRef,

branches/try2/src/librustc/driver/session.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ use syntax::{ast, codemap};
2828
use std::os;
2929
use std::cell::{Cell, RefCell};
3030

31+
3132
pub struct Session {
3233
pub targ_cfg: config::Config,
3334
pub opts: config::Options,

branches/try2/src/librustc/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ pub mod middle {
8484
pub mod expr_use_visitor;
8585
pub mod dependency_format;
8686
pub mod weak_lang_items;
87+
pub mod save;
8788
}
8889

8990
pub mod front {

0 commit comments

Comments
 (0)