clang 10.0.0git

NaCl.h
Go to the documentation of this file.
1 //===--- NaCl.h - Native Client 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_NACL_H
10 #define LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_NACL_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 nacltools {
20 class LLVM_LIBRARY_VISIBILITY AssemblerARM : public gnutools::Assembler {
21 public:
22 AssemblerARM(const ToolChain &TC) : gnutools::Assembler(TC) {}
23
24 void ConstructJob(Compilation &C, const JobAction &JA,
25 const InputInfo &Output, const InputInfoList &Inputs,
26 const llvm::opt::ArgList &TCArgs,
27 const char *LinkingOutput) const override;
28 };
29
30 class LLVM_LIBRARY_VISIBILITY Linker : public GnuTool {
31 public:
32 Linker(const ToolChain &TC) : GnuTool("NaCl::Linker", "linker", TC) {}
33
34 bool hasIntegratedCPP() const override { return false; }
35 bool isLinkJob() const override { return true; }
36
37 void ConstructJob(Compilation &C, const JobAction &JA,
38 const InputInfo &Output, const InputInfoList &Inputs,
39 const llvm::opt::ArgList &TCArgs,
40 const char *LinkingOutput) const override;
41 };
42 } // end namespace nacltools
43 } // end namespace tools
44
45 namespace toolchains {
46
47 class LLVM_LIBRARY_VISIBILITY NaClToolChain : public Generic_ELF {
48 public:
49 NaClToolChain(const Driver &D, const llvm::Triple &Triple,
50 const llvm::opt::ArgList &Args);
51
52 void
53 AddClangSystemIncludeArgs(const llvm::opt::ArgList &DriverArgs,
54 llvm::opt::ArgStringList &CC1Args) const override;
55 void addLibCxxIncludePaths(
56 const llvm::opt::ArgList &DriverArgs,
57 llvm::opt::ArgStringList &CC1Args) const override;
58
59 CXXStdlibType GetCXXStdlibType(const llvm::opt::ArgList &Args) const override;
60
61 void AddCXXStdlibLibArgs(const llvm::opt::ArgList &Args,
62 llvm::opt::ArgStringList &CmdArgs) const override;
63
64 bool IsIntegratedAssemblerDefault() const override {
65 return getTriple().getArch() == llvm::Triple::mipsel;
66 }
67
68 // Get the path to the file containing NaCl's ARM macros.
69 // It lives in NaClToolChain because the ARMAssembler tool needs a
70 // const char * that it can pass around,
71 const char *GetNaClArmMacrosPath() const { return NaClArmMacrosPath.c_str(); }
72
73 std::string ComputeEffectiveClangTriple(const llvm::opt::ArgList &Args,
74 types::ID InputType) const override;
75
76 protected:
77 Tool *buildLinker() const override;
78 Tool *buildAssembler() const override;
79
80 private:
81 std::string NaClArmMacrosPath;
82 };
83
84 } // end namespace toolchains
85 } // end namespace driver
86 } // end namespace clang
87
88 #endif // LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_NACL_H
Tool.h
clang::driver::tools::nacltools::Linker::isLinkJob
bool isLinkJob() const override
Definition: NaCl.h:35
clang::driver::types::ID
ID
Definition: Types.h:23
clang::driver::tools::nacltools::Linker::hasIntegratedCPP
bool hasIntegratedCPP() const override
Definition: NaCl.h:34
clang::driver::ToolChain::CXXStdlibType
CXXStdlibType
Definition: ToolChain.h:92
clang::driver::JobAction
Definition: Action.h:375
clang::driver::toolchains::NaClToolChain::IsIntegratedAssemblerDefault
bool IsIntegratedAssemblerDefault() const override
IsIntegratedAssemblerDefault - Does this tool chain enable -integrated-as by default.
Definition: NaCl.h:64
clang::driver::InputInfo
InputInfo - Wrapper for information about an input source.
Definition: InputInfo.h:22
clang::driver::Driver
Driver - Encapsulate logic for constructing compilation processes from a set of gcc-driver-like comma...
Definition: Driver.h:59
clang::driver::tools::nacltools::AssemblerARM
Definition: NaCl.h:20
clang::driver::toolchains::Generic_ELF
Definition: Gnu.h:348
clang::driver::tools::nacltools::AssemblerARM::AssemblerARM
AssemblerARM(const ToolChain &TC)
Definition: NaCl.h:22
clang::driver::toolchains::NaClToolChain
Definition: NaCl.h:47
clang::driver::tools::nacltools::Linker
Definition: NaCl.h:30
clang::driver::tools::GnuTool
Base class for all GNU tools that provide the same behavior when it comes to response files support...
Definition: Gnu.h:40
ToolChain.h
llvm::SmallVector
Definition: LLVM.h:35
Gnu.h
clang::driver::toolchains::NaClToolChain::GetNaClArmMacrosPath
const char * GetNaClArmMacrosPath() const
Definition: NaCl.h:71
clang
Dataflow Directional Tag Classes.
Definition: CFGReachabilityAnalysis.h:21
clang::driver::tools::nacltools::Linker::Linker
Linker(const ToolChain &TC)
Definition: NaCl.h:32
clang::driver::Tool
Tool - Information on a specific compilation tool.
Definition: Tool.h:33
clang::driver::Compilation
Compilation - A set of tasks to perform for a single driver invocation.
Definition: Compilation.h:45
clang::driver::tools::gnutools::Assembler
Definition: Gnu.h:50
clang::driver::ToolChain
ToolChain - Access to tools for a single platform.
Definition: ToolChain.h:88