[Mlir-commits] [mlir] 7637f3b - Apply clang-tidy fixes for readability-simplify-boolean-expr in OpFormatGen.cpp (NFC)

Mehdi Amini llvmlistbot at llvm.org
Thu Sep 15 06:24:38 PDT 2022


Author: Mehdi Amini
Date: 2022-09-15T13:23:34Z
New Revision: 7637f3b850f80df277cb96b4ee2aad767f94b8e6

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

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

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/mlir/tools/mlir-tblgen/OpFormatGen.cpp b/mlir/tools/mlir-tblgen/OpFormatGen.cpp
index c8ca8090f0d44..d20901d52ede6 100644
--- a/mlir/tools/mlir-tblgen/OpFormatGen.cpp
+++ b/mlir/tools/mlir-tblgen/OpFormatGen.cpp
@@ -1657,7 +1657,7 @@ static void genLiteralPrinter(StringRef value, MethodBody &body,
   // Insert a space after certain literals.
   shouldEmitSpace =
       value.size() != 1 || !StringRef("<({[").contains(value.front());
-  lastWasPunctuation = !(value.front() == '_' || isalpha(value.front()));
+  lastWasPunctuation = value.front() != '_' && !isalpha(value.front());
 }
 
 /// Generate the printer for a space. `shouldEmitSpace` and `lastWasPunctuation`


        


More information about the Mlir-commits mailing list