| {{- /* |
| -------------------------------------------------------------------------------- |
| Template file for use with tools/src/cmd/gen to generate builtin_fn.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 |
| -------------------------------------------------------------------------------- |
| */ -}} |
| |
| {{- $I := LoadIntrinsics "src/tint/lang/spirv/spirv.def" -}} |
| #include "src/tint/lang/spirv/builtin_fn.h" |
| |
| namespace tint::spirv { |
| |
| const char* str(BuiltinFn i) { |
| switch (i) { |
| case BuiltinFn::kNone: |
| return "<none>"; |
| {{- range $I.Sem.Builtins }} |
| case BuiltinFn::k{{PascalCase .Name}}: |
| return "{{.Name}}"; |
| {{- end }} |
| } |
| return "<unknown>"; |
| } |
| |
| } // namespace tint::spirv |