1//===- DXILOpBuilder.h - Helper class for build DIXLOp functions ----------===//
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//===----------------------------------------------------------------------===//
8///
9/// \file This file contains class to help build DXIL op functions.
10//===----------------------------------------------------------------------===//
11
12#ifndef LLVM_LIB_TARGET_DIRECTX_DXILOPBUILDER_H
13#define LLVM_LIB_TARGET_DIRECTX_DXILOPBUILDER_H
14
15#include "DXILConstants.h"
16#include "llvm/ADT/SmallVector.h"
17
18namespace llvm {
19class Module;
20class IRBuilderBase;
21class CallInst;
22class Value;
23class Type;
24class FunctionType;
25class Use;
26
27namespace dxil {
28
29class DXILOpBuilder {
30public:
31 DXILOpBuilder(Module &M, IRBuilderBase &B) : M(M), B(B) {}
32 /// Create an instruction that calls DXIL Op with return type, specified
33 /// opcode, and call arguments. \param OpCode Opcode of the DXIL Op call
34 /// constructed \param ReturnTy Return type of the DXIL Op call constructed
35 /// \param OverloadTy Overload type of the DXIL Op call constructed
36 /// \return DXIL Op call constructed
37 CallInst *createDXILOpCall(dxil::OpCode OpCode, Type *ReturnTy,
38 Type *OverloadTy, SmallVector<Value *> Args);
39 Type *getOverloadTy(dxil::OpCode OpCode, FunctionType *FT);
40 static const char *getOpCodeName(dxil::OpCode DXILOp);
41
42private:
43 Module &M;
44 IRBuilderBase &B;
45};
46
47} // namespace dxil
48} // namespace llvm
49
50#endif
51

source code of llvm/lib/Target/DirectX/DXILOpBuilder.h