xref: /freebsd-src/contrib/llvm-project/clang/lib/Driver/ToolChains/SPIRV.h (revision 5e801ac66d24704442eba426ed13c3effb8a34e7)
1 //===--- SPIRV.h - SPIR-V Tool Implementations ------------------*- C++ -*-===//
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 #ifndef LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_SPIRV_H
10 #define LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_SPIRV_H
11 
12 #include "clang/Driver/Tool.h"
13 #include "clang/Driver/ToolChain.h"
14 
15 namespace clang {
16 namespace driver {
17 namespace tools {
18 namespace SPIRV {
19 
20 void addTranslatorArgs(const llvm::opt::ArgList &InArgs,
21                        llvm::opt::ArgStringList &OutArgs);
22 
23 void constructTranslateCommand(Compilation &C, const Tool &T,
24                                const JobAction &JA, const InputInfo &Output,
25                                const InputInfo &Input,
26                                const llvm::opt::ArgStringList &Args);
27 
28 class LLVM_LIBRARY_VISIBILITY Translator : public Tool {
29 public:
30   Translator(const ToolChain &TC)
31       : Tool("SPIR-V::Translator", "llvm-spirv", TC) {}
32 
33   bool hasIntegratedCPP() const override { return false; }
34   bool hasIntegratedAssembler() const override { return true; }
35 
36   void ConstructJob(Compilation &C, const JobAction &JA,
37                     const InputInfo &Output, const InputInfoList &Inputs,
38                     const llvm::opt::ArgList &TCArgs,
39                     const char *LinkingOutput) const override;
40 };
41 
42 } // namespace SPIRV
43 } // namespace tools
44 } // namespace driver
45 } // namespace clang
46 #endif
47