@@ -381,6 +381,24 @@ pub enum DebugInfo {
381381 Full ,
382382}
383383
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+
384402/// Split debug-information is enabled by `-C split-debuginfo`, this enum is only used if split
385403/// debug-information is enabled (in either `Packed` or `Unpacked` modes), and the platform
386404/// uses DWARF for debug-information.
@@ -1015,6 +1033,7 @@ impl Default for Options {
10151033 crate_types : Vec :: new ( ) ,
10161034 optimize : OptLevel :: No ,
10171035 debuginfo : DebugInfo :: None ,
1036+ debuginfo_compression : DebugInfoCompression :: None ,
10181037 lint_opts : Vec :: new ( ) ,
10191038 lint_cap : None ,
10201039 describe_lints : false ,
@@ -2277,6 +2296,13 @@ fn select_debuginfo(matches: &getopts::Matches, cg: &CodegenOptions) -> DebugInf
22772296 if max_g > max_c { DebugInfo :: Full } else { cg. debuginfo }
22782297}
22792298
2299+ fn select_debuginfo_compression (
2300+ _handler : & EarlyErrorHandler ,
2301+ unstable_opts : & UnstableOptions ,
2302+ ) -> DebugInfoCompression {
2303+ unstable_opts. debuginfo_compression
2304+ }
2305+
22802306pub ( crate ) fn parse_assert_incr_state (
22812307 handler : & EarlyErrorHandler ,
22822308 opt_assertion : & Option < String > ,
@@ -2752,6 +2778,8 @@ pub fn build_session_options(
27522778 // for more details.
27532779 let debug_assertions = cg. debug_assertions . unwrap_or ( opt_level == OptLevel :: No ) ;
27542780 let debuginfo = select_debuginfo ( matches, & cg) ;
2781+ let debuginfo_compression: DebugInfoCompression =
2782+ select_debuginfo_compression ( handler, & unstable_opts) ;
27552783
27562784 let mut search_paths = vec ! [ ] ;
27572785 for s in & matches. opt_strs ( "L" ) {
@@ -2828,6 +2856,7 @@ pub fn build_session_options(
28282856 crate_types,
28292857 optimize : opt_level,
28302858 debuginfo,
2859+ debuginfo_compression,
28312860 lint_opts,
28322861 lint_cap,
28332862 describe_lints,
@@ -3113,11 +3142,11 @@ impl PpMode {
31133142/// how the hash should be calculated when adding a new command-line argument.
31143143pub ( crate ) mod dep_tracking {
31153144 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 ,
31213150 } ;
31223151 use crate :: lint;
31233152 use crate :: options:: WasiExecModel ;
@@ -3195,6 +3224,7 @@ pub(crate) mod dep_tracking {
31953224 OptLevel ,
31963225 LtoCli ,
31973226 DebugInfo ,
3227+ DebugInfoCompression ,
31983228 UnstableFeatures ,
31993229 NativeLib ,
32003230 NativeLibKind ,
0 commit comments