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