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"
13#include "clang/Driver/InputInfo.h"
14#include "clang/Driver/Tool.h"
15#include "clang/Driver/ToolChain.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 Action::OffloadKind DeviceOffloadKind) const override;
33
34 std::optional<std::string> findAVRLibcInstallation() const;
35 StringRef getGCCInstallPath() const { return GCCInstallPath; }
36 std::string getCompilerRT(const llvm::opt::ArgList &Args, StringRef Component,
37 FileType Type,
38 bool IsFortran = false) const override;
39
40 bool HasNativeLLVMSupport() const override { return true; }
41
42protected:
43 Tool *buildLinker() const override;
44
45private:
46 StringRef GCCInstallPath;
47};
48
49} // end namespace toolchains
50
51namespace tools {
52namespace AVR {
53class LLVM_LIBRARY_VISIBILITY Linker final : public Tool {
54public:
55 Linker(const llvm::Triple &Triple, const ToolChain &TC)
56 : Tool("AVR::Linker", "avr-ld", TC), Triple(Triple) {}
57
58 bool hasIntegratedCPP() const override { return false; }
59 bool isLinkJob() const override { return true; }
60 void ConstructJob(Compilation &C, const JobAction &JA,
61 const InputInfo &Output, const InputInfoList &Inputs,
62 const llvm::opt::ArgList &TCArgs,
63 const char *LinkingOutput) const override;
64
65protected:
66 const llvm::Triple &Triple;
67};
68} // end namespace AVR
69} // end namespace tools
70} // end namespace driver
71} // end namespace clang
72
73#endif // LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_AVR_H
74

Provided by KDAB

Privacy Policy
Update your C++ knowledge – Modern C++11/14/17 Training
Find out more

source code of clang/lib/Driver/ToolChains/AVR.h