clang 23.0.0git
AVR.h
Go to the documentation of this file.
1//===--- AVR.h - AVR Tool and 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_AVR_H
10#define LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_AVR_H
11
12#include "Gnu.h"
14#include "clang/Driver/Tool.h"
16
17namespace clang {
18namespace driver {
19namespace toolchains {
20
21class LLVM_LIBRARY_VISIBILITY AVRToolChain : public Generic_ELF {
22public:
23 AVRToolChain(const Driver &D, const llvm::Triple &Triple,
24 const llvm::opt::ArgList &Args);
25 void
26 AddClangSystemIncludeArgs(const llvm::opt::ArgList &DriverArgs,
27 llvm::opt::ArgStringList &CC1Args) const override;
28
29 void
30 addClangTargetOptions(const llvm::opt::ArgList &DriverArgs,
31 llvm::opt::ArgStringList &CC1Args,
32 llvm::StringRef BoundArch,
33 Action::OffloadKind DeviceOffloadKind) const override;
34
35 std::optional<std::string> findAVRLibcInstallation() const;
36 StringRef getGCCInstallPath() const { return GCCInstallPath; }
37 std::string getCompilerRT(const llvm::opt::ArgList &Args, StringRef Component,
39 bool IsFortran = false) const override;
40
41 bool HasNativeLLVMSupport() const override { return true; }
42
43protected:
44 Tool *buildLinker() const override;
45
46private:
47 StringRef GCCInstallPath;
48};
49
50} // end namespace toolchains
51
52namespace tools {
53namespace AVR {
54class LLVM_LIBRARY_VISIBILITY Linker final : public Tool {
55public:
56 Linker(const llvm::Triple &Triple, const ToolChain &TC)
57 : Tool("AVR::Linker", "avr-ld", TC), Triple(Triple) {}
58
59 bool hasIntegratedCPP() const override { return false; }
60 bool isLinkJob() const override { return true; }
61 void ConstructJob(Compilation &C, const JobAction &JA,
62 const InputInfo &Output, const InputInfoList &Inputs,
63 const llvm::opt::ArgList &TCArgs,
64 const char *LinkingOutput) const override;
65
66protected:
67 const llvm::Triple &Triple;
68};
69} // end namespace AVR
70} // end namespace tools
71} // end namespace driver
72} // end namespace clang
73
74#endif // LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_AVR_H
llvm::MachO::FileType FileType
Definition MachO.h:46
The base class of the type hierarchy.
Definition TypeBase.h:1875
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:94
InputInfo - Wrapper for information about an input source.
Definition InputInfo.h:22
ToolChain - Access to tools for a single platform.
Definition ToolChain.h:95
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
std::optional< std::string > findAVRLibcInstallation() const
Definition AVR.cpp:661
void AddClangSystemIncludeArgs(const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CC1Args) const override
Add the clang cc1 arguments for system include paths.
Definition AVR.cpp:450
bool HasNativeLLVMSupport() const override
HasNativeLTOLinker - Check whether the linker and related tools have native LLVM support.
Definition AVR.h:41
void addClangTargetOptions(const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CC1Args, llvm::StringRef BoundArch, Action::OffloadKind DeviceOffloadKind) const override
Add options that need to be passed to cc1 for this target.
Definition AVR.cpp:467
AVRToolChain(const Driver &D, const llvm::Triple &Triple, const llvm::opt::ArgList &Args)
AVR Toolchain.
Definition AVR.cpp:433
StringRef getGCCInstallPath() const
Definition AVR.h:36
Generic_ELF(const Driver &D, const llvm::Triple &Triple, const llvm::opt::ArgList &Args)
Definition Gnu.h:439
const llvm::Triple & Triple
Definition AVR.h:67
Linker(const llvm::Triple &Triple, const ToolChain &TC)
Definition AVR.h:56
bool isLinkJob() const override
Definition AVR.h:60
bool hasIntegratedCPP() const override
Definition AVR.h:59
SmallVector< InputInfo, 4 > InputInfoList
Definition Driver.h:50
The JSON file list parser is used to communicate input to InstallAPI.