@@ -82,6 +82,7 @@ fn compile_input(session.session sess,
82
82
str input , str output ,
83
83
bool shared ,
84
84
bool optimize ,
85
+ bool debuginfo ,
85
86
bool verify ,
86
87
bool save_temps ,
87
88
trans. output_type ot ,
@@ -115,11 +116,12 @@ fn compile_input(session.session sess,
115
116
116
117
auto llmod = time[ llvm. ModuleRef ] ( time_passes, "translation" ,
117
118
bind trans. trans_crate ( sess, crate , ty_cx, type_cache, output,
118
- shared) ) ;
119
+ debuginfo , shared) ) ;
119
120
120
121
time[ ( ) ] ( time_passes, "LLVM passes" ,
121
- bind trans. run_passes ( llmod, optimize, verify, save_temps, output,
122
- ot) ) ;
122
+ bind trans. run_passes ( llmod, optimize, debuginfo,
123
+ verify, save_temps, output,
124
+ ot) ) ;
123
125
}
124
126
125
127
fn pretty_print_input ( session . session sess,
@@ -144,6 +146,7 @@ options:
144
146
--noverify suppress LLVM verification step (slight speedup)
145
147
--depend print dependencies, in makefile-rule form
146
148
--parse-only parse only; do not compile, assemble, or link
149
+ -g produce debug info
147
150
-O optimize
148
151
-S compile only; do not assemble or link
149
152
-c compile and assemble, but do not link
@@ -178,7 +181,7 @@ fn main(vec[str] args) {
178
181
auto opts = vec ( optflag ( "h" ) , optflag ( "glue" ) ,
179
182
optflag ( "pretty" ) , optflag ( "ls" ) , optflag ( "parse-only" ) ,
180
183
optflag ( "O" ) , optflag ( "shared" ) , optmulti ( "L" ) ,
181
- optflag ( "S" ) , optflag ( "c" ) , optopt ( "o" ) ,
184
+ optflag ( "S" ) , optflag ( "c" ) , optopt ( "o" ) , optopt ( "g" ) ,
182
185
optflag ( "save-temps" ) , optflag ( "time-passes" ) ,
183
186
optflag ( "no-typestate" ) , optflag ( "noverify" ) ) ;
184
187
auto binary = _vec. shift [ str] ( args) ;
@@ -210,6 +213,7 @@ fn main(vec[str] args) {
210
213
auto save_temps = opt_present ( match , "save-temps" ) ;
211
214
// FIXME: Maybe we should support -O0, -O1, -Os, etc
212
215
auto optimize = opt_present ( match , "O" ) ;
216
+ auto debuginfo = opt_present ( match , "g" ) ;
213
217
auto time_passes = opt_present ( match , "time-passes" ) ;
214
218
auto run_typestate = !opt_present ( match , "no-typestate" ) ;
215
219
auto n_inputs = _vec. len [ str] ( match . free) ;
@@ -243,15 +247,15 @@ fn main(vec[str] args) {
243
247
parts += vec ( "bc" ) ;
244
248
auto ofile = _str. connect ( parts, "." ) ;
245
249
compile_input ( sess, env, ifile, ofile, shared,
246
- optimize, verify , save_temps , ot ,
247
- time_passes , run_typestate ,
248
- library_search_paths) ;
250
+ optimize, debuginfo , verify ,
251
+ save_temps , ot , time_passes ,
252
+ run_typestate , library_search_paths) ;
249
253
}
250
254
case ( some[ str] ( ?ofile) ) {
251
255
compile_input ( sess, env, ifile, ofile, shared,
252
- optimize, verify , save_temps , ot ,
253
- time_passes , run_typestate ,
254
- library_search_paths) ;
256
+ optimize, debuginfo , verify ,
257
+ save_temps , ot , time_passes ,
258
+ run_typestate , library_search_paths) ;
255
259
}
256
260
}
257
261
}
0 commit comments