[polly] r255466 - Print "null" for ISL objects that are nullptr

Michael Kruse via llvm-commits llvm-commits at lists.llvm.org
Sun Dec 13 11:35:27 PST 2015


Author: meinersbur
Date: Sun Dec 13 13:35:26 2015
New Revision: 255466

URL: http://llvm.org/viewvc/llvm-project?rev=255466&view=rev
Log:
Print "null" for ISL objects that are nullptr

Use it to print "null" if a MemoryAccess's access relation is not
available instead of printing nothing.

Suggested-by: Johannes Doerfert

Modified:
    polly/trunk/lib/Analysis/ScopInfo.cpp
    polly/trunk/lib/Support/GICHelper.cpp

Modified: polly/trunk/lib/Analysis/ScopInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Analysis/ScopInfo.cpp?rev=255466&r1=255465&r2=255466&view=diff
==============================================================================
--- polly/trunk/lib/Analysis/ScopInfo.cpp (original)
+++ polly/trunk/lib/Analysis/ScopInfo.cpp Sun Dec 13 13:35:26 2015
@@ -747,8 +747,7 @@ void MemoryAccess::print(raw_ostream &OS
   }
   OS << "[Reduction Type: " << getReductionType() << "] ";
   OS << "[Scalar: " << isImplicit() << "]\n";
-  if (AccessRelation)
-    OS.indent(16) << getOriginalAccessRelationStr() << ";\n";
+  OS.indent(16) << getOriginalAccessRelationStr() << ";\n";
   if (hasNewAccessRelation())
     OS.indent(11) << "new: " << getNewAccessRelationStr() << ";\n";
 }

Modified: polly/trunk/lib/Support/GICHelper.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Support/GICHelper.cpp?rev=255466&r1=255465&r2=255466&view=diff
==============================================================================
--- polly/trunk/lib/Support/GICHelper.cpp (original)
+++ polly/trunk/lib/Support/GICHelper.cpp Sun Dec 13 13:35:26 2015
@@ -70,6 +70,8 @@ template <typename ISLTy, typename ISL_C
 static inline std::string stringFromIslObjInternal(__isl_keep ISLTy *isl_obj,
                                                    ISL_CTX_GETTER ctx_getter_fn,
                                                    ISL_PRINTER printer_fn) {
+  if (!isl_obj)
+    return "null";
   isl_ctx *ctx = ctx_getter_fn(isl_obj);
   isl_printer *p = isl_printer_to_str(ctx);
   printer_fn(p, isl_obj);




More information about the llvm-commits mailing list