diff options
author | Stefano Cianciulli <scianciulli@google.com> | 2024-05-08 15:35:51 +0000 |
---|---|---|
committer | Stefano Cianciulli <scianciulli@google.com> | 2024-05-15 10:18:49 +0000 |
commit | 7d8bf19c1f9a71820513ffd5fefa12c1c69b01dc (patch) | |
tree | 03cd6d06f515e59d68af1094ad7d01468c7287ed | |
parent | 10ba643ea94b84c409cd4e44c3b8c66861f9b873 (diff) | |
download | art-7d8bf19c1f9a71820513ffd5fefa12c1c69b01dc.tar.gz |
Fix bugprone-macro-parentheses clang-tidy issues
Bug: 264654008
Test: m tidy-art
Change-Id: I6a96bee1510449760634dbef5c1fac21a7e1c80e
-rw-r--r-- | artd/artd.cc | 8 | ||||
-rw-r--r-- | compiler/optimizing/intrinsics_arm64.cc | 41 | ||||
-rw-r--r-- | compiler/optimizing/intrinsics_arm_vixl.cc | 40 | ||||
-rw-r--r-- | compiler/optimizing/intrinsics_riscv64.cc | 41 | ||||
-rw-r--r-- | compiler/optimizing/intrinsics_x86.cc | 43 | ||||
-rw-r--r-- | compiler/optimizing/intrinsics_x86_64.cc | 41 |
6 files changed, 104 insertions, 110 deletions
diff --git a/artd/artd.cc b/artd/artd.cc index a09d1365d3..d87588bbc9 100644 --- a/artd/artd.cc +++ b/artd/artd.cc @@ -487,19 +487,19 @@ std::ostream& operator<<(std::ostream& os, const FdLogger& fd_logger) { } // namespace #define RETURN_FATAL_IF_PRE_REBOOT(options) \ - if (options.is_pre_reboot) { \ + if ((options).is_pre_reboot) { \ return Fatal("This method is not supported in Pre-reboot Dexopt mode"); \ } #define RETURN_FATAL_IF_NOT_PRE_REBOOT(options) \ - if (!options.is_pre_reboot) { \ + if (!(options).is_pre_reboot) { \ return Fatal("This method is only supported in Pre-reboot Dexopt mode"); \ } #define RETURN_FATAL_IF_ARG_IS_PRE_REBOOT_IMPL(expected, arg, log_name) \ { \ auto&& __return_fatal_tmp = PreRebootFlag(arg); \ - if (expected != __return_fatal_tmp) { \ + if ((expected) != __return_fatal_tmp) { \ return Fatal(ART_FORMAT("Expected flag 'isPreReboot' in argument '{}' to be {}, got {}", \ log_name, \ expected, \ @@ -508,7 +508,7 @@ std::ostream& operator<<(std::ostream& os, const FdLogger& fd_logger) { } #define RETURN_FATAL_IF_PRE_REBOOT_MISMATCH(options, arg, log_name) \ - RETURN_FATAL_IF_ARG_IS_PRE_REBOOT_IMPL(options.is_pre_reboot, arg, log_name) + RETURN_FATAL_IF_ARG_IS_PRE_REBOOT_IMPL((options).is_pre_reboot, arg, log_name) #define RETURN_FATAL_IF_ARG_IS_PRE_REBOOT(arg, log_name) \ RETURN_FATAL_IF_ARG_IS_PRE_REBOOT_IMPL(false, arg, log_name) diff --git a/compiler/optimizing/intrinsics_arm64.cc b/compiler/optimizing/intrinsics_arm64.cc index 8ed43b1d3e..d8c7a6531e 100644 --- a/compiler/optimizing/intrinsics_arm64.cc +++ b/compiler/optimizing/intrinsics_arm64.cc @@ -3445,27 +3445,26 @@ void IntrinsicCodeGeneratorARM64::VisitDoubleIsInfinite(HInvoke* invoke) { GenIsInfinite(invoke->GetLocations(), /* is64bit= */ true, GetVIXLAssembler()); } -#define VISIT_INTRINSIC(name, low, high, type, start_index) \ - void IntrinsicLocationsBuilderARM64::Visit ##name ##ValueOf(HInvoke* invoke) { \ - InvokeRuntimeCallingConvention calling_convention; \ - IntrinsicVisitor::ComputeValueOfLocations( \ - invoke, \ - codegen_, \ - low, \ - high - low + 1, \ - calling_convention.GetReturnLocation(DataType::Type::kReference), \ - Location::RegisterLocation(calling_convention.GetRegisterAt(0).GetCode())); \ - } \ - void IntrinsicCodeGeneratorARM64::Visit ##name ##ValueOf(HInvoke* invoke) { \ - IntrinsicVisitor::ValueOfInfo info = \ - IntrinsicVisitor::ComputeValueOfInfo( \ - invoke, \ - codegen_->GetCompilerOptions(), \ - WellKnownClasses::java_lang_ ##name ##_value, \ - low, \ - high - low + 1, \ - start_index); \ - HandleValueOf(invoke, info, type); \ +#define VISIT_INTRINSIC(name, low, high, type, start_index) \ + void IntrinsicLocationsBuilderARM64::Visit##name##ValueOf(HInvoke* invoke) { \ + InvokeRuntimeCallingConvention calling_convention; \ + IntrinsicVisitor::ComputeValueOfLocations( \ + invoke, \ + codegen_, \ + low, \ + (high) - (low) + 1, \ + calling_convention.GetReturnLocation(DataType::Type::kReference), \ + Location::RegisterLocation(calling_convention.GetRegisterAt(0).GetCode())); \ + } \ + void IntrinsicCodeGeneratorARM64::Visit##name##ValueOf(HInvoke* invoke) { \ + IntrinsicVisitor::ValueOfInfo info = \ + IntrinsicVisitor::ComputeValueOfInfo(invoke, \ + codegen_->GetCompilerOptions(), \ + WellKnownClasses::java_lang_##name##_value, \ + low, \ + (high) - (low) + 1, \ + start_index); \ + HandleValueOf(invoke, info, type); \ } BOXED_TYPES(VISIT_INTRINSIC) #undef VISIT_INTRINSIC diff --git a/compiler/optimizing/intrinsics_arm_vixl.cc b/compiler/optimizing/intrinsics_arm_vixl.cc index 25e35540ab..ecc9732816 100644 --- a/compiler/optimizing/intrinsics_arm_vixl.cc +++ b/compiler/optimizing/intrinsics_arm_vixl.cc @@ -2305,27 +2305,25 @@ void IntrinsicCodeGeneratorARMVIXL::VisitMathFloor(HInvoke* invoke) { __ Vrintm(F64, OutputDRegister(invoke), InputDRegisterAt(invoke, 0)); } -#define VISIT_INTRINSIC(name, low, high, type, start_index) \ - void IntrinsicLocationsBuilderARMVIXL::Visit ##name ##ValueOf(HInvoke* invoke) { \ - InvokeRuntimeCallingConventionARMVIXL calling_convention; \ - IntrinsicVisitor::ComputeValueOfLocations( \ - invoke, \ - codegen_, \ - low, \ - high - low + 1, \ - LocationFrom(r0), \ - LocationFrom(calling_convention.GetRegisterAt(0))); \ - } \ - void IntrinsicCodeGeneratorARMVIXL::Visit ##name ##ValueOf(HInvoke* invoke) { \ - IntrinsicVisitor::ValueOfInfo info = \ - IntrinsicVisitor::ComputeValueOfInfo( \ - invoke, \ - codegen_->GetCompilerOptions(), \ - WellKnownClasses::java_lang_ ##name ##_value, \ - low, \ - high - low + 1, \ - start_index); \ - HandleValueOf(invoke, info, type); \ +#define VISIT_INTRINSIC(name, low, high, type, start_index) \ + void IntrinsicLocationsBuilderARMVIXL::Visit##name##ValueOf(HInvoke* invoke) { \ + InvokeRuntimeCallingConventionARMVIXL calling_convention; \ + IntrinsicVisitor::ComputeValueOfLocations(invoke, \ + codegen_, \ + low, \ + (high) - (low) + 1, \ + LocationFrom(r0), \ + LocationFrom(calling_convention.GetRegisterAt(0))); \ + } \ + void IntrinsicCodeGeneratorARMVIXL::Visit##name##ValueOf(HInvoke* invoke) { \ + IntrinsicVisitor::ValueOfInfo info = \ + IntrinsicVisitor::ComputeValueOfInfo(invoke, \ + codegen_->GetCompilerOptions(), \ + WellKnownClasses::java_lang_##name##_value, \ + low, \ + (high) - (low) + 1, \ + start_index); \ + HandleValueOf(invoke, info, type); \ } BOXED_TYPES(VISIT_INTRINSIC) #undef VISIT_INTRINSIC diff --git a/compiler/optimizing/intrinsics_riscv64.cc b/compiler/optimizing/intrinsics_riscv64.cc index 6717ec463b..0a9ac872db 100644 --- a/compiler/optimizing/intrinsics_riscv64.cc +++ b/compiler/optimizing/intrinsics_riscv64.cc @@ -636,27 +636,26 @@ void IntrinsicCodeGeneratorRISCV64::VisitLongDivideUnsigned(HInvoke* invoke) { GenerateDivideUnsigned(invoke, codegen_); } -#define VISIT_INTRINSIC(name, low, high, type, start_index) \ - void IntrinsicLocationsBuilderRISCV64::Visit ##name ##ValueOf(HInvoke* invoke) { \ - InvokeRuntimeCallingConvention calling_convention; \ - IntrinsicVisitor::ComputeValueOfLocations( \ - invoke, \ - codegen_, \ - low, \ - high - low + 1, \ - calling_convention.GetReturnLocation(DataType::Type::kReference), \ - Location::RegisterLocation(calling_convention.GetRegisterAt(0))); \ - } \ - void IntrinsicCodeGeneratorRISCV64::Visit ##name ##ValueOf(HInvoke* invoke) { \ - IntrinsicVisitor::ValueOfInfo info = \ - IntrinsicVisitor::ComputeValueOfInfo( \ - invoke, \ - codegen_->GetCompilerOptions(), \ - WellKnownClasses::java_lang_ ##name ##_value, \ - low, \ - high - low + 1, \ - start_index); \ - HandleValueOf(invoke, info, type); \ +#define VISIT_INTRINSIC(name, low, high, type, start_index) \ + void IntrinsicLocationsBuilderRISCV64::Visit##name##ValueOf(HInvoke* invoke) { \ + InvokeRuntimeCallingConvention calling_convention; \ + IntrinsicVisitor::ComputeValueOfLocations( \ + invoke, \ + codegen_, \ + low, \ + (high) - (low) + 1, \ + calling_convention.GetReturnLocation(DataType::Type::kReference), \ + Location::RegisterLocation(calling_convention.GetRegisterAt(0))); \ + } \ + void IntrinsicCodeGeneratorRISCV64::Visit##name##ValueOf(HInvoke* invoke) { \ + IntrinsicVisitor::ValueOfInfo info = \ + IntrinsicVisitor::ComputeValueOfInfo(invoke, \ + codegen_->GetCompilerOptions(), \ + WellKnownClasses::java_lang_##name##_value, \ + low, \ + (high) - (low) + 1, \ + start_index); \ + HandleValueOf(invoke, info, type); \ } BOXED_TYPES(VISIT_INTRINSIC) #undef VISIT_INTRINSIC diff --git a/compiler/optimizing/intrinsics_x86.cc b/compiler/optimizing/intrinsics_x86.cc index 62efeb1d8c..63dd963a9f 100644 --- a/compiler/optimizing/intrinsics_x86.cc +++ b/compiler/optimizing/intrinsics_x86.cc @@ -3380,28 +3380,27 @@ static void RequestBaseMethodAddressInRegister(HInvoke* invoke) { } } -#define VISIT_INTRINSIC(name, low, high, type, start_index) \ - void IntrinsicLocationsBuilderX86::Visit ##name ##ValueOf(HInvoke* invoke) { \ - InvokeRuntimeCallingConvention calling_convention; \ - IntrinsicVisitor::ComputeValueOfLocations( \ - invoke, \ - codegen_, \ - low, \ - high - low + 1, \ - Location::RegisterLocation(EAX), \ - Location::RegisterLocation(calling_convention.GetRegisterAt(0))); \ - RequestBaseMethodAddressInRegister(invoke); \ - } \ - void IntrinsicCodeGeneratorX86::Visit ##name ##ValueOf(HInvoke* invoke) { \ - IntrinsicVisitor::ValueOfInfo info = \ - IntrinsicVisitor::ComputeValueOfInfo( \ - invoke, \ - codegen_->GetCompilerOptions(), \ - WellKnownClasses::java_lang_ ##name ##_value, \ - low, \ - high - low + 1, \ - start_index); \ - HandleValueOf(invoke, info, type); \ +#define VISIT_INTRINSIC(name, low, high, type, start_index) \ + void IntrinsicLocationsBuilderX86::Visit##name##ValueOf(HInvoke* invoke) { \ + InvokeRuntimeCallingConvention calling_convention; \ + IntrinsicVisitor::ComputeValueOfLocations( \ + invoke, \ + codegen_, \ + low, \ + (high) - (low) + 1, \ + Location::RegisterLocation(EAX), \ + Location::RegisterLocation(calling_convention.GetRegisterAt(0))); \ + RequestBaseMethodAddressInRegister(invoke); \ + } \ + void IntrinsicCodeGeneratorX86::Visit##name##ValueOf(HInvoke* invoke) { \ + IntrinsicVisitor::ValueOfInfo info = \ + IntrinsicVisitor::ComputeValueOfInfo(invoke, \ + codegen_->GetCompilerOptions(), \ + WellKnownClasses::java_lang_##name##_value, \ + low, \ + (high) - (low) + 1, \ + start_index); \ + HandleValueOf(invoke, info, type); \ } BOXED_TYPES(VISIT_INTRINSIC) #undef VISIT_INTRINSIC diff --git a/compiler/optimizing/intrinsics_x86_64.cc b/compiler/optimizing/intrinsics_x86_64.cc index b5ddaaa0b7..131460d605 100644 --- a/compiler/optimizing/intrinsics_x86_64.cc +++ b/compiler/optimizing/intrinsics_x86_64.cc @@ -3180,27 +3180,26 @@ void IntrinsicCodeGeneratorX86_64::VisitLongNumberOfTrailingZeros(HInvoke* invok GenTrailingZeros(GetAssembler(), codegen_, invoke, /* is_long= */ true); } -#define VISIT_INTRINSIC(name, low, high, type, start_index) \ - void IntrinsicLocationsBuilderX86_64::Visit ##name ##ValueOf(HInvoke* invoke) { \ - InvokeRuntimeCallingConvention calling_convention; \ - IntrinsicVisitor::ComputeValueOfLocations( \ - invoke, \ - codegen_, \ - low, \ - high - low + 1, \ - Location::RegisterLocation(RAX), \ - Location::RegisterLocation(calling_convention.GetRegisterAt(0))); \ - } \ - void IntrinsicCodeGeneratorX86_64::Visit ##name ##ValueOf(HInvoke* invoke) { \ - IntrinsicVisitor::ValueOfInfo info = \ - IntrinsicVisitor::ComputeValueOfInfo( \ - invoke, \ - codegen_->GetCompilerOptions(), \ - WellKnownClasses::java_lang_ ##name ##_value, \ - low, \ - high - low + 1, \ - start_index); \ - HandleValueOf(invoke, info, type); \ +#define VISIT_INTRINSIC(name, low, high, type, start_index) \ + void IntrinsicLocationsBuilderX86_64::Visit##name##ValueOf(HInvoke* invoke) { \ + InvokeRuntimeCallingConvention calling_convention; \ + IntrinsicVisitor::ComputeValueOfLocations( \ + invoke, \ + codegen_, \ + low, \ + (high) - (low) + 1, \ + Location::RegisterLocation(RAX), \ + Location::RegisterLocation(calling_convention.GetRegisterAt(0))); \ + } \ + void IntrinsicCodeGeneratorX86_64::Visit##name##ValueOf(HInvoke* invoke) { \ + IntrinsicVisitor::ValueOfInfo info = \ + IntrinsicVisitor::ComputeValueOfInfo(invoke, \ + codegen_->GetCompilerOptions(), \ + WellKnownClasses::java_lang_##name##_value, \ + low, \ + (high) - (low) + 1, \ + start_index); \ + HandleValueOf(invoke, info, type); \ } BOXED_TYPES(VISIT_INTRINSIC) #undef VISIT_INTRINSIC |