[PATCH] D77509: [MLIR][NFC] Make AsmPrinter messages on null structures consistent

Uday Bondhugula via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Apr 5 12:49:07 PDT 2020


This revision was automatically updated to reflect the committed changes.
Closed by commit rG34392b518f9a: [MLIR][NFC] Make AsmPrinter messages on null structures consistent (authored by bondhugula).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D77509/new/

https://reviews.llvm.org/D77509

Files:
  mlir/lib/IR/AsmPrinter.cpp


Index: mlir/lib/IR/AsmPrinter.cpp
===================================================================
--- mlir/lib/IR/AsmPrinter.cpp
+++ mlir/lib/IR/AsmPrinter.cpp
@@ -2289,8 +2289,8 @@
 }
 
 void AffineExpr::print(raw_ostream &os) const {
-  if (expr == nullptr) {
-    os << "null affine expr";
+  if (!expr) {
+    os << "<<NULL AFFINE EXPR>>";
     return;
   }
   ModulePrinter(os).printAffineExpr(*this);
@@ -2302,8 +2302,8 @@
 }
 
 void AffineMap::print(raw_ostream &os) const {
-  if (map == nullptr) {
-    os << "null affine map";
+  if (!map) {
+    os << "<<NULL AFFINE MAP>>";
     return;
   }
   ModulePrinter(os).printAffineMap(*this);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D77509.255188.patch
Type: text/x-patch
Size: 652 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200405/96a667bd/attachment.bin>


More information about the llvm-commits mailing list