clang 17.0.0git
CrossWindows.h
Go to the documentation of this file.
1//===--- CrossWindows.h - CrossWindows 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_CROSSWINDOWS_H
10#define LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_CROSSWINDOWS_H
11
12#include "Cuda.h"
13#include "Gnu.h"
15#include "clang/Driver/Tool.h"
17
18namespace clang {
19namespace driver {
20namespace tools {
21
22namespace CrossWindows {
23class LLVM_LIBRARY_VISIBILITY Assembler : public Tool {
24public:
25 Assembler(const ToolChain &TC) : Tool("CrossWindows::Assembler", "as", TC) {}
26
27 bool hasIntegratedCPP() const override { return false; }
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
35class LLVM_LIBRARY_VISIBILITY Linker : public Tool {
36public:
37 Linker(const ToolChain &TC) : Tool("CrossWindows::Linker", "ld", TC) {}
38
39 bool hasIntegratedCPP() const override { return false; }
40 bool isLinkJob() const override { return true; }
41
42 void ConstructJob(Compilation &C, const JobAction &JA,
43 const InputInfo &Output, const InputInfoList &Inputs,
44 const llvm::opt::ArgList &TCArgs,
45 const char *LinkingOutput) const override;
46};
47} // end namespace CrossWindows
48} // end namespace tools
49
50namespace toolchains {
51
52class LLVM_LIBRARY_VISIBILITY CrossWindowsToolChain : public Generic_GCC {
53public:
54 CrossWindowsToolChain(const Driver &D, const llvm::Triple &T,
55 const llvm::opt::ArgList &Args);
56
57 bool IsIntegratedAssemblerDefault() const override { return true; }
58 UnwindTableLevel
59 getDefaultUnwindTableLevel(const llvm::opt::ArgList &Args) const override;
60 bool isPICDefault() const override;
61 bool isPIEDefault(const llvm::opt::ArgList &Args) const override;
62 bool isPICDefaultForced() const override;
63
65 GetDefaultStackProtectorLevel(bool KernelOrKext) const override {
66 return LangOptions::SSPOff;
67 }
68
69 void
70 AddClangSystemIncludeArgs(const llvm::opt::ArgList &DriverArgs,
71 llvm::opt::ArgStringList &CC1Args) const override;
72 void AddClangCXXStdlibIncludeArgs(
73 const llvm::opt::ArgList &DriverArgs,
74 llvm::opt::ArgStringList &CC1Args) const override;
75 void AddCXXStdlibLibArgs(const llvm::opt::ArgList &Args,
76 llvm::opt::ArgStringList &CmdArgs) const override;
77
78 SanitizerMask getSupportedSanitizers() const override;
79
80protected:
81 Tool *buildLinker() const override;
82 Tool *buildAssembler() const override;
83};
84
85} // end namespace toolchains
86} // end namespace driver
87} // end namespace clang
88
89#endif // LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_CROSSWINDOWS_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:76
InputInfo - Wrapper for information about an input source.
Definition: InputInfo.h:22
ToolChain - Access to tools for a single platform.
Definition: ToolChain.h:91
Tool - Information on a specific compilation tool.
Definition: Tool.h:32
bool IsIntegratedAssemblerDefault() const override
IsIntegratedAssemblerDefault - Does this tool chain enable -integrated-as by default.
Definition: CrossWindows.h:57
LangOptions::StackProtectorMode GetDefaultStackProtectorLevel(bool KernelOrKext) const override
GetDefaultStackProtectorLevel - Get the default stack protector level for this tool chain.
Definition: CrossWindows.h:65
Generic_GCC - A tool chain using the 'gcc' command to perform all subcommands; this relies on gcc tra...
Definition: Gnu.h:144