Path: blob/main/contrib/llvm-project/llvm/lib/Target/DirectX/DXILOpBuilder.h
35266 views
//===- DXILOpBuilder.h - Helper class for build DIXLOp functions ----------===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//7///8/// \file This file contains class to help build DXIL op functions.9//===----------------------------------------------------------------------===//1011#ifndef LLVM_LIB_TARGET_DIRECTX_DXILOPBUILDER_H12#define LLVM_LIB_TARGET_DIRECTX_DXILOPBUILDER_H1314#include "DXILConstants.h"15#include "llvm/ADT/SmallVector.h"1617namespace llvm {18class Module;19class IRBuilderBase;20class CallInst;21class Value;22class Type;23class FunctionType;24class Use;2526namespace dxil {2728class DXILOpBuilder {29public:30DXILOpBuilder(Module &M, IRBuilderBase &B) : M(M), B(B) {}31/// Create an instruction that calls DXIL Op with return type, specified32/// opcode, and call arguments. \param OpCode Opcode of the DXIL Op call33/// constructed \param ReturnTy Return type of the DXIL Op call constructed34/// \param OverloadTy Overload type of the DXIL Op call constructed35/// \return DXIL Op call constructed36CallInst *createDXILOpCall(dxil::OpCode OpCode, Type *ReturnTy,37Type *OverloadTy, SmallVector<Value *> Args);38Type *getOverloadTy(dxil::OpCode OpCode, FunctionType *FT);39static const char *getOpCodeName(dxil::OpCode DXILOp);4041private:42Module &M;43IRBuilderBase &B;44};4546} // namespace dxil47} // namespace llvm4849#endif505152