@@ -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 ,
@@ -2283,6 +2302,13 @@ fn select_debuginfo(matches: &getopts::Matches, cg: &CodegenOptions) -> DebugInf
2283
2302
if max_g > max_c { DebugInfo :: Full } else { cg. debuginfo }
2284
2303
}
2285
2304
2305
+ fn select_debuginfo_compression (
2306
+ _handler : & EarlyErrorHandler ,
2307
+ unstable_opts : & UnstableOptions ,
2308
+ ) -> DebugInfoCompression {
2309
+ unstable_opts. debuginfo_compression
2310
+ }
2311
+
2286
2312
pub ( crate ) fn parse_assert_incr_state (
2287
2313
handler : & EarlyErrorHandler ,
2288
2314
opt_assertion : & Option < String > ,
@@ -2758,6 +2784,8 @@ pub fn build_session_options(
2758
2784
// for more details.
2759
2785
let debug_assertions = cg. debug_assertions . unwrap_or ( opt_level == OptLevel :: No ) ;
2760
2786
let debuginfo = select_debuginfo ( matches, & cg) ;
2787
+ let debuginfo_compression: DebugInfoCompression =
2788
+ select_debuginfo_compression ( handler, & unstable_opts) ;
2761
2789
2762
2790
let mut search_paths = vec ! [ ] ;
2763
2791
for s in & matches. opt_strs ( "L" ) {
@@ -2834,6 +2862,7 @@ pub fn build_session_options(
2834
2862
crate_types,
2835
2863
optimize : opt_level,
2836
2864
debuginfo,
2865
+ debuginfo_compression,
2837
2866
lint_opts,
2838
2867
lint_cap,
2839
2868
describe_lints,
@@ -3119,11 +3148,11 @@ impl PpMode {
3119
3148
/// how the hash should be calculated when adding a new command-line argument.
3120
3149
pub ( crate ) mod dep_tracking {
3121
3150
use super :: {
3122
- BranchProtection , CFGuard , CFProtection , CrateType , DebugInfo , ErrorOutputType ,
3123
- InstrumentCoverage , InstrumentXRay , LdImpl , LinkerPluginLto , LocationDetail , LtoCli ,
3124
- OomStrategy , OptLevel , OutFileName , OutputType , OutputTypes , Passes , ResolveDocLinks ,
3125
- SourceFileHashAlgorithm , SplitDwarfKind , SwitchWithOptPath , SymbolManglingVersion ,
3126
- TraitSolver , TrimmedDefPaths ,
3151
+ BranchProtection , CFGuard , CFProtection , CrateType , DebugInfo , DebugInfoCompression ,
3152
+ ErrorOutputType , InstrumentCoverage , InstrumentXRay , LdImpl , LinkerPluginLto ,
3153
+ LocationDetail , LtoCli , OomStrategy , OptLevel , OutFileName , OutputType , OutputTypes ,
3154
+ Passes , ResolveDocLinks , SourceFileHashAlgorithm , SplitDwarfKind , SwitchWithOptPath ,
3155
+ SymbolManglingVersion , TraitSolver , TrimmedDefPaths ,
3127
3156
} ;
3128
3157
use crate :: lint;
3129
3158
use crate :: options:: WasiExecModel ;
@@ -3201,6 +3230,7 @@ pub(crate) mod dep_tracking {
3201
3230
OptLevel ,
3202
3231
LtoCli ,
3203
3232
DebugInfo ,
3233
+ DebugInfoCompression ,
3204
3234
UnstableFeatures ,
3205
3235
NativeLib ,
3206
3236
NativeLibKind ,
0 commit comments