clang  14.0.0git
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  static bool hasGCCToolchain(const Driver &D, const llvm::opt::ArgList &Args);
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  RuntimeLibType GetDefaultRuntimeLibType() const override;
30  UnwindLibType
31  GetUnwindLibType(const llvm::opt::ArgList &Args) const override;
32  void
33  AddClangSystemIncludeArgs(const llvm::opt::ArgList &DriverArgs,
34  llvm::opt::ArgStringList &CC1Args) const override;
35  void
36  addLibStdCxxIncludePaths(const llvm::opt::ArgList &DriverArgs,
37  llvm::opt::ArgStringList &CC1Args) const override;
38 
39 protected:
40  Tool *buildLinker() const override;
41 
42 private:
43  std::string computeSysRoot() const override;
44 };
45 
46 } // end namespace toolchains
47 
48 namespace tools {
49 namespace RISCV {
50 class LLVM_LIBRARY_VISIBILITY Linker : public Tool {
51 public:
52  Linker(const ToolChain &TC) : Tool("RISCV::Linker", "ld", TC) {}
53  bool hasIntegratedCPP() const override { return false; }
54  bool isLinkJob() const override { return true; }
55  void ConstructJob(Compilation &C, const JobAction &JA,
56  const InputInfo &Output, const InputInfoList &Inputs,
57  const llvm::opt::ArgList &TCArgs,
58  const char *LinkingOutput) const override;
59 };
60 } // end namespace RISCV
61 } // end namespace tools
62 
63 } // end namespace driver
64 } // end namespace clang
65 
66 #endif // LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_RISCVTOOLCHAIN_H
string
string(SUBSTRING ${CMAKE_CURRENT_BINARY_DIR} 0 ${PATH_LIB_START} PATH_HEAD) string(SUBSTRING $
Definition: CMakeLists.txt:22
clang::driver::toolchains::RISCVToolChain::IsIntegratedAssemblerDefault
bool IsIntegratedAssemblerDefault() const override
IsIntegratedAssemblerDefault - Does this tool chain enable -integrated-as by default.
Definition: RISCVToolchain.h:25
llvm::SmallVector
Definition: LLVM.h:38
clang::driver::tools::RISCV::Linker::isLinkJob
bool isLinkJob() const override
Definition: RISCVToolchain.h:54
clang::driver::InputInfo
InputInfo - Wrapper for information about an input source.
Definition: InputInfo.h:22
clang::driver::Tool
Tool - Information on a specific compilation tool.
Definition: Tool.h:32
clang::driver::toolchains::Generic_ELF
Definition: Gnu.h:362
ToolChain.h
clang::driver::tools::RISCV::Linker::hasIntegratedCPP
bool hasIntegratedCPP() const override
Definition: RISCVToolchain.h:53
Gnu.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::driver::tools::RISCV::Linker
Definition: RISCVToolchain.h:50
clang
Definition: CalledOnceCheck.h:17
clang::driver::Driver
Driver - Encapsulate logic for constructing compilation processes from a set of gcc-driver-like comma...
Definition: Driver.h:59
clang::driver::toolchains::RISCVToolChain
Definition: RISCVToolchain.h:19
clang::driver::Action::OffloadKind
OffloadKind
Definition: Action.h:85
clang::driver::JobAction
Definition: Action.h:380
clang::driver::tools::RISCV::Linker::Linker
Linker(const ToolChain &TC)
Definition: RISCVToolchain.h:52