[polly] r304817 - [JScop] Emit error messages on error.

Michael Kruse via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 6 12:17:32 PDT 2017


Author: meinersbur
Date: Tue Jun  6 14:17:32 2017
New Revision: 304817

URL: http://llvm.org/viewvc/llvm-project?rev=304817&view=rev
Log:
[JScop] Emit error messages on error.

In importArrays instead of silently ignoring the file.

Modified:
    polly/trunk/lib/Exchange/JSONExporter.cpp

Modified: polly/trunk/lib/Exchange/JSONExporter.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Exchange/JSONExporter.cpp?rev=304817&r1=304816&r2=304817&view=diff
==============================================================================
--- polly/trunk/lib/Exchange/JSONExporter.cpp (original)
+++ polly/trunk/lib/Exchange/JSONExporter.cpp Tue Jun  6 14:17:32 2017
@@ -682,18 +682,24 @@ bool JSONImporter::importArrays(Scop &S,
   for (auto &SAI : S.arrays()) {
     if (!SAI->isArrayKind())
       continue;
-    if (ArrayIdx + 1 > Arrays.size())
+    if (ArrayIdx + 1 > Arrays.size()) {
+      errs() << "Not enough array entries in JScop file.\n";
       return false;
-    if (!areArraysEqual(SAI, Arrays[ArrayIdx]))
+    }
+    if (!areArraysEqual(SAI, Arrays[ArrayIdx])) {
+      errs() << "No match for array '" << SAI->getName() << "' in JScop.\n";
       return false;
+    }
     ArrayIdx++;
   }
 
   for (; ArrayIdx < Arrays.size(); ArrayIdx++) {
     auto *ElementType = parseTextType(Arrays[ArrayIdx]["type"].asCString(),
                                       S.getSE()->getContext());
-    if (!ElementType)
+    if (!ElementType) {
+      errs() << "Error while parsing element type for new array.\n";
       return false;
+    }
     std::vector<unsigned> DimSizes;
     for (unsigned i = 0; i < Arrays[ArrayIdx]["sizes"].size(); i++)
       DimSizes.push_back(std::stoi(Arrays[ArrayIdx]["sizes"][i].asCString()));




More information about the llvm-commits mailing list