@@ -12,10 +12,9 @@ use rustc_span::edition::Edition;
12
12
use rustc_span:: RealFileName ;
13
13
use rustc_span:: SourceFileHashAlgorithm ;
14
14
use rustc_target:: spec:: {
15
- CodeModel , LinkerFlavorCli , MergeFunctions , OnBrokenPipe , PanicStrategy , SanitizerSet , WasmCAbi ,
16
- } ;
17
- use rustc_target:: spec:: {
18
- RelocModel , RelroLevel , SplitDebuginfo , StackProtector , TargetTriple , TlsModel ,
15
+ CodeModel , FramePointer , LinkerFlavorCli , MergeFunctions , OnBrokenPipe , PanicStrategy ,
16
+ RelocModel , RelroLevel , SanitizerSet , SplitDebuginfo , StackProtector , TargetTriple , TlsModel ,
17
+ WasmCAbi ,
19
18
} ;
20
19
use std:: collections:: BTreeMap ;
21
20
use std:: hash:: { DefaultHasher , Hasher } ;
@@ -374,6 +373,7 @@ mod desc {
374
373
pub const parse_opt_comma_list: & str = parse_comma_list;
375
374
pub const parse_number: & str = "a number" ;
376
375
pub const parse_opt_number: & str = parse_number;
376
+ pub const parse_frame_pointer: & str = parse_bool;
377
377
pub const parse_threads: & str = parse_number;
378
378
pub const parse_time_passes_format: & str = "`text` (default) or `json`" ;
379
379
pub const parse_passes: & str = "a space-separated list of passes, or `all`" ;
@@ -672,6 +672,18 @@ mod parse {
672
672
}
673
673
}
674
674
675
+ pub ( crate ) fn parse_frame_pointer ( slot : & mut FramePointer , v : Option < & str > ) -> bool {
676
+ let mut boolish = false ;
677
+ let mut is_parsed = parse_bool ( & mut boolish, v) ;
678
+ if boolish & is_parsed {
679
+ * slot = FramePointer :: Always ;
680
+ } else if false {
681
+ /* TODO: add NonLeaf as an unstable opt */
682
+ is_parsed = true ;
683
+ } ;
684
+ is_parsed
685
+ }
686
+
675
687
pub ( crate ) fn parse_passes ( slot : & mut Passes , v : Option < & str > ) -> bool {
676
688
match v {
677
689
Some ( "all" ) => {
@@ -1479,7 +1491,7 @@ options! {
1479
1491
"emit bitcode in rlibs (default: yes)" ) ,
1480
1492
extra_filename: String = ( String :: new( ) , parse_string, [ UNTRACKED ] ,
1481
1493
"extra data to put in each output filename" ) ,
1482
- force_frame_pointers: Option < bool > = ( None , parse_opt_bool , [ TRACKED ] ,
1494
+ force_frame_pointers: FramePointer = ( FramePointer :: MayOmit , parse_frame_pointer , [ TRACKED ] ,
1483
1495
"force use of the frame pointers" ) ,
1484
1496
#[ rustc_lint_opt_deny_field_access( "use `Session::must_emit_unwind_tables` instead of this field" ) ]
1485
1497
force_unwind_tables: Option <bool > = ( None , parse_opt_bool, [ TRACKED ] ,
0 commit comments