3 # Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 # See https://llvm.org/LICENSE.txt for license information.
5 # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 # Script for defining a new enum attr using SPIR-V spec from the Internet.
10 # ./define_enum.sh <enum-class-name>
12 # The 'operand_kinds' dict of spirv.core.grammar.json contains all supported
13 # SPIR-V enum classes.
15 # If <enum-name> is missing, this script updates existing ones.
21 current_file
="$(readlink -f "$0")"
22 current_dir
="$(dirname "$current_file")"
24 python3
${current_dir}/gen_spirv_dialect.py \
25 --base-td-path ${current_dir}/..
/..
/include
/mlir
/Dialect
/SPIRV
/SPIRVBase.td \
26 --new-enum "${new_enum}"