[PATCH] D32739: [Polly] JSONImporter misses checks whether the data it imports makes sense.

Michael Kruse via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 11 04:27:24 PDT 2017


Meinersbur added inline comments.


================
Comment at: lib/Exchange/JSONExporter.cpp:605-608
+  // Check if key 'arrays' is present.
   Json::Value Arrays = JScop["arrays"];
-
-  if (Arrays.size() == 0)
+  if (Arrays.size() == 0) {
+    errs() << "JScop file has no key named 'arrays'.\n";
----------------
niosega wrote:
> Meinersbur wrote:
> > A SCoP doesn't strictly need arrays.
> > 
> > So far none of your tests has an `arrays` key, meaning all of them would fail if there is no error before.
> There was already an if to check whether the Json contains a arrays key or not. I have just added an output to inform the user. Should I remove my output ?
Since it returns `true`, it looks like normal operation. Error output would be confusing. So, set, you can remove it.


https://reviews.llvm.org/D32739





More information about the llvm-commits mailing list