xref: /freebsd-src/contrib/llvm-project/llvm/lib/Target/DirectX/DXILOpBuilder.h (revision 972a253a57b6f144b0e4a3e2080a2a0076ec55a0)
1*972a253aSDimitry Andric //===- DXILOpBuilder.h - Helper class for build DIXLOp functions ----------===//
2*972a253aSDimitry Andric //
3*972a253aSDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4*972a253aSDimitry Andric // See https://llvm.org/LICENSE.txt for license information.
5*972a253aSDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6*972a253aSDimitry Andric //
7*972a253aSDimitry Andric //===----------------------------------------------------------------------===//
8*972a253aSDimitry Andric ///
9*972a253aSDimitry Andric /// \file This file contains class to help build DXIL op functions.
10*972a253aSDimitry Andric //===----------------------------------------------------------------------===//
11*972a253aSDimitry Andric 
12*972a253aSDimitry Andric #ifndef LLVM_LIB_TARGET_DIRECTX_DXILOPBUILDER_H
13*972a253aSDimitry Andric #define LLVM_LIB_TARGET_DIRECTX_DXILOPBUILDER_H
14*972a253aSDimitry Andric 
15*972a253aSDimitry Andric #include "DXILConstants.h"
16*972a253aSDimitry Andric #include "llvm/ADT/iterator_range.h"
17*972a253aSDimitry Andric 
18*972a253aSDimitry Andric namespace llvm {
19*972a253aSDimitry Andric class Module;
20*972a253aSDimitry Andric class IRBuilderBase;
21*972a253aSDimitry Andric class CallInst;
22*972a253aSDimitry Andric class Value;
23*972a253aSDimitry Andric class Type;
24*972a253aSDimitry Andric class FunctionType;
25*972a253aSDimitry Andric class Use;
26*972a253aSDimitry Andric 
27*972a253aSDimitry Andric namespace DXIL {
28*972a253aSDimitry Andric 
29*972a253aSDimitry Andric class DXILOpBuilder {
30*972a253aSDimitry Andric public:
31*972a253aSDimitry Andric   DXILOpBuilder(Module &M, IRBuilderBase &B) : M(M), B(B) {}
32*972a253aSDimitry Andric   CallInst *createDXILOpCall(DXIL::OpCode OpCode, Type *OverloadTy,
33*972a253aSDimitry Andric                              llvm::iterator_range<Use *> Args);
34*972a253aSDimitry Andric   Type *getOverloadTy(DXIL::OpCode OpCode, FunctionType *FT,
35*972a253aSDimitry Andric                       bool NoOpCodeParam);
36*972a253aSDimitry Andric   static const char *getOpCodeName(DXIL::OpCode DXILOp);
37*972a253aSDimitry Andric 
38*972a253aSDimitry Andric private:
39*972a253aSDimitry Andric   Module &M;
40*972a253aSDimitry Andric   IRBuilderBase &B;
41*972a253aSDimitry Andric };
42*972a253aSDimitry Andric 
43*972a253aSDimitry Andric } // namespace DXIL
44*972a253aSDimitry Andric } // namespace llvm
45*972a253aSDimitry Andric 
46*972a253aSDimitry Andric #endif
47