[PATCH] D142411: Fix warning in SnippetGeneratorTest.cpp

Philipp Tomsich via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 23 15:24:31 PST 2023


philipp.tomsich created this revision.
Herald added a project: All.
philipp.tomsich requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Fixes the following warning:

  SnippetGeneratorTest.cpp:187:10: warning: suggest explicit braces to avoid ambiguous ‘else’ [-Wdangling-else]


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D142411

Files:
  llvm/unittests/tools/llvm-exegesis/X86/SnippetGeneratorTest.cpp


Index: llvm/unittests/tools/llvm-exegesis/X86/SnippetGeneratorTest.cpp
===================================================================
--- llvm/unittests/tools/llvm-exegesis/X86/SnippetGeneratorTest.cpp
+++ llvm/unittests/tools/llvm-exegesis/X86/SnippetGeneratorTest.cpp
@@ -184,8 +184,9 @@
     EXPECT_THAT(IT.getOpcode(), Opcode);
     ASSERT_THAT(IT.getVariableValues(), SizeIs(3));
     for (const auto &Var : IT.getVariableValues()) {
-      if (Var.isReg())
+      if (Var.isReg()) {
         EXPECT_FALSE(ForbiddenRegisters[Var.getReg()]);
+      }
     }
   }
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D142411.491523.patch
Type: text/x-patch
Size: 575 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230123/e5db0bee/attachment.bin>


More information about the llvm-commits mailing list