[clang] Avoid linking libdl unless needed
[llvm-project.git] / mlir / utils / spirv / define_enum.sh
blob87b88c9313337eaeff77b4359aabe418540d6524
1 #!/bin/bash
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.
9 # Run as:
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.
17 set -e
19 new_enum=$1
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}"