blob: 491524fb43a8da9eb2583962dae88dee6d9c7499 [file] [log] [blame] [edit]
{{- /*
--------------------------------------------------------------------------------
Template file for use with tools/src/cmd/gen to generate builtin_fn.h
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/msl/msl.def" -}}
#ifndef SRC_TINT_LANG_MSL_BUILTIN_FN_H_
#define SRC_TINT_LANG_MSL_BUILTIN_FN_H_
#include <cstdint>
#include <string>
#include "src/tint/utils/traits/traits.h"
// \cond DO_NOT_DOCUMENT
namespace tint::msl {
/// Enumerator of all builtin functions
enum class BuiltinFn : uint8_t {
{{- range $I.Sem.Builtins }}
k{{PascalCase .Name}},
{{- end }}
kNone,
};
/// @returns the name of the builtin function type.
const char* str(BuiltinFn i);
/// Emits the name of the builtin function type.
template <typename STREAM, typename = traits::EnableIfIsOStream<STREAM>>
auto& operator<<(STREAM& o, BuiltinFn i) {
return o << str(i);
}
} // namespace tint::msl
// \endcond
#endif // SRC_TINT_LANG_MSL_BUILTIN_FN_H_