clang  13.0.0git
Flang.h
Go to the documentation of this file.
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"
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 fortran dialect options from the driver arguments and add them to
28  /// the list of arguments for the generated command/job.
29  ///
30  /// \param [in] Args The list of input driver arguments
31  /// \param [out] CmdArgs The list of output command arguments
32  void AddFortranDialectOptions(const llvm::opt::ArgList &Args,
33  llvm::opt::ArgStringList &CmdArgs) const;
34 
35  /// Extract preprocessing options from the driver arguments and add them to
36  /// the preprocessor command arguments.
37  ///
38  /// \param [in] Args The list of input driver arguments
39  /// \param [out] CmdArgs The list of output command arguments
40  void AddPreprocessingOptions(const llvm::opt::ArgList &Args,
41  llvm::opt::ArgStringList &CmdArgs) const;
42  /// Extract other compilation options from the driver arguments and add them
43  /// to the command arguments.
44  ///
45  /// \param [in] Args The list of input driver arguments
46  /// \param [out] CmdArgs The list of output command arguments
47  void AddOtherOptions(const llvm::opt::ArgList &Args,
48  llvm::opt::ArgStringList &CmdArgs) const;
49 
50 public:
51  Flang(const ToolChain &TC);
52  ~Flang() override;
53 
54  bool hasGoodDiagnostics() const override { return true; }
55  bool hasIntegratedAssembler() const override { return true; }
56  bool hasIntegratedCPP() const override { return true; }
57  bool canEmitIR() const override { return true; }
58 
59  void ConstructJob(Compilation &C, const JobAction &JA,
60  const InputInfo &Output, const InputInfoList &Inputs,
61  const llvm::opt::ArgList &TCArgs,
62  const char *LinkingOutput) const override;
63 };
64 
65 } // end namespace tools
66 
67 } // end namespace driver
68 } // end namespace clang
69 
70 #endif // LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_FLANG_H
llvm::SmallVector
Definition: LLVM.h:38
clang::driver::tools::Flang::hasGoodDiagnostics
bool hasGoodDiagnostics() const override
Does this tool have "good" standardized diagnostics, or should the driver add an additional "command ...
Definition: Flang.h:54
clang::driver::InputInfo
InputInfo - Wrapper for information about an input source.
Definition: InputInfo.h:22
Action.h
clang::driver::Tool
Tool - Information on a specific compilation tool.
Definition: Tool.h:32
clang::driver::tools::Flang::hasIntegratedAssembler
bool hasIntegratedAssembler() const override
Definition: Flang.h:55
clang::driver::tools::Flang::hasIntegratedCPP
bool hasIntegratedCPP() const override
Definition: Flang.h:56
clang::driver::tools::Flang::canEmitIR
bool canEmitIR() const override
Definition: Flang.h:57
Tool.h
clang::driver::tools::Flang
Flang compiler tool.
Definition: Flang.h:25
ToolChain.h
Compilation.h
clang::driver::ToolChain
ToolChain - Access to tools for a single platform.
Definition: ToolChain.h:91
clang::driver::Compilation
Compilation - A set of tasks to perform for a single driver invocation.
Definition: Compilation.h:45
clang
Definition: CalledOnceCheck.h:17
clang::driver::JobAction
Definition: Action.h:380