10b57cec5SDimitry Andric //===--- Haiku.h - Haiku ToolChain Implementations --------------*- C++ -*-===// 20b57cec5SDimitry Andric // 30b57cec5SDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 40b57cec5SDimitry Andric // See https://llvm.org/LICENSE.txt for license information. 50b57cec5SDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 60b57cec5SDimitry Andric // 70b57cec5SDimitry Andric //===----------------------------------------------------------------------===// 80b57cec5SDimitry Andric 90b57cec5SDimitry Andric #ifndef LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_HAIKU_H 100b57cec5SDimitry Andric #define LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_HAIKU_H 110b57cec5SDimitry Andric 120b57cec5SDimitry Andric #include "Gnu.h" 130b57cec5SDimitry Andric #include "clang/Driver/Driver.h" 140b57cec5SDimitry Andric #include "clang/Driver/ToolChain.h" 150b57cec5SDimitry Andric 160b57cec5SDimitry Andric namespace clang { 170b57cec5SDimitry Andric namespace driver { 18*5f757f3fSDimitry Andric namespace tools { 19*5f757f3fSDimitry Andric 20*5f757f3fSDimitry Andric /// Directly call GNU Binutils assembler and linker 21*5f757f3fSDimitry Andric namespace haiku { 22*5f757f3fSDimitry Andric class LLVM_LIBRARY_VISIBILITY Linker final : public Tool { 23*5f757f3fSDimitry Andric public: 24*5f757f3fSDimitry Andric Linker(const ToolChain &TC) : Tool("haiku::Linker", "linker", TC) {} 25*5f757f3fSDimitry Andric 26*5f757f3fSDimitry Andric bool hasIntegratedCPP() const override { return false; } 27*5f757f3fSDimitry Andric bool isLinkJob() const override { return true; } 28*5f757f3fSDimitry Andric 29*5f757f3fSDimitry Andric void ConstructJob(Compilation &C, const JobAction &JA, 30*5f757f3fSDimitry Andric const InputInfo &Output, const InputInfoList &Inputs, 31*5f757f3fSDimitry Andric const llvm::opt::ArgList &TCArgs, 32*5f757f3fSDimitry Andric const char *LinkingOutput) const override; 33*5f757f3fSDimitry Andric }; 34*5f757f3fSDimitry Andric } // end namespace haiku 35*5f757f3fSDimitry Andric } // end namespace tools 36*5f757f3fSDimitry Andric 370b57cec5SDimitry Andric namespace toolchains { 380b57cec5SDimitry Andric 390b57cec5SDimitry Andric class LLVM_LIBRARY_VISIBILITY Haiku : public Generic_ELF { 400b57cec5SDimitry Andric public: 410b57cec5SDimitry Andric Haiku(const Driver &D, const llvm::Triple &Triple, 420b57cec5SDimitry Andric const llvm::opt::ArgList &Args); 430b57cec5SDimitry Andric 44*5f757f3fSDimitry Andric bool HasNativeLLVMSupport() const override; 450b57cec5SDimitry Andric 46*5f757f3fSDimitry Andric bool IsMathErrnoDefault() const override { return false; } 47*5f757f3fSDimitry Andric bool IsObjCNonFragileABIDefault() const override { return true; } 48*5f757f3fSDimitry Andric bool isPICDefault() const override { return true; } 49*5f757f3fSDimitry Andric 50*5f757f3fSDimitry Andric const char *getDefaultLinker() const override { return "ld.lld"; } 51*5f757f3fSDimitry Andric 52*5f757f3fSDimitry Andric void AddClangSystemIncludeArgs( 53*5f757f3fSDimitry Andric const llvm::opt::ArgList &DriverArgs, 54*5f757f3fSDimitry Andric llvm::opt::ArgStringList &CC1Args) const override; 550b57cec5SDimitry Andric void addLibCxxIncludePaths( 560b57cec5SDimitry Andric const llvm::opt::ArgList &DriverArgs, 570b57cec5SDimitry Andric llvm::opt::ArgStringList &CC1Args) const override; 58*5f757f3fSDimitry Andric 59*5f757f3fSDimitry Andric unsigned GetDefaultDwarfVersion() const override { return 4; } 60*5f757f3fSDimitry Andric 61*5f757f3fSDimitry Andric bool GetDefaultStandaloneDebug() const override { return true; } 62*5f757f3fSDimitry Andric 63*5f757f3fSDimitry Andric protected: 64*5f757f3fSDimitry Andric Tool *buildLinker() const override; 650b57cec5SDimitry Andric }; 660b57cec5SDimitry Andric 670b57cec5SDimitry Andric } // end namespace toolchains 680b57cec5SDimitry Andric } // end namespace driver 690b57cec5SDimitry Andric } // end namespace clang 700b57cec5SDimitry Andric 710b57cec5SDimitry Andric #endif // LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_HAIKU_H 72