1 //===--- UEFI.h - UEFI ToolChain Implementations ----------*- C++ -*-===//
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
7 //===----------------------------------------------------------------------===//
9 #ifndef LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_UEFI_H
10 #define LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_UEFI_H
12 #include "clang/Driver/Tool.h"
13 #include "clang/Driver/ToolChain.h"
15 namespace clang::driver
{
18 class LLVM_LIBRARY_VISIBILITY Linker
: public Tool
{
20 Linker(const ToolChain
&TC
) : Tool("uefi::Linker", "lld-link", TC
) {}
22 bool hasIntegratedCPP() const override
{ return false; }
23 bool isLinkJob() const override
{ return true; }
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
;
30 } // end namespace uefi
31 } // end namespace tools
33 namespace toolchains
{
35 class LLVM_LIBRARY_VISIBILITY UEFI
: public ToolChain
{
37 UEFI(const Driver
&D
, const llvm::Triple
&Triple
,
38 const llvm::opt::ArgList
&Args
);
41 Tool
*buildLinker() const override
;
44 bool HasNativeLLVMSupport() const override
{ return true; }
46 getDefaultUnwindTableLevel(const llvm::opt::ArgList
&Args
) const override
{
47 return UnwindTableLevel::Asynchronous
;
49 bool isPICDefault() const override
{ return true; }
50 bool isPIEDefault(const llvm::opt::ArgList
&Args
) const override
{
53 bool isPICDefaultForced() const override
{ return true; }
56 } // namespace toolchains
57 } // namespace clang::driver
59 #endif // LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_UEFI_H