@@ -381,6 +381,24 @@ pub enum DebugInfo {
381
381
Full ,
382
382
}
383
383
384
+ #[ derive( Clone , Copy , Debug , PartialEq , Hash ) ]
385
+ pub enum DebugInfoCompression {
386
+ None ,
387
+ Zlib ,
388
+ Zstd ,
389
+ }
390
+
391
+ impl ToString for DebugInfoCompression {
392
+ fn to_string ( & self ) -> String {
393
+ match self {
394
+ DebugInfoCompression :: None => "none" ,
395
+ DebugInfoCompression :: Zlib => "zlib" ,
396
+ DebugInfoCompression :: Zstd => "zstd" ,
397
+ }
398
+ . to_owned ( )
399
+ }
400
+ }
401
+
384
402
/// Split debug-information is enabled by `-C split-debuginfo`, this enum is only used if split
385
403
/// debug-information is enabled (in either `Packed` or `Unpacked` modes), and the platform
386
404
/// uses DWARF for debug-information.
@@ -1015,6 +1033,7 @@ impl Default for Options {
1015
1033
crate_types : Vec :: new ( ) ,
1016
1034
optimize : OptLevel :: No ,
1017
1035
debuginfo : DebugInfo :: None ,
1036
+ debuginfo_compression : DebugInfoCompression :: None ,
1018
1037
lint_opts : Vec :: new ( ) ,
1019
1038
lint_cap : None ,
1020
1039
describe_lints : false ,
@@ -2277,6 +2296,13 @@ fn select_debuginfo(matches: &getopts::Matches, cg: &CodegenOptions) -> DebugInf
2277
2296
if max_g > max_c { DebugInfo :: Full } else { cg. debuginfo }
2278
2297
}
2279
2298
2299
+ fn select_debuginfo_compression (
2300
+ _handler : & EarlyErrorHandler ,
2301
+ unstable_opts : & UnstableOptions ,
2302
+ ) -> DebugInfoCompression {
2303
+ unstable_opts. debuginfo_compression
2304
+ }
2305
+
2280
2306
pub ( crate ) fn parse_assert_incr_state (
2281
2307
handler : & EarlyErrorHandler ,
2282
2308
opt_assertion : & Option < String > ,
@@ -2752,6 +2778,8 @@ pub fn build_session_options(
2752
2778
// for more details.
2753
2779
let debug_assertions = cg. debug_assertions . unwrap_or ( opt_level == OptLevel :: No ) ;
2754
2780
let debuginfo = select_debuginfo ( matches, & cg) ;
2781
+ let debuginfo_compression: DebugInfoCompression =
2782
+ select_debuginfo_compression ( handler, & unstable_opts) ;
2755
2783
2756
2784
let mut search_paths = vec ! [ ] ;
2757
2785
for s in & matches. opt_strs ( "L" ) {
@@ -2828,6 +2856,7 @@ pub fn build_session_options(
2828
2856
crate_types,
2829
2857
optimize : opt_level,
2830
2858
debuginfo,
2859
+ debuginfo_compression,
2831
2860
lint_opts,
2832
2861
lint_cap,
2833
2862
describe_lints,
@@ -3113,11 +3142,11 @@ impl PpMode {
3113
3142
/// how the hash should be calculated when adding a new command-line argument.
3114
3143
pub ( crate ) mod dep_tracking {
3115
3144
use super :: {
3116
- BranchProtection , CFGuard , CFProtection , CrateType , DebugInfo , ErrorOutputType ,
3117
- InstrumentCoverage , InstrumentXRay , LdImpl , LinkerPluginLto , LocationDetail , LtoCli ,
3118
- OomStrategy , OptLevel , OutFileName , OutputType , OutputTypes , Passes , ResolveDocLinks ,
3119
- SourceFileHashAlgorithm , SplitDwarfKind , SwitchWithOptPath , SymbolManglingVersion ,
3120
- TraitSolver , TrimmedDefPaths ,
3145
+ BranchProtection , CFGuard , CFProtection , CrateType , DebugInfo , DebugInfoCompression ,
3146
+ ErrorOutputType , InstrumentCoverage , InstrumentXRay , LdImpl , LinkerPluginLto ,
3147
+ LocationDetail , LtoCli , OomStrategy , OptLevel , OutFileName , OutputType , OutputTypes ,
3148
+ Passes , ResolveDocLinks , SourceFileHashAlgorithm , SplitDwarfKind , SwitchWithOptPath ,
3149
+ SymbolManglingVersion , TraitSolver , TrimmedDefPaths ,
3121
3150
} ;
3122
3151
use crate :: lint;
3123
3152
use crate :: options:: WasiExecModel ;
@@ -3195,6 +3224,7 @@ pub(crate) mod dep_tracking {
3195
3224
OptLevel ,
3196
3225
LtoCli ,
3197
3226
DebugInfo ,
3227
+ DebugInfoCompression ,
3198
3228
UnstableFeatures ,
3199
3229
NativeLib ,
3200
3230
NativeLibKind ,
0 commit comments