xref: /freebsd/contrib/llvm-project/clang/lib/Driver/ToolChains/Flang.h (revision e8d8bef961a50d4dc22501cde4fb9fb0be1b2532)
1480093f4SDimitry Andric //===--- Flang.h - Flang Tool and ToolChain Implementations ====-*- C++ -*-===//
2480093f4SDimitry Andric //
3480093f4SDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4480093f4SDimitry Andric // See https://llvm.org/LICENSE.txt for license information.
5480093f4SDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6480093f4SDimitry Andric //
7480093f4SDimitry Andric //===----------------------------------------------------------------------===//
8480093f4SDimitry Andric 
9480093f4SDimitry Andric #ifndef LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_FLANG_H
10480093f4SDimitry Andric #define LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_FLANG_H
11480093f4SDimitry Andric 
12480093f4SDimitry Andric #include "clang/Driver/Tool.h"
13480093f4SDimitry Andric #include "clang/Driver/Action.h"
14480093f4SDimitry Andric #include "clang/Driver/Compilation.h"
15480093f4SDimitry Andric #include "clang/Driver/ToolChain.h"
16480093f4SDimitry Andric #include "llvm/Option/ArgList.h"
17480093f4SDimitry Andric #include "llvm/Support/Compiler.h"
18480093f4SDimitry Andric 
19480093f4SDimitry Andric namespace clang {
20480093f4SDimitry Andric namespace driver {
21480093f4SDimitry Andric 
22480093f4SDimitry Andric namespace tools {
23480093f4SDimitry Andric 
24480093f4SDimitry Andric /// Flang compiler tool.
25480093f4SDimitry Andric class LLVM_LIBRARY_VISIBILITY Flang : public Tool {
26*e8d8bef9SDimitry Andric private:
27*e8d8bef9SDimitry Andric   /// Extract preprocessing options from the driver arguments and add them to
28*e8d8bef9SDimitry Andric   /// the preprocessor command arguments.
29*e8d8bef9SDimitry Andric   ///
30*e8d8bef9SDimitry Andric   /// \param [in] Args The list of input driver arguments
31*e8d8bef9SDimitry Andric   /// \param [out] CmdArgs The list of output command arguments
32*e8d8bef9SDimitry Andric   void AddPreprocessingOptions(const llvm::opt::ArgList &Args,
33*e8d8bef9SDimitry Andric                                llvm::opt::ArgStringList &CmdArgs) const;
34*e8d8bef9SDimitry Andric 
35480093f4SDimitry Andric public:
36480093f4SDimitry Andric   Flang(const ToolChain &TC);
37480093f4SDimitry Andric   ~Flang() override;
38480093f4SDimitry Andric 
39480093f4SDimitry Andric   bool hasGoodDiagnostics() const override { return true; }
40480093f4SDimitry Andric   bool hasIntegratedAssembler() const override { return true; }
41480093f4SDimitry Andric   bool hasIntegratedCPP() const override { return true; }
42480093f4SDimitry Andric   bool canEmitIR() const override { return true; }
43480093f4SDimitry Andric 
44480093f4SDimitry Andric   void ConstructJob(Compilation &C, const JobAction &JA,
45480093f4SDimitry Andric                     const InputInfo &Output, const InputInfoList &Inputs,
46480093f4SDimitry Andric                     const llvm::opt::ArgList &TCArgs,
47480093f4SDimitry Andric                     const char *LinkingOutput) const override;
48480093f4SDimitry Andric };
49480093f4SDimitry Andric 
50480093f4SDimitry Andric } // end namespace tools
51480093f4SDimitry Andric 
52480093f4SDimitry Andric } // end namespace driver
53480093f4SDimitry Andric } // end namespace clang
54480093f4SDimitry Andric 
55480093f4SDimitry Andric #endif // LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_FLANG_H
56