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