dawn-cmake/src/tint/resolver/ctor_conv_intrinsic.cc.tmpl
Ben Clayton a123b892a5 tint/ast: Generate ast::StorageClass from intrinsics.def
Emit unit tests for parsing and printing.
Emit benchmarks for parsing.
Uses intrinsics.def as a single-source-of-truth.
The generators provide a way to optimize the enum parsers.

Change-Id: I1669c123d375f24aca45f3ea4abf04d7892673c7
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/97150
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Commit-Queue: Ben Clayton <bclayton@chromium.org>
2022-07-27 16:36:35 +00:00

31 lines
863 B
Cheetah

{{- /*
--------------------------------------------------------------------------------
Template file for use with tools/src/cmd/gen to generate ctor_conv_intrinsic.cc
To update the generated file, run:
./tools/run gen
See:
* tools/src/cmd/gen for structures used by this template
* https://golang.org/pkg/text/template/ for documentation on the template syntax
--------------------------------------------------------------------------------
*/ -}}
#include "src/tint/resolver/ctor_conv_intrinsic.h"
namespace tint::resolver {
const char* str(CtorConvIntrinsic i) {
switch (i) {
case CtorConvIntrinsic::kNone:
return "<none>";
{{- range Sem.ConstructorsAndConverters }}
case CtorConvIntrinsic::k{{Title .Name}}:
return "{{.Name}}";
{{- end }}
}
return "<unknown>";
}
} // namespace tint::resolver