clang 8.0.0

AVR.cpp
Go to the documentation of this file.
1 //===--- AVR.cpp - AVR ToolChain Implementations ----------------*- C++ -*-===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9
10 #include "AVR.h"
11 #include "CommonArgs.h"
12 #include "InputInfo.h"
13 #include "clang/Driver/Compilation.h"
14 #include "llvm/Option/ArgList.h"
15
16 using namespace clang::driver;
17 using namespace clang::driver::toolchains;
18 using namespace clang::driver::tools;
19 using namespace clang;
20 using namespace llvm::opt;
21
22 /// AVR Toolchain
23 AVRToolChain::AVRToolChain(const Driver &D, const llvm::Triple &Triple,
24 const ArgList &Args)
25 : Generic_ELF(D, Triple, Args) { }
26 Tool *AVRToolChain::buildLinker() const {
27 return new tools::AVR::Linker(*this);
28 }
29
30 void AVR::Linker::ConstructJob(Compilation &C, const JobAction &JA,
31 const InputInfo &Output,
32 const InputInfoList &Inputs,
33 const ArgList &Args,
34 const char *LinkingOutput) const {
35
36 std::string Linker = getToolChain().GetProgramPath(getShortName());
37 ArgStringList CmdArgs;
38 AddLinkerInputs(getToolChain(), Inputs, Args, CmdArgs, JA);
39 CmdArgs.push_back("-o");
40 CmdArgs.push_back(Output.getFilename());
41 C.addCommand(llvm::make_unique<Command>(JA, *this, Args.MakeArgString(Linker),
42 CmdArgs, Inputs));
43 }
44 // AVR tools end.
clang::driver::toolchains::AVRToolChain::AVRToolChain
AVRToolChain(const Driver &D, const llvm::Triple &Triple, const llvm::opt::ArgList &Args)
AVR Toolchain.
Definition: AVR.cpp:23
AVR.h
clang::driver::InputInfo::getFilename
const char * getFilename() const
Definition: InputInfo.h:84
CommonArgs.h
clang::driver::JobAction
Definition: Action.h:374
clang::driver::tools
Definition: AMDGPU.h:21
clang::driver::InputInfo
InputInfo - Wrapper for information about an input source.
Definition: InputInfo.h:23
clang::driver::tools::AVR::Linker
Definition: AVR.h:34
clang::driver::Driver
Driver - Encapsulate logic for constructing compilation processes from a set of gcc-driver-like comma...
Definition: Driver.h:58
Compilation.h
clang::driver::toolchains::Generic_ELF
Definition: Gnu.h:340
llvm::opt
Definition: Action.h:24
clang::driver::Compilation::addCommand
void addCommand(std::unique_ptr< Command > C)
Definition: Compilation.h:206
llvm::SmallVector
Definition: LLVM.h:36
clang
Dataflow Directional Tag Classes.
Definition: CFGReachabilityAnalysis.h:22
clang::driver::tools::AddLinkerInputs
void AddLinkerInputs(const ToolChain &TC, const InputInfoList &Inputs, const llvm::opt::ArgList &Args, llvm::opt::ArgStringList &CmdArgs, const JobAction &JA)
clang::driver::Tool
Tool - Information on a specific compilation tool.
Definition: Tool.h:34
InputInfo.h
clang::driver::toolchains::AVRToolChain::buildLinker
Tool * buildLinker() const override
Definition: AVR.cpp:26
clang::driver::Compilation
Compilation - A set of tasks to perform for a single driver invocation.
Definition: Compilation.h:46
clang::driver
Definition: Action.h:32
clang::driver::toolchains
Definition: AMDGPU.h:41