@@ -1526,7 +1526,7 @@ static void CollectARMPACBTIOptions(const ToolChain &TC, const ArgList &Args,
1526
1526
1527
1527
CmdArgs.push_back (
1528
1528
Args.MakeArgString (Twine (" -msign-return-address=" ) + Scope));
1529
- if (! Scope. equals ( " none" ) )
1529
+ if (Scope != " none" )
1530
1530
CmdArgs.push_back (
1531
1531
Args.MakeArgString (Twine (" -msign-return-address-key=" ) + Key));
1532
1532
if (BranchProtectionPAuthLR)
@@ -1719,10 +1719,9 @@ void Clang::AddAArch64TargetArgs(const ArgList &Args,
1719
1719
if (Arg *A = Args.getLastArg (options::OPT_msve_vector_bits_EQ)) {
1720
1720
StringRef Val = A->getValue ();
1721
1721
const Driver &D = getToolChain ().getDriver ();
1722
- if (Val.equals (" 128" ) || Val.equals (" 256" ) || Val.equals (" 512" ) ||
1723
- Val.equals (" 1024" ) || Val.equals (" 2048" ) || Val.equals (" 128+" ) ||
1724
- Val.equals (" 256+" ) || Val.equals (" 512+" ) || Val.equals (" 1024+" ) ||
1725
- Val.equals (" 2048+" )) {
1722
+ if (Val == " 128" || Val == " 256" || Val == " 512" || Val == " 1024" ||
1723
+ Val == " 2048" || Val == " 128+" || Val == " 256+" || Val == " 512+" ||
1724
+ Val == " 1024+" || Val == " 2048+" ) {
1726
1725
unsigned Bits = 0 ;
1727
1726
if (!Val.consume_back (" +" )) {
1728
1727
bool Invalid = Val.getAsInteger (10 , Bits); (void )Invalid;
@@ -1736,7 +1735,7 @@ void Clang::AddAArch64TargetArgs(const ArgList &Args,
1736
1735
CmdArgs.push_back (
1737
1736
Args.MakeArgString (" -mvscale-min=" + llvm::Twine (Bits / 128 )));
1738
1737
// Silently drop requests for vector-length agnostic code as it's implied.
1739
- } else if (! Val. equals ( " scalable" ) )
1738
+ } else if (Val != " scalable" )
1740
1739
// Handle the unsupported values passed to msve-vector-bits.
1741
1740
D.Diag (diag::err_drv_unsupported_option_argument)
1742
1741
<< A->getSpelling () << Val;
@@ -2098,7 +2097,7 @@ void Clang::AddRISCVTargetArgs(const ArgList &Args,
2098
2097
// If the value is "zvl", use MinVLen from march. Otherwise, try to parse
2099
2098
// as integer as long as we have a MinVLen.
2100
2099
unsigned Bits = 0 ;
2101
- if (Val. equals ( " zvl" ) && MinVLen >= llvm::RISCV::RVVBitsPerBlock) {
2100
+ if (Val == " zvl" && MinVLen >= llvm::RISCV::RVVBitsPerBlock) {
2102
2101
Bits = MinVLen;
2103
2102
} else if (!Val.getAsInteger (10 , Bits)) {
2104
2103
// Only accept power of 2 values beteen RVVBitsPerBlock and 65536 that
@@ -2115,7 +2114,7 @@ void Clang::AddRISCVTargetArgs(const ArgList &Args,
2115
2114
Args.MakeArgString (" -mvscale-max=" + llvm::Twine (VScaleMin)));
2116
2115
CmdArgs.push_back (
2117
2116
Args.MakeArgString (" -mvscale-min=" + llvm::Twine (VScaleMin)));
2118
- } else if (! Val. equals ( " scalable" ) ) {
2117
+ } else if (Val != " scalable" ) {
2119
2118
// Handle the unsupported values passed to mrvv-vector-bits.
2120
2119
D.Diag (diag::err_drv_unsupported_option_argument)
2121
2120
<< A->getSpelling () << Val;
@@ -2865,13 +2864,13 @@ static void RenderFloatingPointOptions(const ToolChain &TC, const Driver &D,
2865
2864
case options::OPT_fcomplex_arithmetic_EQ: {
2866
2865
LangOptions::ComplexRangeKind RangeVal;
2867
2866
StringRef Val = A->getValue ();
2868
- if (Val. equals ( " full" ) )
2867
+ if (Val == " full" )
2869
2868
RangeVal = LangOptions::ComplexRangeKind::CX_Full;
2870
- else if (Val. equals ( " improved" ) )
2869
+ else if (Val == " improved" )
2871
2870
RangeVal = LangOptions::ComplexRangeKind::CX_Improved;
2872
- else if (Val. equals ( " promoted" ) )
2871
+ else if (Val == " promoted" )
2873
2872
RangeVal = LangOptions::ComplexRangeKind::CX_Promoted;
2874
- else if (Val. equals ( " basic" ) )
2873
+ else if (Val == " basic" )
2875
2874
RangeVal = LangOptions::ComplexRangeKind::CX_Basic;
2876
2875
else {
2877
2876
D.Diag (diag::err_drv_unsupported_option_argument)
@@ -2910,24 +2909,24 @@ static void RenderFloatingPointOptions(const ToolChain &TC, const Driver &D,
2910
2909
FPContract = " on" ;
2911
2910
2912
2911
StringRef Val = A->getValue ();
2913
- if (OFastEnabled && ! Val. equals ( " fast" ) ) {
2914
- // Only -ffp-model=fast is compatible with OFast, ignore.
2912
+ if (OFastEnabled && Val != " fast" ) {
2913
+ // Only -ffp-model=fast is compatible with OFast, ignore.
2915
2914
D.Diag (clang::diag::warn_drv_overriding_option)
2916
2915
<< Args.MakeArgString (" -ffp-model=" + Val) << " -Ofast" ;
2917
2916
break ;
2918
2917
}
2919
2918
StrictFPModel = false ;
2920
- if (!FPModel.empty () && ! FPModel. equals ( Val) )
2919
+ if (!FPModel.empty () && FPModel != Val)
2921
2920
D.Diag (clang::diag::warn_drv_overriding_option)
2922
2921
<< Args.MakeArgString (" -ffp-model=" + FPModel)
2923
2922
<< Args.MakeArgString (" -ffp-model=" + Val);
2924
- if (Val. equals ( " fast" ) ) {
2923
+ if (Val == " fast" ) {
2925
2924
FPModel = Val;
2926
2925
applyFastMath ();
2927
- } else if (Val. equals ( " precise" ) ) {
2926
+ } else if (Val == " precise" ) {
2928
2927
FPModel = Val;
2929
2928
FPContract = " on" ;
2930
- } else if (Val. equals ( " strict" ) ) {
2929
+ } else if (Val == " strict" ) {
2931
2930
StrictFPModel = true ;
2932
2931
FPExceptionBehavior = " strict" ;
2933
2932
FPModel = Val;
@@ -2957,7 +2956,7 @@ static void RenderFloatingPointOptions(const ToolChain &TC, const Driver &D,
2957
2956
case options::OPT_fno_signed_zeros: SignedZeros = false ; break ;
2958
2957
case options::OPT_ftrapping_math:
2959
2958
if (!TrappingMathPresent && !FPExceptionBehavior.empty () &&
2960
- ! FPExceptionBehavior. equals ( " strict" ) )
2959
+ FPExceptionBehavior != " strict" )
2961
2960
// Warn that previous value of option is overridden.
2962
2961
D.Diag (clang::diag::warn_drv_overriding_option)
2963
2962
<< Args.MakeArgString (" -ffp-exception-behavior=" +
@@ -2969,7 +2968,7 @@ static void RenderFloatingPointOptions(const ToolChain &TC, const Driver &D,
2969
2968
break ;
2970
2969
case options::OPT_fno_trapping_math:
2971
2970
if (!TrappingMathPresent && !FPExceptionBehavior.empty () &&
2972
- ! FPExceptionBehavior. equals ( " ignore" ) )
2971
+ FPExceptionBehavior != " ignore" )
2973
2972
// Warn that previous value of option is overridden.
2974
2973
D.Diag (clang::diag::warn_drv_overriding_option)
2975
2974
<< Args.MakeArgString (" -ffp-exception-behavior=" +
@@ -3008,8 +3007,8 @@ static void RenderFloatingPointOptions(const ToolChain &TC, const Driver &D,
3008
3007
// Validate and pass through -ffp-contract option.
3009
3008
case options::OPT_ffp_contract: {
3010
3009
StringRef Val = A->getValue ();
3011
- if (Val. equals ( " fast" ) || Val. equals ( " on" ) || Val. equals ( " off" ) ||
3012
- Val. equals ( " fast-honor-pragmas" ) ) {
3010
+ if (Val == " fast" || Val == " on" || Val == " off" ||
3011
+ Val == " fast-honor-pragmas" ) {
3013
3012
FPContract = Val;
3014
3013
LastSeenFfpContractOption = Val;
3015
3014
} else
@@ -3022,16 +3021,16 @@ static void RenderFloatingPointOptions(const ToolChain &TC, const Driver &D,
3022
3021
case options::OPT_ffp_exception_behavior_EQ: {
3023
3022
StringRef Val = A->getValue ();
3024
3023
if (!TrappingMathPresent && !FPExceptionBehavior.empty () &&
3025
- ! FPExceptionBehavior. equals ( Val) )
3024
+ FPExceptionBehavior != Val)
3026
3025
// Warn that previous value of option is overridden.
3027
3026
D.Diag (clang::diag::warn_drv_overriding_option)
3028
3027
<< Args.MakeArgString (" -ffp-exception-behavior=" +
3029
3028
FPExceptionBehavior)
3030
3029
<< Args.MakeArgString (" -ffp-exception-behavior=" + Val);
3031
3030
TrappingMath = TrappingMathPresent = false ;
3032
- if (Val. equals ( " ignore" ) || Val. equals ( " maytrap" ) )
3031
+ if (Val == " ignore" || Val == " maytrap" )
3033
3032
FPExceptionBehavior = Val;
3034
- else if (Val. equals ( " strict" ) ) {
3033
+ else if (Val == " strict" ) {
3035
3034
FPExceptionBehavior = Val;
3036
3035
TrappingMath = TrappingMathPresent = true ;
3037
3036
} else
@@ -3043,8 +3042,7 @@ static void RenderFloatingPointOptions(const ToolChain &TC, const Driver &D,
3043
3042
// Validate and pass through -ffp-eval-method option.
3044
3043
case options::OPT_ffp_eval_method_EQ: {
3045
3044
StringRef Val = A->getValue ();
3046
- if (Val.equals (" double" ) || Val.equals (" extended" ) ||
3047
- Val.equals (" source" ))
3045
+ if (Val == " double" || Val == " extended" || Val == " source" )
3048
3046
FPEvalMethod = Val;
3049
3047
else
3050
3048
D.Diag (diag::err_drv_unsupported_option_argument)
@@ -3056,18 +3054,18 @@ static void RenderFloatingPointOptions(const ToolChain &TC, const Driver &D,
3056
3054
StringRef Val = A->getValue ();
3057
3055
const llvm::Triple::ArchType Arch = TC.getArch ();
3058
3056
if (Arch == llvm::Triple::x86 || Arch == llvm::Triple::x86_64) {
3059
- if (Val. equals ( " standard" ) || Val. equals ( " fast" ) )
3057
+ if (Val == " standard" || Val == " fast" )
3060
3058
Float16ExcessPrecision = Val;
3061
3059
// To make it GCC compatible, allow the value of "16" which
3062
3060
// means disable excess precision, the same meaning than clang's
3063
3061
// equivalent value "none".
3064
- else if (Val. equals ( " 16" ) )
3062
+ else if (Val == " 16" )
3065
3063
Float16ExcessPrecision = " none" ;
3066
3064
else
3067
3065
D.Diag (diag::err_drv_unsupported_option_argument)
3068
3066
<< A->getSpelling () << Val;
3069
3067
} else {
3070
- if (!(Val. equals ( " standard" ) || Val. equals ( " fast" ) ))
3068
+ if (!(Val == " standard" || Val == " fast" ))
3071
3069
D.Diag (diag::err_drv_unsupported_option_argument)
3072
3070
<< A->getSpelling () << Val;
3073
3071
}
@@ -3149,7 +3147,7 @@ static void RenderFloatingPointOptions(const ToolChain &TC, const Driver &D,
3149
3147
// subsequent options conflict then emit warning diagnostic.
3150
3148
if (HonorINFs && HonorNaNs && !AssociativeMath && !ReciprocalMath &&
3151
3149
SignedZeros && TrappingMath && RoundingFPMath && !ApproxFunc &&
3152
- FPContract. equals ( " off" ) )
3150
+ FPContract == " off" )
3153
3151
// OK: Current Arg doesn't conflict with -ffp-model=strict
3154
3152
;
3155
3153
else {
@@ -3195,7 +3193,7 @@ static void RenderFloatingPointOptions(const ToolChain &TC, const Driver &D,
3195
3193
3196
3194
if (TrappingMath) {
3197
3195
// FP Exception Behavior is also set to strict
3198
- assert (FPExceptionBehavior. equals ( " strict" ) );
3196
+ assert (FPExceptionBehavior == " strict" );
3199
3197
}
3200
3198
3201
3199
// The default is IEEE.
@@ -3244,8 +3242,8 @@ static void RenderFloatingPointOptions(const ToolChain &TC, const Driver &D,
3244
3242
if (!HonorINFs && !HonorNaNs && !MathErrno && AssociativeMath && ApproxFunc &&
3245
3243
ReciprocalMath && !SignedZeros && !TrappingMath && !RoundingFPMath) {
3246
3244
CmdArgs.push_back (" -ffast-math" );
3247
- if (FPModel. equals ( " fast" ) ) {
3248
- if (FPContract. equals ( " fast" ) )
3245
+ if (FPModel == " fast" ) {
3246
+ if (FPContract == " fast" )
3249
3247
// All set, do nothing.
3250
3248
;
3251
3249
else if (FPContract.empty ())
0 commit comments