@@ -52,11 +52,12 @@ pub fn compile_input(sess: Session,
52
52
output : & Option < PathBuf > ,
53
53
addl_plugins : Option < Vec < String > > ,
54
54
control : CompileController ) {
55
- macro_rules! controller_entry_point{ ( $point: ident, $make_state: expr) => ( {
56
- {
57
- let state = $make_state;
58
- ( control. $point. callback) ( state) ;
59
- }
55
+ macro_rules! controller_entry_point{ ( $point: ident, $tsess: expr, $make_state: expr) => ( {
56
+ let state = $make_state;
57
+ ( control. $point. callback) ( state) ;
58
+
59
+ $tsess. abort_if_errors( ) ;
60
+
60
61
if control. $point. stop == Compilation :: Stop {
61
62
return ;
62
63
}
@@ -70,6 +71,7 @@ pub fn compile_input(sess: Session,
70
71
let krate = phase_1_parse_input ( & sess, cfg, input) ;
71
72
72
73
controller_entry_point ! ( after_parse,
74
+ sess,
73
75
CompileState :: state_after_parse( input,
74
76
& sess,
75
77
outdir,
@@ -96,6 +98,7 @@ pub fn compile_input(sess: Session,
96
98
} ;
97
99
98
100
controller_entry_point ! ( after_expand,
101
+ sess,
99
102
CompileState :: state_after_expand( input,
100
103
& sess,
101
104
outdir,
@@ -109,6 +112,7 @@ pub fn compile_input(sess: Session,
109
112
write_out_deps ( & sess, input, & outputs, & id[ ..] ) ;
110
113
111
114
controller_entry_point ! ( after_write_deps,
115
+ sess,
112
116
CompileState :: state_after_write_deps( input,
113
117
& sess,
114
118
outdir,
@@ -123,6 +127,7 @@ pub fn compile_input(sess: Session,
123
127
control. make_glob_map ) ;
124
128
125
129
controller_entry_point ! ( after_analysis,
130
+ analysis. ty_cx. sess,
126
131
CompileState :: state_after_analysis( input,
127
132
& analysis. ty_cx. sess,
128
133
outdir,
@@ -149,6 +154,7 @@ pub fn compile_input(sess: Session,
149
154
phase_5_run_llvm_passes ( & sess, & trans, & outputs) ;
150
155
151
156
controller_entry_point ! ( after_llvm,
157
+ sess,
152
158
CompileState :: state_after_llvm( input,
153
159
& sess,
154
160
outdir,
0 commit comments