File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
compiler/rustc_target/src/spec Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -349,6 +349,24 @@ impl LinkerFlavor {
349349 pub fn is_gnu ( self ) -> bool {
350350 matches ! ( self , LinkerFlavor :: Gnu ( ..) )
351351 }
352+
353+ /// Returns whether the flavor uses the `lld` linker.
354+ pub fn uses_lld ( self ) -> bool {
355+ // Exhaustive match in case new flavors are added in the future.
356+ match self {
357+ LinkerFlavor :: Gnu ( _, Lld :: Yes )
358+ | LinkerFlavor :: Darwin ( _, Lld :: Yes )
359+ | LinkerFlavor :: WasmLld ( ..)
360+ | LinkerFlavor :: EmCc
361+ | LinkerFlavor :: Msvc ( Lld :: Yes ) => true ,
362+ LinkerFlavor :: Gnu ( ..)
363+ | LinkerFlavor :: Darwin ( ..)
364+ | LinkerFlavor :: Msvc ( _)
365+ | LinkerFlavor :: Unix ( _)
366+ | LinkerFlavor :: Bpf
367+ | LinkerFlavor :: Ptx => false ,
368+ }
369+ }
352370}
353371
354372macro_rules! linker_flavor_cli_impls {
You can’t perform that action at this time.
0 commit comments