xref: /freebsd/contrib/llvm-project/llvm/lib/Target/DirectX/DXILOpBuilder.h (revision a03411e84728e9b267056fd31c7d1d9d1dc1b01e)
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/iterator_range.h"
17 
18 namespace llvm {
19 class Module;
20 class IRBuilderBase;
21 class CallInst;
22 class Value;
23 class Type;
24 class FunctionType;
25 class Use;
26 
27 namespace dxil {
28 
29 class DXILOpBuilder {
30 public:
31   DXILOpBuilder(Module &M, IRBuilderBase &B) : M(M), B(B) {}
32   CallInst *createDXILOpCall(dxil::OpCode OpCode, Type *OverloadTy,
33                              llvm::iterator_range<Use *> Args);
34   Type *getOverloadTy(dxil::OpCode OpCode, FunctionType *FT,
35                       bool NoOpCodeParam);
36   static const char *getOpCodeName(dxil::OpCode DXILOp);
37 
38 private:
39   Module &M;
40   IRBuilderBase &B;
41 };
42 
43 } // namespace dxil
44 } // namespace llvm
45 
46 #endif
47