blob: f1062b8b2f98bd5ce8720c8632f0b9f6009c8eac [file] [log] [blame]
{{- /*
--------------------------------------------------------------------------------
Template file for use with tools/src/cmd/gen to generate parameter_usage.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/core/core.def" -}}
#ifndef SRC_TINT_LANG_CORE_PARAMETER_USAGE_H_
#define SRC_TINT_LANG_CORE_PARAMETER_USAGE_H_
#include <cstdint>
#include <string>
#include "src/tint/utils/traits/traits.h"
namespace tint::core {
/// ParameterUsage is extra metadata for identifying a parameter based on its
/// overload position
enum class ParameterUsage : uint8_t {
{{- range $I.Sem.UniqueParameterNames }}
k{{PascalCase .}},
{{- end }}
kNone,
};
/// @param value the enum value
/// @returns the string for the given enum value
std::string_view ToString(ParameterUsage value);
/// @param out the stream to write to
/// @param value the ParameterUsage
/// @returns @p out so calls can be chained
template <typename STREAM, typename = traits::EnableIfIsOStream<STREAM>>
auto& operator<<(STREAM& out, ParameterUsage value) {
return out << ToString(value);
}
} // namespace tint::core
#endif // SRC_TINT_LANG_CORE_PARAMETER_USAGE_H_