clang  10.0.0svn
RISCVToolchain.h
Go to the documentation of this file.
1 //===--- RISCVToolchain.h - RISCV 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_RISCVTOOLCHAIN_H
10 #define LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_RISCVTOOLCHAIN_H
11 
12 #include "Gnu.h"
13 #include "clang/Driver/ToolChain.h"
14 
15 namespace clang {
16 namespace driver {
17 namespace toolchains {
18 
19 class LLVM_LIBRARY_VISIBILITY RISCVToolChain : public Generic_ELF {
20 public:
21  RISCVToolChain(const Driver &D, const llvm::Triple &Triple,
22  const llvm::opt::ArgList &Args);
23 
24  bool IsIntegratedAssemblerDefault() const override { return true; }
25  void addClangTargetOptions(const llvm::opt::ArgList &DriverArgs,
26  llvm::opt::ArgStringList &CC1Args,
27  Action::OffloadKind) const override;
28  bool HasNativeLLVMSupport() const override { return true; }
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:22
Driver - Encapsulate logic for constructing compilation processes from a set of gcc-driver-like comma...
Definition: Driver.h:59
Base class for all GNU tools that provide the same behavior when it comes to response files support...
Definition: Gnu.h:40
Dataflow Directional Tag Classes.
Tool - Information on a specific compilation tool.
Definition: Tool.h:33
Compilation - A set of tasks to perform for a single driver invocation.
Definition: Compilation.h:45
bool HasNativeLLVMSupport() const override
HasNativeLTOLinker - Check whether the linker and related tools have native LLVM support.
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:88