clang 23.0.0git
Serenity.h
Go to the documentation of this file.
1//===---- Serenity.h - SerenityOS ToolChain Implementation ------*- 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_SERENITY_H
10#define LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_SERENITY_H
11
12#include "Gnu.h"
14#include "clang/Driver/Tool.h"
16
17namespace clang {
18namespace driver {
19namespace tools {
20namespace serenity {
21
22class LLVM_LIBRARY_VISIBILITY Linker final : public Tool {
23public:
24 Linker(const ToolChain &TC) : Tool("serenity::Linker", "linker", TC) {}
25
26 bool hasIntegratedCPP() const override { return false; }
27 bool isLinkJob() const override { return true; }
28
29 void ConstructJob(Compilation &C, const JobAction &JA,
30 const InputInfo &Output, const InputInfoList &Inputs,
31 const llvm::opt::ArgList &TCArgs,
32 const char *LinkingOutput) const override;
33};
34} // end namespace serenity
35} // end namespace tools
36
37namespace toolchains {
38
39class LLVM_LIBRARY_VISIBILITY Serenity final : public Generic_ELF {
40public:
41 Serenity(const Driver &D, const llvm::Triple &Triple,
42 const llvm::opt::ArgList &Args);
43
44 void
45 AddClangSystemIncludeArgs(const llvm::opt::ArgList &DriverArgs,
46 llvm::opt::ArgStringList &CC1Args) const override;
47
51
55
56 const char *getDefaultLinker() const override { return "ld.lld"; }
57
58 std::string getDynamicLinker(const llvm::opt::ArgList &) const override {
59 return "/usr/lib/Loader.so";
60 }
61
62 bool HasNativeLLVMSupport() const override { return true; }
63
64 bool isPICDefault() const override { return true; }
65 bool isPIEDefault(const llvm::opt::ArgList &) const override { return true; }
66
67 SanitizerMask getSupportedSanitizers() const override;
68
69 bool IsMathErrnoDefault() const override { return false; }
70
71 UnwindTableLevel
72 getDefaultUnwindTableLevel(const llvm::opt::ArgList &Args) const override {
74 }
75
77 GetDefaultStackProtectorLevel(bool KernelOrKext) const override {
79 }
80
81protected:
82 Tool *buildLinker() const override;
83};
84
85} // end namespace toolchains
86} // end namespace driver
87} // end namespace clang
88
89#endif // LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_SERENITY_H
Defines the clang::LangOptions interface.
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:99
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
Tool(const char *Name, const char *ShortName, const ToolChain &TC)
Definition Tool.cpp:14
Generic_ELF(const Driver &D, const llvm::Triple &Triple, const llvm::opt::ArgList &Args)
Definition Gnu.h:439
CXXStdlibType GetDefaultCXXStdlibType() const override
Definition Serenity.h:52
UnwindTableLevel getDefaultUnwindTableLevel(const llvm::opt::ArgList &Args) const override
How detailed should the unwind tables be by default.
Definition Serenity.h:72
Serenity(const Driver &D, const llvm::Triple &Triple, const llvm::opt::ArgList &Args)
Definition Serenity.cpp:174
LangOptions::StackProtectorMode GetDefaultStackProtectorLevel(bool KernelOrKext) const override
GetDefaultStackProtectorLevel - Get the default stack protector level for this tool chain.
Definition Serenity.h:77
bool isPICDefault() const override
Test whether this toolchain defaults to PIC.
Definition Serenity.h:64
const char * getDefaultLinker() const override
GetDefaultLinker - Get the default linker to use.
Definition Serenity.h:56
bool IsMathErrnoDefault() const override
IsMathErrnoDefault - Does this tool chain use -fmath-errno by default.
Definition Serenity.h:69
bool HasNativeLLVMSupport() const override
HasNativeLTOLinker - Check whether the linker and related tools have native LLVM support.
Definition Serenity.h:62
bool isPIEDefault(const llvm::opt::ArgList &) const override
Test whether this toolchain defaults to PIE.
Definition Serenity.h:65
RuntimeLibType GetDefaultRuntimeLibType() const override
GetDefaultRuntimeLibType - Get the default runtime library variant to use.
Definition Serenity.h:48
std::string getDynamicLinker(const llvm::opt::ArgList &) const override
Definition Serenity.h:58
void AddClangSystemIncludeArgs(const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CC1Args) const override
Add the clang cc1 arguments for system include paths.
Definition Serenity.cpp:184
bool hasIntegratedCPP() const override
Definition Serenity.h:26
bool isLinkJob() const override
Definition Serenity.h:27
SmallVector< InputInfo, 4 > InputInfoList
Definition Driver.h:50
The JSON file list parser is used to communicate input to InstallAPI.