intrinsic_table.def: Support [[deprecated]] on fn

And produce a warning if these are used. Hard to test, as we don't want to introduce fake functions in our definition file.

Also add missing cast in EnumMatcher.

Bug: tint:806
Change-Id: I21f189e4befe419f6d5544acfc52387d9a5da782
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/54001
Commit-Queue: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: David Neto <dneto@google.com>
This commit is contained in:
Ben Clayton
2021-06-10 17:31:54 +00:00
committed by Tint LUCI CQ
parent 06e2e5c2f7
commit 3e59eb0e5c
9 changed files with 289 additions and 9 deletions

View File

@@ -1723,6 +1723,10 @@ bool Resolver::IntrinsicCall(ast::CallExpression* call,
return false;
}
if (result->IsDeprecated()) {
diagnostics_.add_warning("use of deprecated intrinsic", call->source());
}
builder_->Sem().Add(
call, builder_->create<sem::Call>(call, result, current_statement_));
SetType(call, result->ReturnType());