xref: /freebsd/contrib/llvm-project/clang/lib/Driver/ToolChains/Flang.h (revision 77013d11e6483b970af25e13c9b892075742f7e5)
1 //===--- Flang.h - Flang Tool and ToolChain 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_FLANG_H
10 #define LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_FLANG_H
11 
12 #include "clang/Driver/Tool.h"
13 #include "clang/Driver/Action.h"
14 #include "clang/Driver/Compilation.h"
15 #include "clang/Driver/ToolChain.h"
16 #include "llvm/Option/ArgList.h"
17 #include "llvm/Support/Compiler.h"
18 
19 namespace clang {
20 namespace driver {
21 
22 namespace tools {
23 
24 /// Flang compiler tool.
25 class LLVM_LIBRARY_VISIBILITY Flang : public Tool {
26 private:
27   /// Extract preprocessing options from the driver arguments and add them to
28   /// the preprocessor command arguments.
29   ///
30   /// \param [in] Args The list of input driver arguments
31   /// \param [out] CmdArgs The list of output command arguments
32   void AddPreprocessingOptions(const llvm::opt::ArgList &Args,
33                                llvm::opt::ArgStringList &CmdArgs) const;
34 
35 public:
36   Flang(const ToolChain &TC);
37   ~Flang() override;
38 
39   bool hasGoodDiagnostics() const override { return true; }
40   bool hasIntegratedAssembler() const override { return true; }
41   bool hasIntegratedCPP() const override { return true; }
42   bool canEmitIR() const override { return true; }
43 
44   void ConstructJob(Compilation &C, const JobAction &JA,
45                     const InputInfo &Output, const InputInfoList &Inputs,
46                     const llvm::opt::ArgList &TCArgs,
47                     const char *LinkingOutput) const override;
48 };
49 
50 } // end namespace tools
51 
52 } // end namespace driver
53 } // end namespace clang
54 
55 #endif // LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_FLANG_H
56