clang  8.0.0
RISCVToolchain.h
Go to the documentation of this file.
1 //===--- RISCVToolchain.h - RISCV ToolChain Implementations -----*- C++ -*-===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 
10 #ifndef LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_RISCVTOOLCHAIN_H
11 #define LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_RISCVTOOLCHAIN_H
12 
13 #include "Gnu.h"
14 #include "clang/Driver/ToolChain.h"
15 
16 namespace clang {
17 namespace driver {
18 namespace toolchains {
19 
20 class LLVM_LIBRARY_VISIBILITY RISCVToolChain : public Generic_ELF {
21 public:
22  RISCVToolChain(const Driver &D, const llvm::Triple &Triple,
23  const llvm::opt::ArgList &Args);
24 
25  bool IsIntegratedAssemblerDefault() const override { return true; }
26  void addClangTargetOptions(const llvm::opt::ArgList &DriverArgs,
27  llvm::opt::ArgStringList &CC1Args,
28  Action::OffloadKind) const override;
29  void
30  AddClangSystemIncludeArgs(const llvm::opt::ArgList &DriverArgs,
31  llvm::opt::ArgStringList &CC1Args) const override;
32  void
33  addLibStdCxxIncludePaths(const llvm::opt::ArgList &DriverArgs,
34  llvm::opt::ArgStringList &CC1Args) const override;
35 
36 protected:
37  Tool *buildLinker() const override;
38 
39 private:
40  std::string computeSysRoot() const;
41 };
42 
43 } // end namespace toolchains
44 
45 namespace tools {
46 namespace RISCV {
47 class LLVM_LIBRARY_VISIBILITY Linker : public GnuTool {
48 public:
49  Linker(const ToolChain &TC) : GnuTool("RISCV::Linker", "ld", TC) {}
50  bool hasIntegratedCPP() const override { return false; }
51  bool isLinkJob() const override { return true; }
52  void ConstructJob(Compilation &C, const JobAction &JA,
53  const InputInfo &Output, const InputInfoList &Inputs,
54  const llvm::opt::ArgList &TCArgs,
55  const char *LinkingOutput) const override;
56 };
57 } // end namespace RISCV
58 } // end namespace tools
59 
60 } // end namespace driver
61 } // end namespace clang
62 
63 #endif // LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_RISCVTOOLCHAIN_H
InputInfo - Wrapper for information about an input source.
Definition: InputInfo.h:23
Driver - Encapsulate logic for constructing compilation processes from a set of gcc-driver-like comma...
Definition: Driver.h:58
Base class for all GNU tools that provide the same behavior when it comes to response files support...
Definition: Gnu.h:41
Dataflow Directional Tag Classes.
Tool - Information on a specific compilation tool.
Definition: Tool.h:34
Compilation - A set of tasks to perform for a single driver invocation.
Definition: Compilation.h:46
bool hasIntegratedCPP() const override
bool IsIntegratedAssemblerDefault() const override
IsIntegratedAssemblerDefault - Does this tool chain enable -integrated-as by default.
ToolChain - Access to tools for a single platform.
Definition: ToolChain.h:89