• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/bin/bash
2
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
6
7# Script for defining a new enum attr using SPIR-V spec from the Internet.
8#
9# Run as:
10# ./define_enum.sh <enum-class-name>
11#
12# The 'operand_kinds' dict of spirv.core.grammar.json contains all supported
13# SPIR-V enum classes.
14#
15# If <enum-name> is missing, this script updates existing ones.
16
17set -e
18
19new_enum=$1
20
21current_file="$(readlink -f "$0")"
22current_dir="$(dirname "$current_file")"
23
24python3 ${current_dir}/gen_spirv_dialect.py \
25  --base-td-path ${current_dir}/../../include/mlir/Dialect/SPIRV/SPIRVBase.td \
26  --new-enum "${new_enum}"
27