@@ -1977,19 +1977,24 @@ impl Config {
19771977 . unwrap_or ( self . profiler )
19781978 }
19791979
1980- pub fn codegen_backends ( & self , target : TargetSelection ) -> & [ CodegenBackendKind ] {
1980+ /// Returns codegen backends that should be:
1981+ /// - Built and added to the sysroot when we build the compiler.
1982+ /// - Distributed when `x dist` is executed (if the codegen backend has a dist step).
1983+ pub fn enabled_codegen_backends ( & self , target : TargetSelection ) -> & [ CodegenBackendKind ] {
19811984 self . target_config
19821985 . get ( & target)
19831986 . and_then ( |cfg| cfg. codegen_backends . as_deref ( ) )
19841987 . unwrap_or ( & self . rust_codegen_backends )
19851988 }
19861989
1987- pub fn jemalloc ( & self , target : TargetSelection ) -> bool {
1988- self . target_config . get ( & target) . and_then ( |cfg| cfg. jemalloc ) . unwrap_or ( self . jemalloc )
1990+ /// Returns the codegen backend that should be configured as the *default* codegen backend
1991+ /// for a rustc compiled by bootstrap.
1992+ pub fn default_codegen_backend ( & self , target : TargetSelection ) -> Option < CodegenBackendKind > {
1993+ self . enabled_codegen_backends ( target) . first ( ) . cloned ( )
19891994 }
19901995
1991- pub fn default_codegen_backend ( & self , target : TargetSelection ) -> Option < CodegenBackendKind > {
1992- self . codegen_backends ( target) . first ( ) . cloned ( )
1996+ pub fn jemalloc ( & self , target : TargetSelection ) -> bool {
1997+ self . target_config . get ( & target) . and_then ( |cfg| cfg . jemalloc ) . unwrap_or ( self . jemalloc )
19931998 }
19941999
19952000 pub fn rpath_enabled ( & self , target : TargetSelection ) -> bool {
@@ -2004,7 +2009,7 @@ impl Config {
20042009 }
20052010
20062011 pub fn llvm_enabled ( & self , target : TargetSelection ) -> bool {
2007- self . codegen_backends ( target) . contains ( & CodegenBackendKind :: Llvm )
2012+ self . enabled_codegen_backends ( target) . contains ( & CodegenBackendKind :: Llvm )
20082013 }
20092014
20102015 pub fn llvm_libunwind ( & self , target : TargetSelection ) -> LlvmLibunwind {
0 commit comments