clang 10.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"
13 #include "InputInfo.h"
14 #include "clang/Driver/ToolChain.h"
15 #include "clang/Driver/Tool.h"
16
17 namespace clang {
18 namespace driver {
19 namespace toolchains {
20
21 class LLVM_LIBRARY_VISIBILITY AVRToolChain : public Generic_ELF {
22 public:
23 AVRToolChain(const Driver &D, const llvm::Triple &Triple,
24 const llvm::opt::ArgList &Args);
25
26 protected:
27 Tool *buildLinker() const override;
28
29 private:
30 /// Whether libgcc, libct, and friends should be linked.
31 ///
32 /// This is not done if the user does not specify a
33 /// microcontroller on the command line.
34 bool LinkStdlib;
35
36 llvm::Optional<std::string> findAVRLibcInstallation() const;
37 };
38
39 } // end namespace toolchains
40
41 namespace tools {
42 namespace AVR {
43 class LLVM_LIBRARY_VISIBILITY Linker : public GnuTool {
44 public:
45 Linker(const llvm::Triple &Triple, const ToolChain &TC, bool LinkStdlib)
46 : GnuTool("AVR::Linker", "avr-ld", TC), Triple(Triple),
47 LinkStdlib(LinkStdlib) {}
48
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;
55
56 protected:
57 const llvm::Triple &Triple;
58 bool LinkStdlib;
59 };
60 } // end namespace AVR
61 } // end namespace tools
62 } // end namespace driver
63 } // end namespace clang
64
65 #endif // LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_AVR_H
Tool.h
llvm::Optional< std::string >
clang::driver::tools::AVR::Linker::Linker
Linker(const llvm::Triple &Triple, const ToolChain &TC, bool LinkStdlib)
Definition: AVR.h:45
clang::driver::JobAction
Definition: Action.h:375
clang::driver::InputInfo
InputInfo - Wrapper for information about an input source.
Definition: InputInfo.h:22
clang::driver::tools::AVR::Linker
Definition: AVR.h:43
clang::driver::Driver
Driver - Encapsulate logic for constructing compilation processes from a set of gcc-driver-like comma...
Definition: Driver.h:59
clang::driver::toolchains::Generic_ELF
Definition: Gnu.h:348
clang::driver::toolchains::AVRToolChain
Definition: AVR.h:21
clang::driver::tools::AVR::Linker::hasIntegratedCPP
bool hasIntegratedCPP() const override
Definition: AVR.h:49
clang::driver::tools::GnuTool
Base class for all GNU tools that provide the same behavior when it comes to response files support...
Definition: Gnu.h:40
ToolChain.h
llvm::SmallVector
Definition: LLVM.h:35
Gnu.h
clang
Dataflow Directional Tag Classes.
Definition: CFGReachabilityAnalysis.h:21
clang::driver::Tool
Tool - Information on a specific compilation tool.
Definition: Tool.h:33
InputInfo.h
clang::driver::tools::AVR::Linker::Triple
const llvm::Triple & Triple
Definition: AVR.h:57
clang::driver::Compilation
Compilation - A set of tasks to perform for a single driver invocation.
Definition: Compilation.h:45
clang::driver::tools::AVR::Linker::LinkStdlib
bool LinkStdlib
Definition: AVR.h:58
clang::driver::tools::AVR::Linker::isLinkJob
bool isLinkJob() const override
Definition: AVR.h:50
clang::driver::ToolChain
ToolChain - Access to tools for a single platform.
Definition: ToolChain.h:88