ART: Fix tidy bugprone-macro-parentheses

Add parens where necessary, add NOLINT for the cases where it's wrong.

Bug: 32619234
Test: WITH_TIDY=1 mmma art
Change-Id: If56ce51c078e9adf26b9469a01c95a857aac66a4
diff --git a/libartbase/base/bit_struct.h b/libartbase/base/bit_struct.h
index 9814fd4..292eca0 100644
--- a/libartbase/base/bit_struct.h
+++ b/libartbase/base/bit_struct.h
@@ -274,13 +274,13 @@
 // If a standard-layout union contains several standard-layout structs that share a common
 // initial sequence ... it is permitted to inspect the common initial sequence of any of
 // standard-layout struct members.
-#define BITSTRUCT_DEFINE_START(name, bitwidth)                                 \
-    union name {                                                               \
-      art::detail::DefineBitStructSize<(bitwidth)> _;                          \
-      static constexpr size_t BitStructSizeOf() { return (bitwidth); }         \
-      name& operator=(const name& other) { _ = other._; return *this; }        \
-      name(const name& other) : _(other._) {}                                  \
-      name() = default;                                                        \
+#define BITSTRUCT_DEFINE_START(name, bitwidth)                                        \
+    union name {                                                         /* NOLINT */ \
+      art::detail::DefineBitStructSize<(bitwidth)> _;                                 \
+      static constexpr size_t BitStructSizeOf() { return (bitwidth); }                \
+      name& operator=(const name& other) { _ = other._; return *this; }  /* NOLINT */ \
+      name(const name& other) : _(other._) {}                                         \
+      name() = default;                                                               \
       ~name() = default;
 
 // End the definition of a bitstruct, and insert a sanity check
diff --git a/libartbase/base/membarrier.cc b/libartbase/base/membarrier.cc
index 490dbf3..def949e 100644
--- a/libartbase/base/membarrier.cc
+++ b/libartbase/base/membarrier.cc
@@ -29,7 +29,7 @@
 #include <linux/membarrier.h>
 
 #define CHECK_MEMBARRIER_CMD(art_value, membarrier_value) \
-  static_assert(static_cast<int>(art_value) == membarrier_value, "Bad value for " # art_value)
+  static_assert(static_cast<int>(art_value) == (membarrier_value), "Bad value for " # art_value)
 CHECK_MEMBARRIER_CMD(art::MembarrierCommand::kQuery, MEMBARRIER_CMD_QUERY);
 CHECK_MEMBARRIER_CMD(art::MembarrierCommand::kGlobal, MEMBARRIER_CMD_SHARED);
 CHECK_MEMBARRIER_CMD(art::MembarrierCommand::kPrivateExpedited, MEMBARRIER_CMD_PRIVATE_EXPEDITED);
diff --git a/runtime/interpreter/interpreter_common.cc b/runtime/interpreter/interpreter_common.cc
index b170232..cb91953 100644
--- a/runtime/interpreter/interpreter_common.cc
+++ b/runtime/interpreter/interpreter_common.cc
@@ -1071,7 +1071,7 @@
   return true;
 
 #define COLLECT_REFERENCE_ARRAY(T, Type)                                \
-  Handle<mirror::ObjectArray<T>> array =                                \
+  Handle<mirror::ObjectArray<T>> array =                   /* NOLINT */ \
       hs.NewHandle(mirror::ObjectArray<T>::Alloc(self,                  \
                                                  array_type,            \
                                                  array_length));        \
diff --git a/tools/ti-fast/tifast.cc b/tools/ti-fast/tifast.cc
index 00ef656..d02e549 100644
--- a/tools/ti-fast/tifast.cc
+++ b/tools/ti-fast/tifast.cc
@@ -574,7 +574,7 @@
 
 static std::string EventToName(jvmtiEvent desired_event) {
 #define CHECK_NAME(name, event, args, argnames) \
-  if (desired_event == event) { \
+  if (desired_event == (event)) { \
     return #name; \
   }
   FOR_ALL_SUPPORTED_EVENTS(CHECK_NAME);
diff --git a/tools/titrace/instruction_decoder.cc b/tools/titrace/instruction_decoder.cc
index 7f8b296..89904b3 100644
--- a/tools/titrace/instruction_decoder.cc
+++ b/tools/titrace/instruction_decoder.cc
@@ -484,7 +484,7 @@
    public:
     enum Opcode {
 #define MAKE_ENUM_DEFINITION(opcode, instruction_code, name, format, index, flags, extended_flags, verifier_flags) \
-      instruction_code = opcode,
+      instruction_code = opcode,  /* NOLINT */
 DEX_INSTRUCTION_LIST(MAKE_ENUM_DEFINITION)
 #undef MAKE_ENUM_DEFINITION
     };
diff --git a/tools/veridex/flow_analysis.cc b/tools/veridex/flow_analysis.cc
index e925e1d..1fca7e1 100644
--- a/tools/veridex/flow_analysis.cc
+++ b/tools/veridex/flow_analysis.cc
@@ -162,7 +162,7 @@
     case Instruction::IF_##cond##Z: { \
       RegisterValue val = GetRegister(instruction.VRegA()); \
       if (val.IsConstant()) { \
-        if (val.GetConstant() op 0) { \
+        if (val.GetConstant() op 0) {  /* NOLINT */ \
           return Instruction::kBranch; \
         } else { \
           return Instruction::kContinue; \