blob: 491524fb43a8da9eb2583962dae88dee6d9c7499 [file] [log] [blame]
dan sinclair0ebbc5c2023-11-29 17:53:24 +00001{{- /*
2--------------------------------------------------------------------------------
3Template file for use with tools/src/cmd/gen to generate builtin_fn.h
4
5To update the generated file, run:
6 ./tools/run gen
7
8See:
9* tools/src/cmd/gen for structures used by this template
10* https://golang.org/pkg/text/template/ for documentation on the template syntax
11--------------------------------------------------------------------------------
12*/ -}}
13
14{{- $I := LoadIntrinsics "src/tint/lang/msl/msl.def" -}}
15
16#ifndef SRC_TINT_LANG_MSL_BUILTIN_FN_H_
17#define SRC_TINT_LANG_MSL_BUILTIN_FN_H_
18
19#include <cstdint>
20#include <string>
21
22#include "src/tint/utils/traits/traits.h"
23
24// \cond DO_NOT_DOCUMENT
25namespace tint::msl {
26
27/// Enumerator of all builtin functions
28enum class BuiltinFn : uint8_t {
29{{- range $I.Sem.Builtins }}
30 k{{PascalCase .Name}},
31{{- end }}
32 kNone,
33};
34
35/// @returns the name of the builtin function type.
36const char* str(BuiltinFn i);
37
38/// Emits the name of the builtin function type.
39template <typename STREAM, typename = traits::EnableIfIsOStream<STREAM>>
40auto& operator<<(STREAM& o, BuiltinFn i) {
41 return o << str(i);
42}
43
44} // namespace tint::msl
45// \endcond
46
47#endif // SRC_TINT_LANG_MSL_BUILTIN_FN_H_