summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Stefano Cianciulli <scianciulli@google.com> 2023-10-26 14:21:00 +0000
committer Stefano Cianciulli <scianciulli@google.com> 2023-11-08 09:47:33 +0000
commita40e912ff7ccdb62c6f5248a606a821f09f39925 (patch)
tree6b3cc90aadca458f7315b40aa21c3dc8e42a9eb7
parentca7797045fad4c5bcb00cb81243fd0bc83229590 (diff)
Fix bugprone-macro-parentheses clang-tidy issues
Bug: 264654008 Test: m tidy-art Change-Id: Iaf26d972a6cbcf61f1f214f92aef39eb2a5ba4bf
-rw-r--r--runtime/jit/small_pattern_matcher.cc54
1 files changed, 27 insertions, 27 deletions
diff --git a/runtime/jit/small_pattern_matcher.cc b/runtime/jit/small_pattern_matcher.cc
index a439ae17cf..5dd116c560 100644
--- a/runtime/jit/small_pattern_matcher.cc
+++ b/runtime/jit/small_pattern_matcher.cc
@@ -99,7 +99,8 @@ static void ConstructorSetFieldObjectAt([[maybe_unused]] ArtMethod* method,
}
#define SWITCH_CASE(offset, func, type) \
- case offset: return reinterpret_cast<void*>(&func<offset, type>);
+ case offset: \
+ return reinterpret_cast<void*>(&func<offset, type>); // NOLINT [bugprone-macro-parentheses]
#define DO_SWITCH_OFFSET(offset, F, T) \
switch (offset) { \
@@ -123,34 +124,33 @@ static void ConstructorSetFieldObjectAt([[maybe_unused]] ArtMethod* method,
default: return nullptr; \
}
-#define DO_SWITCH(offset, O, P, K) \
- DCHECK_EQ(is_object, K == Primitive::kPrimNot); \
- switch (K) { \
- case Primitive::kPrimBoolean: \
- DO_SWITCH_OFFSET(offset, P, uint8_t); \
- case Primitive::kPrimInt: \
- DO_SWITCH_OFFSET(offset, P, int32_t); \
- case Primitive::kPrimLong: \
- DO_SWITCH_OFFSET(offset, P, int64_t); \
- case Primitive::kPrimNot: \
+#define DO_SWITCH(offset, O, P, K) \
+ DCHECK_EQ(is_object, (K) == Primitive::kPrimNot); \
+ switch (K) { \
+ case Primitive::kPrimBoolean: \
+ DO_SWITCH_OFFSET(offset, P, uint8_t); \
+ case Primitive::kPrimInt: \
+ DO_SWITCH_OFFSET(offset, P, int32_t); \
+ case Primitive::kPrimLong: \
+ DO_SWITCH_OFFSET(offset, P, int64_t); \
+ case Primitive::kPrimNot: \
DO_SWITCH_OFFSET(offset, O, mirror::Object*); \
- case Primitive::kPrimFloat: \
- if (kRuntimeISA == InstructionSet::kArm64) { \
- DO_SWITCH_OFFSET(offset, P, float); \
- } else { \
- return nullptr; \
- } \
- case Primitive::kPrimDouble: \
- if (kRuntimeISA == InstructionSet::kArm64) { \
- DO_SWITCH_OFFSET(offset, P, double); \
- } else { \
- return nullptr; \
- } \
- default: \
- return nullptr; \
+ case Primitive::kPrimFloat: \
+ if (kRuntimeISA == InstructionSet::kArm64) { \
+ DO_SWITCH_OFFSET(offset, P, float); \
+ } else { \
+ return nullptr; \
+ } \
+ case Primitive::kPrimDouble: \
+ if (kRuntimeISA == InstructionSet::kArm64) { \
+ DO_SWITCH_OFFSET(offset, P, double); \
+ } else { \
+ return nullptr; \
+ } \
+ default: \
+ return nullptr; \
}
-
const void* SmallPatternMatcher::TryMatch(ArtMethod* method) REQUIRES_SHARED(Locks::mutator_lock_) {
CodeItemDataAccessor accessor(*method->GetDexFile(), method->GetCodeItem());
@@ -371,7 +371,7 @@ const void* SmallPatternMatcher::TryMatch(ArtMethod* method) REQUIRES_SHARED(Loc
}
offset = field->GetOffset().Int32Value();
if (is_static) {
- // We substract the start of reference fields to share more stubs.
+ // We subtract the start of reference fields to share more stubs.
MemberOffset first_field_offset =
field->GetDeclaringClass()->GetFirstReferenceStaticFieldOffset(kRuntimePointerSize);
offset = offset - first_field_offset.Int32Value();