@@ -186,11 +186,6 @@ impl TestTarget {
186186 }
187187}
188188
189- pub enum GitRepo {
190- Rustc ,
191- Llvm ,
192- }
193-
194189/// Global configuration for the build system.
195190///
196191/// This structure transitively contains all configuration for the build system.
@@ -1167,34 +1162,29 @@ impl Build {
11671162 } )
11681163 }
11691164
1170- fn debuginfo_map_to ( & self , which : GitRepo , remap_scheme : RemapScheme ) -> Option < String > {
1165+ fn debuginfo_map_to ( & self , remap_scheme : RemapScheme ) -> Option < String > {
11711166 if !self . config . rust_remap_debuginfo {
11721167 return None ;
11731168 }
11741169
1175- match which {
1176- GitRepo :: Rustc => {
1177- let sha = self . rust_sha ( ) . unwrap_or ( & self . version ) ;
1178-
1179- match remap_scheme {
1180- RemapScheme :: Compiler => {
1181- // For compiler sources, remap via `/rustc-dev/{sha}` to allow
1182- // distinguishing between compiler sources vs library sources, since
1183- // `rustc-dev` dist component places them under
1184- // `$sysroot/lib/rustlib/rustc-src/rust` as opposed to `rust-src`'s
1185- // `$sysroot/lib/rustlib/src/rust`.
1186- //
1187- // Keep this scheme in sync with `rustc_metadata::rmeta::decoder`'s
1188- // `try_to_translate_virtual_to_real`.
1189- Some ( format ! ( "/rustc-dev/{sha}" ) )
1190- }
1191- RemapScheme :: NonCompiler => {
1192- // For non-compiler sources, use `/rustc/{sha}` remapping scheme.
1193- Some ( format ! ( "/rustc/{sha}" ) )
1194- }
1195- }
1170+ let sha = self . rust_sha ( ) . unwrap_or ( & self . version ) ;
1171+
1172+ match remap_scheme {
1173+ RemapScheme :: Compiler => {
1174+ // For compiler sources, remap via `/rustc-dev/{sha}` to allow
1175+ // distinguishing between compiler sources vs library sources, since
1176+ // `rustc-dev` dist component places them under
1177+ // `$sysroot/lib/rustlib/rustc-src/rust` as opposed to `rust-src`'s
1178+ // `$sysroot/lib/rustlib/src/rust`.
1179+ //
1180+ // Keep this scheme in sync with `rustc_metadata::rmeta::decoder`'s
1181+ // `try_to_translate_virtual_to_real`.
1182+ Some ( format ! ( "/rustc-dev/{sha}" ) )
1183+ }
1184+ RemapScheme :: NonCompiler => {
1185+ // For non-compiler sources, use `/rustc/{sha}` remapping scheme.
1186+ Some ( format ! ( "/rustc/{sha}" ) )
11961187 }
1197- GitRepo :: Llvm => Some ( String :: from ( "/rustc/llvm" ) ) ,
11981188 }
11991189 }
12001190
@@ -1237,12 +1227,7 @@ impl Build {
12371227 }
12381228
12391229 /// Returns extra C flags that `cc-rs` doesn't handle.
1240- fn cc_unhandled_cflags (
1241- & self ,
1242- target : TargetSelection ,
1243- which : GitRepo ,
1244- c : CLang ,
1245- ) -> Vec < String > {
1230+ fn cc_unhandled_cflags ( & self , target : TargetSelection , c : CLang ) -> Vec < String > {
12461231 let mut base = Vec :: new ( ) ;
12471232
12481233 // If we're compiling C++ on macOS then we add a flag indicating that
@@ -1259,16 +1244,6 @@ impl Build {
12591244 base. push ( "-fno-omit-frame-pointer" . into ( ) ) ;
12601245 }
12611246
1262- if let Some ( map_to) = self . debuginfo_map_to ( which, RemapScheme :: NonCompiler ) {
1263- let map = format ! ( "{}={}" , self . src. display( ) , map_to) ;
1264- let cc = self . cc_tool ( target) ;
1265- if cc. is_like_clang ( ) || cc. is_like_gnu ( ) {
1266- base. push ( format ! ( "-fdebug-prefix-map={map}" ) ) ;
1267- } else if cc. is_like_clang_cl ( ) {
1268- base. push ( "-Xclang" . into ( ) ) ;
1269- base. push ( format ! ( "-fdebug-prefix-map={map}" ) ) ;
1270- }
1271- }
12721247 base
12731248 }
12741249
0 commit comments