[llvm] c3cc09b - [AsmPrinter] Fix gcc -Wparentheses warning [NFC]

Mikael Holmen via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 17 23:38:05 PST 2024


Author: Mikael Holmen
Date: 2024-01-18T08:37:30+01:00
New Revision: c3cc09bdf8e83b86bd087e14b2dae34888422096

URL: https://github.com/llvm/llvm-project/commit/c3cc09bdf8e83b86bd087e14b2dae34888422096
DIFF: https://github.com/llvm/llvm-project/commit/c3cc09bdf8e83b86bd087e14b2dae34888422096.diff

LOG: [AsmPrinter] Fix gcc -Wparentheses warning [NFC]

Without this gcc warned
 ../lib/CodeGen/AsmPrinter/DwarfDebug.cpp:3585:70: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
  3584 |            ((&Current == &AccelDebugNames) &&
       |            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  3585 |             (Unit.getUnitDie().getTag() != dwarf::DW_TAG_type_unit)) &&
       |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
  3586 |                "Kind is CU but TU is being processed.");
       |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 ../lib/CodeGen/AsmPrinter/DwarfDebug.cpp:3589:70: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
  3588 |            ((&Current == &AccelTypeUnitsDebugNames) &&
       |            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  3589 |             (Unit.getUnitDie().getTag() == dwarf::DW_TAG_type_unit)) &&
       |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
  3590 |                "Kind is TU but CU is being processed.");
       |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Added: 
    

Modified: 
    llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
index 1d9b3d5874756c..6b5ad62e083e3b 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@ -3580,13 +3580,13 @@ void DwarfDebug::addAccelNameImpl(
     break;
   case AccelTableKind::Dwarf: {
     DWARF5AccelTable &Current = getCurrentDWARF5AccelTable();
-    assert((&Current == &AccelTypeUnitsDebugNames) ||
-           ((&Current == &AccelDebugNames) &&
-            (Unit.getUnitDie().getTag() != dwarf::DW_TAG_type_unit)) &&
+    assert(((&Current == &AccelTypeUnitsDebugNames) ||
+            ((&Current == &AccelDebugNames) &&
+             (Unit.getUnitDie().getTag() != dwarf::DW_TAG_type_unit))) &&
                "Kind is CU but TU is being processed.");
-    assert((&Current == &AccelDebugNames) ||
-           ((&Current == &AccelTypeUnitsDebugNames) &&
-            (Unit.getUnitDie().getTag() == dwarf::DW_TAG_type_unit)) &&
+    assert(((&Current == &AccelDebugNames) ||
+            ((&Current == &AccelTypeUnitsDebugNames) &&
+             (Unit.getUnitDie().getTag() == dwarf::DW_TAG_type_unit))) &&
                "Kind is TU but CU is being processed.");
     // The type unit can be discarded, so need to add references to final
     // acceleration table once we know it's complete and we emit it.


        


More information about the llvm-commits mailing list