Apply clang-tidy fixes for readability-simplify-boolean-expr in AttrOrTypeFormatGen...
authorMehdi Amini <joker.eph@gmail.com>
Mon, 29 Aug 2022 12:08:00 +0000 (12:08 +0000)
committerMehdi Amini <joker.eph@gmail.com>
Mon, 12 Sep 2022 22:58:11 +0000 (22:58 +0000)
mlir/tools/mlir-tblgen/AttrOrTypeFormatGen.cpp

index c249e23..7449b10 100644 (file)
@@ -747,7 +747,7 @@ void DefFormat::genLiteralPrinter(StringRef value, FmtContext &ctx,
   // Update the flags.
   shouldEmitSpace =
       value.size() != 1 || !StringRef("<({[").contains(value.front());
-  lastWasPunctuation = !(value.front() == '_' || isalpha(value.front()));
+  lastWasPunctuation = value.front() != '_' && !isalpha(value.front());
 }
 
 void DefFormat::genVariablePrinter(ParameterElement *el, FmtContext &ctx,