From d0f7381090ca569e62bc36f6a61cc0be6f22c940 Mon Sep 17 00:00:00 2001 From: dan sinclair Date: Wed, 8 Jul 2020 18:29:21 +0000 Subject: [PATCH] [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 --- src/writer/msl/generator_impl.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/writer/msl/generator_impl.cc b/src/writer/msl/generator_impl.cc index 0a2c72f5d8..70b78feb6b 100644 --- a/src/writer/msl/generator_impl.cc +++ b/src/writer/msl/generator_impl.cc @@ -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; }