@@ -52,11 +52,11 @@ 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
if control. $point. stop == Compilation :: Stop {
61
61
return ;
62
62
}
@@ -70,6 +70,7 @@ pub fn compile_input(sess: Session,
70
70
let krate = phase_1_parse_input ( & sess, cfg, input) ;
71
71
72
72
controller_entry_point ! ( after_parse,
73
+ sess,
73
74
CompileState :: state_after_parse( input,
74
75
& sess,
75
76
outdir,
@@ -96,6 +97,7 @@ pub fn compile_input(sess: Session,
96
97
} ;
97
98
98
99
controller_entry_point ! ( after_expand,
100
+ sess,
99
101
CompileState :: state_after_expand( input,
100
102
& sess,
101
103
outdir,
@@ -109,6 +111,7 @@ pub fn compile_input(sess: Session,
109
111
write_out_deps ( & sess, input, & outputs, & id[ ..] ) ;
110
112
111
113
controller_entry_point ! ( after_write_deps,
114
+ sess,
112
115
CompileState :: state_after_write_deps( input,
113
116
& sess,
114
117
outdir,
@@ -123,6 +126,7 @@ pub fn compile_input(sess: Session,
123
126
control. make_glob_map ) ;
124
127
125
128
controller_entry_point ! ( after_analysis,
129
+ analysis. ty_cx. sess,
126
130
CompileState :: state_after_analysis( input,
127
131
& analysis. ty_cx. sess,
128
132
outdir,
@@ -149,6 +153,7 @@ pub fn compile_input(sess: Session,
149
153
phase_5_run_llvm_passes ( & sess, & trans, & outputs) ;
150
154
151
155
controller_entry_point ! ( after_llvm,
156
+ sess,
152
157
CompileState :: state_after_llvm( input,
153
158
& sess,
154
159
outdir,
0 commit comments