[Mlir-commits] [mlir] 7510c11 - Update for review feedback: Inline var declaration and expand names.

Chris Lattner llvmlistbot at llvm.org
Wed Jan 6 20:59:44 PST 2021


Author: Chris Lattner
Date: 2021-01-06T20:59:24-08:00
New Revision: 7510c1152f0bb5ca6ef68ace22cb702b57b96fe9

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

LOG: Update for review feedback: Inline var declaration and expand names.

Depends on D93908.

Differential Revision: https://reviews.llvm.org/D94208

Added: 
    

Modified: 
    mlir/lib/IR/AsmPrinter.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/IR/AsmPrinter.cpp b/mlir/lib/IR/AsmPrinter.cpp
index 302c226ca800..1679fa41c8b9 100644
--- a/mlir/lib/IR/AsmPrinter.cpp
+++ b/mlir/lib/IR/AsmPrinter.cpp
@@ -57,16 +57,15 @@ OpAsmPrinter::~OpAsmPrinter() {}
 void OpAsmPrinter::printFunctionalType(Operation *op) {
   auto &os = getStream();
   os << '(';
-  llvm::interleaveComma(op->getOperands(), os, [&](Value op) {
+  llvm::interleaveComma(op->getOperands(), os, [&](Value operand) {
     // Print the types of null values as <<NULL TYPE>>.
-    *this << (op ? op.getType() : Type());
+    *this << (operand ? operand.getType() : Type());
   });
   os << ") -> ";
 
   // Print the result list.  We don't parenthesize single result types unless
   // it is a function (avoiding a grammar ambiguity).
-  auto numResults = op->getNumResults();
-  bool wrapped = numResults != 1;
+  bool wrapped = op->getNumResults() != 1;
   if (!wrapped && op->getResult(0).getType() &&
       op->getResult(0).getType().isa<FunctionType>())
     wrapped = true;
@@ -74,9 +73,9 @@ void OpAsmPrinter::printFunctionalType(Operation *op) {
   if (wrapped)
     os << '(';
 
-  llvm::interleaveComma(op->getResults(), os, [&](const OpResult &r) {
+  llvm::interleaveComma(op->getResults(), os, [&](const OpResult &result) {
     // Print the types of null values as <<NULL TYPE>>.
-    *this << (r ? r.getType() : Type());
+    *this << (result ? result.getType() : Type());
   });
 
   if (wrapped)


        


More information about the Mlir-commits mailing list