clang 22.0.0git
UEFI.h
Go to the documentation of this file.
1//===--- UEFI.h - UEFI 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_UEFI_H
10#define LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_UEFI_H
11
12#include "clang/Driver/Tool.h"
14
15namespace clang::driver {
16namespace tools {
17namespace uefi {
18class LLVM_LIBRARY_VISIBILITY Linker : public Tool {
19public:
20 Linker(const ToolChain &TC) : Tool("uefi::Linker", "lld-link", TC) {}
21
22 bool hasIntegratedCPP() const override { return false; }
23 bool isLinkJob() const override { return true; }
24
25 void ConstructJob(Compilation &C, const JobAction &JA,
26 const InputInfo &Output, const InputInfoList &Inputs,
27 const llvm::opt::ArgList &TCArgs,
28 const char *LinkingOutput) const override;
29};
30} // end namespace uefi
31} // end namespace tools
32
33namespace toolchains {
34
35class LLVM_LIBRARY_VISIBILITY UEFI : public ToolChain {
36public:
37 UEFI(const Driver &D, const llvm::Triple &Triple,
38 const llvm::opt::ArgList &Args);
39
40protected:
41 Tool *buildLinker() const override;
42
43public:
44 bool HasNativeLLVMSupport() const override { return true; }
45 UnwindTableLevel
46 getDefaultUnwindTableLevel(const llvm::opt::ArgList &Args) const override {
48 }
49 bool isPICDefault() const override { return true; }
50 bool isPIEDefault(const llvm::opt::ArgList &Args) const override {
51 return false;
52 }
53 bool isPICDefaultForced() const override { return true; }
54
55 void
56 AddClangSystemIncludeArgs(const llvm::opt::ArgList &DriverArgs,
57 llvm::opt::ArgStringList &CC1Args) const override;
58
59 llvm::codegenoptions::DebugInfoFormat getDefaultDebugFormat() const override {
60 return llvm::codegenoptions::DIF_CodeView;
61 }
62};
63
64} // namespace toolchains
65} // namespace clang::driver
66
67#endif // LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_UEFI_H
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
ToolChain(const Driver &D, const llvm::Triple &T, const llvm::opt::ArgList &Args)
Definition ToolChain.cpp:89
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
Tool * buildLinker() const override
Definition UEFI.cpp:29
bool isPIEDefault(const llvm::opt::ArgList &Args) const override
Test whether this toolchain defaults to PIE.
Definition UEFI.h:50
UEFI(const Driver &D, const llvm::Triple &Triple, const llvm::opt::ArgList &Args)
Definition UEFI.cpp:26
bool HasNativeLLVMSupport() const override
HasNativeLTOLinker - Check whether the linker and related tools have native LLVM support.
Definition UEFI.h:44
UnwindTableLevel getDefaultUnwindTableLevel(const llvm::opt::ArgList &Args) const override
How detailed should the unwind tables be by default.
Definition UEFI.h:46
bool isPICDefault() const override
Test whether this toolchain defaults to PIC.
Definition UEFI.h:49
bool isPICDefaultForced() const override
Tests whether this toolchain forces its default for PIC, PIE or non-PIC.
Definition UEFI.h:53
llvm::codegenoptions::DebugInfoFormat getDefaultDebugFormat() const override
Get the default debug info format. Typically, this is DWARF.
Definition UEFI.h:59
bool isLinkJob() const override
Definition UEFI.h:23
Linker(const ToolChain &TC)
Definition UEFI.h:20
bool hasIntegratedCPP() const override
Definition UEFI.h:22
SmallVector< InputInfo, 4 > InputInfoList
Definition Driver.h:50