clang  9.0.0svn
WebAssembly.h
Go to the documentation of this file.
1 //===--- WebAssembly.h - WebAssembly ToolChain Implementations --*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #ifndef LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_WEBASSEMBLY_H
10 #define LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_WEBASSEMBLY_H
11 
12 #include "Gnu.h"
13 #include "clang/Driver/Tool.h"
14 #include "clang/Driver/ToolChain.h"
15 
16 namespace clang {
17 namespace driver {
18 namespace tools {
19 namespace wasm {
20 
21 class LLVM_LIBRARY_VISIBILITY Linker : public GnuTool {
22 public:
23  explicit Linker(const ToolChain &TC);
24  bool isLinkJob() const override;
25  bool hasIntegratedCPP() const override;
26  std::string getLinkerPath(const llvm::opt::ArgList &Args) const;
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
55  addClangTargetOptions(const llvm::opt::ArgList &DriverArgs,
56  llvm::opt::ArgStringList &CC1Args,
57  Action::OffloadKind DeviceOffloadKind) const override;
58  RuntimeLibType GetDefaultRuntimeLibType() const override;
59  CXXStdlibType GetCXXStdlibType(const llvm::opt::ArgList &Args) const override;
60  void
61  AddClangSystemIncludeArgs(const llvm::opt::ArgList &DriverArgs,
62  llvm::opt::ArgStringList &CC1Args) const override;
63  void AddClangCXXStdlibIncludeArgs(
64  const llvm::opt::ArgList &DriverArgs,
65  llvm::opt::ArgStringList &CC1Args) const override;
66  void AddCXXStdlibLibArgs(const llvm::opt::ArgList &Args,
67  llvm::opt::ArgStringList &CmdArgs) const override;
68 
69  const char *getDefaultLinker() const override { return "wasm-ld"; }
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:22
Driver - Encapsulate logic for constructing compilation processes from a set of gcc-driver-like comma...
Definition: Driver.h:57
Base class for all GNU tools that provide the same behavior when it comes to response files support...
Definition: Gnu.h:40
Dataflow Directional Tag Classes.
Tool - Information on a specific compilation tool.
Definition: Tool.h:33
Compilation - A set of tasks to perform for a single driver invocation.
Definition: Compilation.h:45
ToolChain - Access to tools for a single platform.
Definition: ToolChain.h:88