clang 20.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"
15
16namespace clang {
17namespace driver {
18namespace tools {
19namespace nacltools {
20class LLVM_LIBRARY_VISIBILITY AssemblerARM : public gnutools::Assembler {
21public:
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
30class LLVM_LIBRARY_VISIBILITY Linker final : public Tool {
31public:
32 Linker(const ToolChain &TC) : Tool("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
45namespace toolchains {
46
47class LLVM_LIBRARY_VISIBILITY NaClToolChain : public Generic_ELF {
48public:
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
76protected:
77 Tool *buildLinker() const override;
78 Tool *buildAssembler() const override;
79
80private:
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
const Decl * D
Compilation - A set of tasks to perform for a single driver invocation.
Definition: Compilation.h:45
Driver - Encapsulate logic for constructing compilation processes from a set of gcc-driver-like comma...
Definition: Driver.h:77
InputInfo - Wrapper for information about an input source.
Definition: InputInfo.h:22
ToolChain - Access to tools for a single platform.
Definition: ToolChain.h:92
Tool - Information on a specific compilation tool.
Definition: Tool.h:32
const char * GetNaClArmMacrosPath() const
Definition: NaCl.h:71
bool IsIntegratedAssemblerDefault() const override
IsIntegratedAssemblerDefault - Does this tool chain enable -integrated-as by default.
Definition: NaCl.h:64
bool hasIntegratedCPP() const override
Definition: NaCl.h:34
Linker(const ToolChain &TC)
Definition: NaCl.h:32
bool isLinkJob() const override
Definition: NaCl.h:35
The JSON file list parser is used to communicate input to InstallAPI.