CloudABI.h revision 321369
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  std::string findLibCxxIncludePath() const override;
54  void AddCXXStdlibLibArgs(const llvm::opt::ArgList &Args,
55                           llvm::opt::ArgStringList &CmdArgs) const override;
56
57  bool isPIEDefault() const override;
58  SanitizerMask getSupportedSanitizers() const override;
59  SanitizerMask getDefaultSanitizers() const override;
60
61protected:
62  Tool *buildLinker() const override;
63};
64
65} // end namespace toolchains
66} // end namespace driver
67} // end namespace clang
68
69#endif // LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_CLOUDABI_H
70