xref: /openbsd/gnu/llvm/clang/lib/Driver/ToolChains/AVR.h (revision 12c85518)
1e5dd7070Spatrick //===--- AVR.h - AVR Tool and ToolChain Implementations ---------*- C++ -*-===//
2e5dd7070Spatrick //
3e5dd7070Spatrick // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4e5dd7070Spatrick // See https://llvm.org/LICENSE.txt for license information.
5e5dd7070Spatrick // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6e5dd7070Spatrick //
7e5dd7070Spatrick //===----------------------------------------------------------------------===//
8e5dd7070Spatrick 
9e5dd7070Spatrick #ifndef LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_AVR_H
10e5dd7070Spatrick #define LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_AVR_H
11e5dd7070Spatrick 
12e5dd7070Spatrick #include "Gnu.h"
13a9ac8606Spatrick #include "clang/Driver/InputInfo.h"
14e5dd7070Spatrick #include "clang/Driver/Tool.h"
15*12c85518Srobert #include "clang/Driver/ToolChain.h"
16e5dd7070Spatrick 
17e5dd7070Spatrick namespace clang {
18e5dd7070Spatrick namespace driver {
19e5dd7070Spatrick namespace toolchains {
20e5dd7070Spatrick 
21e5dd7070Spatrick class LLVM_LIBRARY_VISIBILITY AVRToolChain : public Generic_ELF {
22e5dd7070Spatrick public:
23e5dd7070Spatrick   AVRToolChain(const Driver &D, const llvm::Triple &Triple,
24e5dd7070Spatrick                const llvm::opt::ArgList &Args);
25a9ac8606Spatrick   void
26a9ac8606Spatrick   AddClangSystemIncludeArgs(const llvm::opt::ArgList &DriverArgs,
27a9ac8606Spatrick                             llvm::opt::ArgStringList &CC1Args) const override;
28e5dd7070Spatrick 
29*12c85518Srobert   void
30*12c85518Srobert   addClangTargetOptions(const llvm::opt::ArgList &DriverArgs,
31*12c85518Srobert                         llvm::opt::ArgStringList &CC1Args,
32*12c85518Srobert                         Action::OffloadKind DeviceOffloadKind) const override;
33*12c85518Srobert 
34*12c85518Srobert   std::optional<std::string> findAVRLibcInstallation() const;
getGCCInstallPath()35*12c85518Srobert   StringRef getGCCInstallPath() const { return GCCInstallPath; }
36*12c85518Srobert   std::string getCompilerRT(const llvm::opt::ArgList &Args, StringRef Component,
37*12c85518Srobert                             FileType Type) const override;
38*12c85518Srobert 
39e5dd7070Spatrick protected:
40e5dd7070Spatrick   Tool *buildLinker() const override;
41e5dd7070Spatrick 
42e5dd7070Spatrick private:
43*12c85518Srobert   StringRef GCCInstallPath;
44e5dd7070Spatrick };
45e5dd7070Spatrick 
46e5dd7070Spatrick } // end namespace toolchains
47e5dd7070Spatrick 
48e5dd7070Spatrick namespace tools {
49e5dd7070Spatrick namespace AVR {
50ec727ea7Spatrick class LLVM_LIBRARY_VISIBILITY Linker : public Tool {
51e5dd7070Spatrick public:
Linker(const llvm::Triple & Triple,const ToolChain & TC)52*12c85518Srobert   Linker(const llvm::Triple &Triple, const ToolChain &TC)
53*12c85518Srobert       : Tool("AVR::Linker", "avr-ld", TC), Triple(Triple) {}
54e5dd7070Spatrick 
hasIntegratedCPP()55e5dd7070Spatrick   bool hasIntegratedCPP() const override { return false; }
isLinkJob()56e5dd7070Spatrick   bool isLinkJob() const override { return true; }
57e5dd7070Spatrick   void ConstructJob(Compilation &C, const JobAction &JA,
58e5dd7070Spatrick                     const InputInfo &Output, const InputInfoList &Inputs,
59e5dd7070Spatrick                     const llvm::opt::ArgList &TCArgs,
60e5dd7070Spatrick                     const char *LinkingOutput) const override;
61e5dd7070Spatrick 
62e5dd7070Spatrick protected:
63e5dd7070Spatrick   const llvm::Triple &Triple;
64e5dd7070Spatrick };
65e5dd7070Spatrick } // end namespace AVR
66e5dd7070Spatrick } // end namespace tools
67e5dd7070Spatrick } // end namespace driver
68e5dd7070Spatrick } // end namespace clang
69e5dd7070Spatrick 
70e5dd7070Spatrick #endif // LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_AVR_H
71