@@ -1085,6 +1085,34 @@ impl ToJson for CodeModel {
10851085 }
10861086}
10871087
1088+ #[ derive( Clone , Copy , PartialEq , Hash , Debug ) ]
1089+ pub enum FloatAbi {
1090+ Soft ,
1091+ Hard ,
1092+ }
1093+
1094+ impl FromStr for FloatAbi {
1095+ type Err = ( ) ;
1096+
1097+ fn from_str ( s : & str ) -> Result < FloatAbi , ( ) > {
1098+ Ok ( match s {
1099+ "soft" => FloatAbi :: Soft ,
1100+ "hard" => FloatAbi :: Hard ,
1101+ _ => return Err ( ( ) ) ,
1102+ } )
1103+ }
1104+ }
1105+
1106+ impl ToJson for FloatAbi {
1107+ fn to_json ( & self ) -> Json {
1108+ match * self {
1109+ FloatAbi :: Soft => "soft" ,
1110+ FloatAbi :: Hard => "hard" ,
1111+ }
1112+ . to_json ( )
1113+ }
1114+ }
1115+
10881116#[ derive( Clone , Copy , PartialEq , Hash , Debug ) ]
10891117pub enum TlsModel {
10901118 GeneralDynamic ,
@@ -2150,6 +2178,8 @@ pub struct TargetOptions {
21502178 pub env : StaticCow < str > ,
21512179 /// ABI name to distinguish multiple ABIs on the same OS and architecture. For instance, `"eabi"`
21522180 /// or `"eabihf"`. Defaults to "".
2181+ /// This field is *not* forwarded directly to LLVM; its primary purpose is `cfg(target_abi)`.
2182+ /// However, parts of the backend do check this field for specific values to enable special behavior.
21532183 pub abi : StaticCow < str > ,
21542184 /// Vendor name to use for conditional compilation (`target_vendor`). Defaults to "unknown".
21552185 pub vendor : StaticCow < str > ,
@@ -2446,8 +2476,13 @@ pub struct TargetOptions {
24462476 pub llvm_mcount_intrinsic : Option < StaticCow < str > > ,
24472477
24482478 /// LLVM ABI name, corresponds to the '-mabi' parameter available in multilib C compilers
2479+ /// and the `-target-abi` flag in llc. In the LLVM API this is `MCOptions.ABIName`.
24492480 pub llvm_abiname : StaticCow < str > ,
24502481
2482+ /// Corresponds to `-mfloat-abi` parameter in clang/GCC and the `-float-abi` flag in llc.
2483+ /// In the LLVM ABI this is `FloatABIType`.
2484+ pub llvm_floatabi : Option < FloatAbi > ,
2485+
24512486 /// Whether or not RelaxElfRelocation flag will be passed to the linker
24522487 pub relax_elf_relocations : bool ,
24532488
@@ -2719,6 +2754,7 @@ impl Default for TargetOptions {
27192754 mcount : "mcount" . into ( ) ,
27202755 llvm_mcount_intrinsic : None ,
27212756 llvm_abiname : "" . into ( ) ,
2757+ llvm_floatabi : None ,
27222758 relax_elf_relocations : false ,
27232759 llvm_args : cvs ! [ ] ,
27242760 use_ctors_section : false ,
0 commit comments