54 lines · c
1//===- DXILConstants.h - Essential DXIL constants -------------------------===//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-exception6//7//===----------------------------------------------------------------------===//8///9/// \file This file contains essential DXIL constants.10//===----------------------------------------------------------------------===//11 12#ifndef LLVM_LIB_TARGET_DIRECTX_DXILCONSTANTS_H13#define LLVM_LIB_TARGET_DIRECTX_DXILCONSTANTS_H14 15namespace llvm {16namespace dxil {17 18enum class OpCode : unsigned {19#define DXIL_OPCODE(Op, Name) Name = Op,20#include "DXILOperation.inc"21};22 23enum class OpCodeClass : unsigned {24#define DXIL_OPCLASS(Name) Name,25#include "DXILOperation.inc"26};27 28enum class OpParamType : unsigned {29#define DXIL_OP_PARAM_TYPE(Name) Name,30#include "DXILOperation.inc"31};32 33struct Attributes {34#define DXIL_ATTRIBUTE(Name) bool Name = false;35#include "DXILOperation.inc"36};37 38inline Attributes operator|(Attributes a, Attributes b) {39 Attributes c;40#define DXIL_ATTRIBUTE(Name) c.Name = a.Name | b.Name;41#include "DXILOperation.inc"42 return c;43}44 45inline Attributes &operator|=(Attributes &a, Attributes &b) {46 a = a | b;47 return a;48}49 50} // namespace dxil51} // namespace llvm52 53#endif54