blob: deb288cd5b0845884163251cb0f0b4461b5b2240 [file] [log] [blame]
{{- /*
--------------------------------------------------------------------------------
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/rtti/traits.h"
#include "src/tint/lang/core/ir/call.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);
}
/// @returns access restrictions for a function
tint::core::ir::Instruction::Accesses GetSideEffects(BuiltinFn fn);
} // namespace tint::msl
// \endcond
#endif // SRC_TINT_LANG_MSL_BUILTIN_FN_H_