clang  6.0.0svn
WebAssembly.h
Go to the documentation of this file.
1 //===--- WebAssembly.h - WebAssembly 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_WEBASSEMBLY_H
11 #define LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_WEBASSEMBLY_H
12 
13 #include "Gnu.h"
14 #include "clang/Driver/Tool.h"
15 #include "clang/Driver/ToolChain.h"
16 
17 namespace clang {
18 namespace driver {
19 namespace tools {
20 namespace wasm {
21 
22 class LLVM_LIBRARY_VISIBILITY Linker : public GnuTool {
23 public:
24  explicit Linker(const ToolChain &TC);
25  bool isLinkJob() const override;
26  bool hasIntegratedCPP() const override;
27  void ConstructJob(Compilation &C, const JobAction &JA,
28  const InputInfo &Output, const InputInfoList &Inputs,
29  const llvm::opt::ArgList &TCArgs,
30  const char *LinkingOutput) const override;
31 };
32 
33 } // end namespace wasm
34 } // end namespace tools
35 
36 namespace toolchains {
37 
38 class LLVM_LIBRARY_VISIBILITY WebAssembly final : public ToolChain {
39 public:
40  WebAssembly(const Driver &D, const llvm::Triple &Triple,
41  const llvm::opt::ArgList &Args);
42 
43 private:
44  bool IsMathErrnoDefault() const override;
45  bool IsObjCNonFragileABIDefault() const override;
46  bool UseObjCMixedDispatch() const override;
47  bool isPICDefault() const override;
48  bool isPIEDefault() const override;
49  bool isPICDefaultForced() const override;
50  bool IsIntegratedAssemblerDefault() const override;
51  bool hasBlocksRuntime() const override;
52  bool SupportsProfiling() const override;
53  bool HasNativeLLVMSupport() const override;
54  void addClangTargetOptions(const llvm::opt::ArgList &DriverArgs,
55  llvm::opt::ArgStringList &CC1Args,
56  Action::OffloadKind DeviceOffloadKind) const override;
57  RuntimeLibType GetDefaultRuntimeLibType() const override;
58  CXXStdlibType GetCXXStdlibType(const llvm::opt::ArgList &Args) const override;
59  void AddClangSystemIncludeArgs(
60  const llvm::opt::ArgList &DriverArgs,
61  llvm::opt::ArgStringList &CC1Args) const override;
62  void AddClangCXXStdlibIncludeArgs(
63  const llvm::opt::ArgList &DriverArgs,
64  llvm::opt::ArgStringList &CC1Args) const override;
65  std::string getThreadModel() const override;
66 
67  const char *getDefaultLinker() const override {
68  return "lld";
69  }
70 
71  Tool *buildLinker() const override;
72 };
73 
74 } // end namespace toolchains
75 } // end namespace driver
76 } // end namespace clang
77 
78 #endif // LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_WEBASSEMBLY_H
InputInfo - Wrapper for information about an input source.
Definition: InputInfo.h:23
Driver - Encapsulate logic for constructing compilation processes from a set of gcc-driver-like comma...
Definition: Driver.h:65
Base class for all GNU tools that provide the same behavior when it comes to response files support...
Definition: Gnu.h:41
Dataflow Directional Tag Classes.
Tool - Information on a specific compilation tool.
Definition: Tool.h:34
Compilation - A set of tasks to perform for a single driver invocation.
Definition: Compilation.h:34
ToolChain - Access to tools for a single platform.
Definition: ToolChain.h:73