mirror of
https://github.com/intel/llvm.git
synced 2026-01-17 06:40:01 +08:00
[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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user