[msl-writer] Better error message for missing statement and expression.

If the statement or expression being emitted is not implemented this
will now output the failed statement.

Bug: tint:7
Change-Id: I8a359abd369067540d503a1facbee018e91e8666
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/24523
Reviewed-by: David Neto <dneto@google.com>
This commit is contained in:
dan sinclair 2020-07-08 18:29:21 +00:00 committed by David Neto
parent 723c5b4889
commit d0f7381090
1 changed files with 2 additions and 2 deletions

View File

@ -386,7 +386,7 @@ bool GeneratorImpl::EmitExpression(ast::Expression* expr) {
return EmitUnaryOp(expr->AsUnaryOp());
}
error_ = "unknown expression type";
error_ = "unknown expression type: " + expr->str();
return false;
}
@ -648,7 +648,7 @@ bool GeneratorImpl::EmitStatement(ast::Statement* stmt) {
return EmitSwitch(stmt->AsSwitch());
}
error_ = "unknown statement type";
error_ = "unknown statement type: " + stmt->str();
return false;
}