clang  6.0.0svn
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"
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) { }
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.
AVRToolChain(const Driver &D, const llvm::Triple &Triple, const llvm::opt::ArgList &Args)
AVR Toolchain.
Definition: AVR.cpp:23
const char * getFilename() const
Definition: InputInfo.h:84
InputInfo - Wrapper for information about an input source.
Definition: InputInfo.h:23
Driver - Encapsulate logic for constructing compilation processes from a set of gcc-driver-like comma...
Definition: Driver.h:65
void addCommand(std::unique_ptr< Command > C)
Definition: Compilation.h:189
Dataflow Directional Tag Classes.
void AddLinkerInputs(const ToolChain &TC, const InputInfoList &Inputs, const llvm::opt::ArgList &Args, llvm::opt::ArgStringList &CmdArgs, const JobAction &JA)
Tool - Information on a specific compilation tool.
Definition: Tool.h:34
Tool * buildLinker() const override
Definition: AVR.cpp:26
Compilation - A set of tasks to perform for a single driver invocation.
Definition: Compilation.h:34