@@ -368,6 +368,8 @@ mod desc {
368
368
"either a boolean (`yes`, `no`, `on`, `off`, etc), `thin`, `fat`, or omitted" ;
369
369
pub const parse_linker_plugin_lto: & str =
370
370
"either a boolean (`yes`, `no`, `on`, `off`, etc), or the path to the linker plugin" ;
371
+ pub const parse_location_detail: & str =
372
+ "comma seperated list of location details to track: `file`, `line`, or `column`" ;
371
373
pub const parse_switch_with_opt_path: & str =
372
374
"an optional path to the profiling data output directory" ;
373
375
pub const parse_merge_functions: & str = "one of: `disabled`, `trampolines`, or `aliases`" ;
@@ -484,6 +486,25 @@ mod parse {
484
486
}
485
487
}
486
488
489
+ crate fn parse_location_detail ( ld : & mut LocationDetail , v : Option < & str > ) -> bool {
490
+ if let Some ( v) = v {
491
+ ld. line = false ;
492
+ ld. file = false ;
493
+ ld. column = false ;
494
+ for s in v. split ( ',' ) {
495
+ match s {
496
+ "file" => ld. file = true ,
497
+ "line" => ld. line = true ,
498
+ "column" => ld. column = true ,
499
+ _ => return false ,
500
+ }
501
+ }
502
+ true
503
+ } else {
504
+ false
505
+ }
506
+ }
507
+
487
508
crate fn parse_opt_comma_list ( slot : & mut Option < Vec < String > > , v : Option < & str > ) -> bool {
488
509
match v {
489
510
Some ( s) => {
@@ -1152,6 +1173,9 @@ options! {
1152
1173
"a list LLVM plugins to enable (space separated)" ) ,
1153
1174
llvm_time_trace: bool = ( false , parse_bool, [ UNTRACKED ] ,
1154
1175
"generate JSON tracing data file from LLVM data (default: no)" ) ,
1176
+ location_detail: LocationDetail = ( LocationDetail :: all( ) , parse_location_detail, [ TRACKED ] ,
1177
+ "comma seperated list of location details to be tracked when using caller_location \
1178
+ valid options are `file`, `line`, and `column` (default: all)") ,
1155
1179
ls: bool = ( false , parse_bool, [ UNTRACKED ] ,
1156
1180
"list the symbols defined by a library crate (default: no)" ) ,
1157
1181
macro_backtrace: bool = ( false , parse_bool, [ UNTRACKED ] ,
0 commit comments