[Mlir-commits] [mlir] 540d054 - Apply clang-tidy fixes for readability-simplify-boolean-expr in AttrOrTypeFormatGen.cpp (NFC)

Mehdi Amini llvmlistbot at llvm.org
Mon Sep 12 15:58:37 PDT 2022


Author: Mehdi Amini
Date: 2022-09-12T22:58:11Z
New Revision: 540d054b121d487ebbeefc6a21ce1fb1d3c1b9df

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

LOG: Apply clang-tidy fixes for readability-simplify-boolean-expr in AttrOrTypeFormatGen.cpp (NFC)

Added: 
    

Modified: 
    mlir/tools/mlir-tblgen/AttrOrTypeFormatGen.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/tools/mlir-tblgen/AttrOrTypeFormatGen.cpp b/mlir/tools/mlir-tblgen/AttrOrTypeFormatGen.cpp
index c249e23e531e5..7449b108fa4d2 100644
--- a/mlir/tools/mlir-tblgen/AttrOrTypeFormatGen.cpp
+++ b/mlir/tools/mlir-tblgen/AttrOrTypeFormatGen.cpp
@@ -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,


        


More information about the Mlir-commits mailing list