17330f729Sjoerg //===--- RISCVToolchain.h - RISCV ToolChain Implementations -----*- C++ -*-===// 27330f729Sjoerg // 37330f729Sjoerg // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 47330f729Sjoerg // See https://llvm.org/LICENSE.txt for license information. 57330f729Sjoerg // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 67330f729Sjoerg // 77330f729Sjoerg //===----------------------------------------------------------------------===// 87330f729Sjoerg 97330f729Sjoerg #ifndef LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_RISCVTOOLCHAIN_H 107330f729Sjoerg #define LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_RISCVTOOLCHAIN_H 117330f729Sjoerg 127330f729Sjoerg #include "Gnu.h" 137330f729Sjoerg #include "clang/Driver/ToolChain.h" 147330f729Sjoerg 157330f729Sjoerg namespace clang { 167330f729Sjoerg namespace driver { 177330f729Sjoerg namespace toolchains { 187330f729Sjoerg 197330f729Sjoerg class LLVM_LIBRARY_VISIBILITY RISCVToolChain : public Generic_ELF { 207330f729Sjoerg public: 217330f729Sjoerg RISCVToolChain(const Driver &D, const llvm::Triple &Triple, 227330f729Sjoerg const llvm::opt::ArgList &Args); 237330f729Sjoerg 24*e038c9c4Sjoerg static bool hasGCCToolchain(const Driver &D, const llvm::opt::ArgList &Args); IsIntegratedAssemblerDefault()257330f729Sjoerg bool IsIntegratedAssemblerDefault() const override { return true; } 267330f729Sjoerg void addClangTargetOptions(const llvm::opt::ArgList &DriverArgs, 277330f729Sjoerg llvm::opt::ArgStringList &CC1Args, 287330f729Sjoerg Action::OffloadKind) const override; 29*e038c9c4Sjoerg RuntimeLibType GetDefaultRuntimeLibType() const override; 30*e038c9c4Sjoerg UnwindLibType 31*e038c9c4Sjoerg GetUnwindLibType(const llvm::opt::ArgList &Args) const override; 327330f729Sjoerg void 337330f729Sjoerg AddClangSystemIncludeArgs(const llvm::opt::ArgList &DriverArgs, 347330f729Sjoerg llvm::opt::ArgStringList &CC1Args) const override; 357330f729Sjoerg void 367330f729Sjoerg addLibStdCxxIncludePaths(const llvm::opt::ArgList &DriverArgs, 377330f729Sjoerg llvm::opt::ArgStringList &CC1Args) const override; 387330f729Sjoerg 397330f729Sjoerg protected: 407330f729Sjoerg Tool *buildLinker() const override; 417330f729Sjoerg 427330f729Sjoerg private: 43*e038c9c4Sjoerg std::string computeSysRoot() const override; 447330f729Sjoerg }; 457330f729Sjoerg 467330f729Sjoerg } // end namespace toolchains 477330f729Sjoerg 487330f729Sjoerg namespace tools { 497330f729Sjoerg namespace RISCV { 50*e038c9c4Sjoerg class LLVM_LIBRARY_VISIBILITY Linker : public Tool { 517330f729Sjoerg public: Linker(const ToolChain & TC)52*e038c9c4Sjoerg Linker(const ToolChain &TC) : Tool("RISCV::Linker", "ld", TC) {} hasIntegratedCPP()537330f729Sjoerg bool hasIntegratedCPP() const override { return false; } isLinkJob()547330f729Sjoerg bool isLinkJob() const override { return true; } 557330f729Sjoerg void ConstructJob(Compilation &C, const JobAction &JA, 567330f729Sjoerg const InputInfo &Output, const InputInfoList &Inputs, 577330f729Sjoerg const llvm::opt::ArgList &TCArgs, 587330f729Sjoerg const char *LinkingOutput) const override; 597330f729Sjoerg }; 607330f729Sjoerg } // end namespace RISCV 617330f729Sjoerg } // end namespace tools 627330f729Sjoerg 637330f729Sjoerg } // end namespace driver 647330f729Sjoerg } // end namespace clang 657330f729Sjoerg 667330f729Sjoerg #endif // LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_RISCVTOOLCHAIN_H 67