CloudABI.h revision 341825
1//===--- CloudABI.h - CloudABI 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_CLOUDABI_H
11#define LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_CLOUDABI_H
12
13#include "Gnu.h"
14#include "clang/Driver/Tool.h"
15#include "clang/Driver/ToolChain.h"
16
17namespace clang {
18namespace driver {
19namespace tools {
20
21/// cloudabi -- Directly call GNU Binutils linker
22namespace cloudabi {
23class LLVM_LIBRARY_VISIBILITY Linker : public GnuTool {
24public:
25  Linker(const ToolChain &TC) : GnuTool("cloudabi::Linker", "linker", TC) {}
26
27  bool hasIntegratedCPP() const override { return false; }
28  bool isLinkJob() const override { return true; }
29
30  void ConstructJob(Compilation &C, const JobAction &JA,
31                    const InputInfo &Output, const InputInfoList &Inputs,
32                    const llvm::opt::ArgList &TCArgs,
33                    const char *LinkingOutput) const override;
34};
35} // end namespace cloudabi
36} // end namespace tools
37
38namespace toolchains {
39
40class LLVM_LIBRARY_VISIBILITY CloudABI : public Generic_ELF {
41public:
42  CloudABI(const Driver &D, const llvm::Triple &Triple,
43           const llvm::opt::ArgList &Args);
44  bool HasNativeLLVMSupport() const override { return true; }
45
46  bool IsMathErrnoDefault() const override { return false; }
47  bool IsObjCNonFragileABIDefault() const override { return true; }
48
49  CXXStdlibType
50  GetCXXStdlibType(const llvm::opt::ArgList &Args) const override {
51    return ToolChain::CST_Libcxx;
52  }
53  void addLibCxxIncludePaths(
54      const llvm::opt::ArgList &DriverArgs,
55      llvm::opt::ArgStringList &CC1Args) const override;
56  void AddCXXStdlibLibArgs(const llvm::opt::ArgList &Args,
57                           llvm::opt::ArgStringList &CmdArgs) const override;
58
59  bool isPIEDefault() const override;
60  SanitizerMask getSupportedSanitizers() const override;
61  SanitizerMask getDefaultSanitizers() const override;
62
63protected:
64  Tool *buildLinker() const override;
65};
66
67} // end namespace toolchains
68} // end namespace driver
69} // end namespace clang
70
71#endif // LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_CLOUDABI_H
72