1 //===--- AVR.h - AVR Tool and 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_AVR_H
10 #define LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_AVR_H
13 #include "InputInfo.h"
14 #include "clang/Driver/ToolChain.h"
15 #include "clang/Driver/Tool.h"
19 namespace toolchains {
21 class LLVM_LIBRARY_VISIBILITY AVRToolChain : public Generic_ELF {
23 AVRToolChain(const Driver &D, const llvm::Triple &Triple,
24 const llvm::opt::ArgList &Args);
27 Tool *buildLinker() const override;
30 /// Whether libgcc, libct, and friends should be linked.
32 /// This is not done if the user does not specify a
33 /// microcontroller on the command line.
36 llvm::Optional<std::string> findAVRLibcInstallation() const;
39 } // end namespace toolchains
43 class LLVM_LIBRARY_VISIBILITY Linker : public GnuTool {
45 Linker(const llvm::Triple &Triple, const ToolChain &TC, bool LinkStdlib)
46 : GnuTool("AVR::Linker", "avr-ld", TC), Triple(Triple),
47 LinkStdlib(LinkStdlib) {}
49 bool hasIntegratedCPP() const override { return false; }
50 bool isLinkJob() const override { return true; }
51 void ConstructJob(Compilation &C, const JobAction &JA,
52 const InputInfo &Output, const InputInfoList &Inputs,
53 const llvm::opt::ArgList &TCArgs,
54 const char *LinkingOutput) const override;
57 const llvm::Triple &Triple;
60 } // end namespace AVR
61 } // end namespace tools
62 } // end namespace driver
63 } // end namespace clang
65 #endif // LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_AVR_H