[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.

llvm-svn: 338659
This commit is contained in:
Michael Kruse
2018-08-02 00:11:14 +00:00
parent e1a525ed06
commit ebca0f1609

View File

@@ -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();