summaryrefslogtreecommitdiff
path: root/polly
diff options
context:
space:
mode:
authorMichael Kruse <llvm@meinersbur.de>2018-08-02 00:11:14 +0000
committerMichael Kruse <llvm@meinersbur.de>2018-08-02 00:11:14 +0000
commit96cb90cc7aa722f43722ac1974a510f9bf5e2696 (patch)
tree1913e409ddc601a951acc1d1bb9e872b969becbf /polly
parent8ec815bea0f9e9373a89be343a3b6b243e9d6e89 (diff)
[JSONExporter] Print instead of ignoring parser error.
Silence the warning warning: ignoring return value of function declared with 'warn_unused_result' attribute [-Wunused-result] JSONExporter is a developer tool, there is no mechanism for error handling. Print the parser error and abort with a fatal error.
Diffstat (limited to 'polly')
-rw-r--r--polly/lib/Exchange/JSONExporter.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/polly/lib/Exchange/JSONExporter.cpp b/polly/lib/Exchange/JSONExporter.cpp
index 423768bdeed..0a744901e2b 100644
--- a/polly/lib/Exchange/JSONExporter.cpp
+++ b/polly/lib/Exchange/JSONExporter.cpp
@@ -723,9 +723,10 @@ static bool importScop(Scop &S, const Dependences &D, const DataLayout &DL,
Expected<json::Value> ParseResult =
json::parse(result.get().get()->getBuffer());
- if (!ParseResult) {
- ParseResult.takeError();
+ if (Error E = ParseResult.takeError()) {
errs() << "JSCoP file could not be parsed\n";
+ errs() << E << "\n";
+ consumeError(std::move(E));
return false;
}
json::Object &jscop = *ParseResult.get().getAsObject();