clang  13.0.0git
AVR.cpp
Go to the documentation of this file.
1 //===--- AVR.cpp - AVR 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 #include "AVR.h"
10 #include "CommonArgs.h"
11 #include "InputInfo.h"
14 #include "clang/Driver/Options.h"
15 #include "llvm/ADT/Optional.h"
16 #include "llvm/ADT/StringExtras.h"
17 #include "llvm/ADT/StringSwitch.h"
18 #include "llvm/MC/MCSubtargetInfo.h"
19 #include "llvm/MC/SubtargetFeature.h"
20 #include "llvm/Option/ArgList.h"
21 #include "llvm/Support/FileSystem.h"
22 
23 using namespace clang::driver;
24 using namespace clang::driver::toolchains;
25 using namespace clang::driver::tools;
26 using namespace clang;
27 using namespace llvm::opt;
28 
29 namespace {
30 
31 const struct {
32  StringRef Name;
33  std::string SubPath;
34  StringRef Family;
35  unsigned DataAddr;
36 } MCUInfo[] = {
37  {"at90s1200", "", "avr1", 0},
38  {"attiny11", "", "avr1", 0},
39  {"attiny12", "", "avr1", 0},
40  {"attiny15", "", "avr1", 0},
41  {"attiny28", "", "avr1", 0},
42  {"at90s2313", "tiny-stack", "avr2", 0x800060},
43  {"at90s2323", "tiny-stack", "avr2", 0x800060},
44  {"at90s2333", "tiny-stack", "avr2", 0x800060},
45  {"at90s2343", "tiny-stack", "avr2", 0x800060},
46  {"at90s4433", "tiny-stack", "avr2", 0x800060},
47  {"attiny22", "tiny-stack", "avr2", 0x800060},
48  {"attiny26", "tiny-stack", "avr2", 0x800060},
49  {"at90s4414", "", "avr2", 0x800060},
50  {"at90s4434", "", "avr2", 0x800060},
51  {"at90s8515", "", "avr2", 0x800060},
52  {"at90c8534", "", "avr2", 0x800060},
53  {"at90s8535", "", "avr2", 0x800060},
54  {"attiny13", "avr25/tiny-stack", "avr25", 0x800060},
55  {"attiny13a", "avr25/tiny-stack", "avr25", 0x800060},
56  {"attiny2313", "avr25/tiny-stack", "avr25", 0x800060},
57  {"attiny2313a", "avr25/tiny-stack", "avr25", 0x800060},
58  {"attiny24", "avr25/tiny-stack", "avr25", 0x800060},
59  {"attiny24a", "avr25/tiny-stack", "avr25", 0x800060},
60  {"attiny25", "avr25/tiny-stack", "avr25", 0x800060},
61  {"attiny261", "avr25/tiny-stack", "avr25", 0x800060},
62  {"attiny261a", "avr25/tiny-stack", "avr25", 0x800060},
63  {"at86rf401", "avr25", "avr25", 0x800060},
64  {"ata5272", "avr25", "avr25", 0x800100},
65  {"attiny4313", "avr25", "avr25", 0x800060},
66  {"attiny44", "avr25", "avr25", 0x800060},
67  {"attiny44a", "avr25", "avr25", 0x800060},
68  {"attiny84", "avr25", "avr25", 0x800060},
69  {"attiny84a", "avr25", "avr25", 0x800060},
70  {"attiny45", "avr25", "avr25", 0x800060},
71  {"attiny85", "avr25", "avr25", 0x800060},
72  {"attiny441", "avr25", "avr25", 0x800100},
73  {"attiny461", "avr25", "avr25", 0x800060},
74  {"attiny461a", "avr25", "avr25", 0x800060},
75  {"attiny841", "avr25", "avr25", 0x800100},
76  {"attiny861", "avr25", "avr25", 0x800060},
77  {"attiny861a", "avr25", "avr25", 0x800060},
78  {"attiny87", "avr25", "avr25", 0x800100},
79  {"attiny43u", "avr25", "avr25", 0x800060},
80  {"attiny48", "avr25", "avr25", 0x800100},
81  {"attiny88", "avr25", "avr25", 0x800100},
82  {"attiny828", "avr25", "avr25", 0x800100},
83  {"at43usb355", "avr3", "avr3", 0x800100},
84  {"at76c711", "avr3", "avr3", 0x800060},
85  {"atmega103", "avr31", "avr31", 0x800060},
86  {"at43usb320", "avr31", "avr31", 0x800060},
87  {"attiny167", "avr35", "avr35", 0x800100},
88  {"at90usb82", "avr35", "avr35", 0x800100},
89  {"at90usb162", "avr35", "avr35", 0x800100},
90  {"ata5505", "avr35", "avr35", 0x800100},
91  {"atmega8u2", "avr35", "avr35", 0x800100},
92  {"atmega16u2", "avr35", "avr35", 0x800100},
93  {"atmega32u2", "avr35", "avr35", 0x800100},
94  {"attiny1634", "avr35", "avr35", 0x800100},
95  {"atmega8", "avr4", "avr4", 0x800060},
96  {"ata6289", "avr4", "avr4", 0x800100},
97  {"atmega8a", "avr4", "avr4", 0x800060},
98  {"ata6285", "avr4", "avr4", 0x800100},
99  {"ata6286", "avr4", "avr4", 0x800100},
100  {"atmega48", "avr4", "avr4", 0x800100},
101  {"atmega48a", "avr4", "avr4", 0x800100},
102  {"atmega48pa", "avr4", "avr4", 0x800100},
103  {"atmega48pb", "avr4", "avr4", 0x800100},
104  {"atmega48p", "avr4", "avr4", 0x800100},
105  {"atmega88", "avr4", "avr4", 0x800100},
106  {"atmega88a", "avr4", "avr4", 0x800100},
107  {"atmega88p", "avr4", "avr4", 0x800100},
108  {"atmega88pa", "avr4", "avr4", 0x800100},
109  {"atmega88pb", "avr4", "avr4", 0x800100},
110  {"atmega8515", "avr4", "avr4", 0x800060},
111  {"atmega8535", "avr4", "avr4", 0x800060},
112  {"atmega8hva", "avr4", "avr4", 0x800100},
113  {"at90pwm1", "avr4", "avr4", 0x800100},
114  {"at90pwm2", "avr4", "avr4", 0x800100},
115  {"at90pwm2b", "avr4", "avr4", 0x800100},
116  {"at90pwm3", "avr4", "avr4", 0x800100},
117  {"at90pwm3b", "avr4", "avr4", 0x800100},
118  {"at90pwm81", "avr4", "avr4", 0x800100},
119  {"ata5790", "avr5", "avr5", 0x800100},
120  {"ata5795", "avr5", "avr5", 0x800100},
121  {"atmega16", "avr5", "avr5", 0x800060},
122  {"atmega16a", "avr5", "avr5", 0x800060},
123  {"atmega161", "avr5", "avr5", 0x800060},
124  {"atmega162", "avr5", "avr5", 0x800100},
125  {"atmega163", "avr5", "avr5", 0x800060},
126  {"atmega164a", "avr5", "avr5", 0x800100},
127  {"atmega164p", "avr5", "avr5", 0x800100},
128  {"atmega164pa", "avr5", "avr5", 0x800100},
129  {"atmega165", "avr5", "avr5", 0x800100},
130  {"atmega165a", "avr5", "avr5", 0x800100},
131  {"atmega165p", "avr5", "avr5", 0x800100},
132  {"atmega165pa", "avr5", "avr5", 0x800100},
133  {"atmega168", "avr5", "avr5", 0x800100},
134  {"atmega168a", "avr5", "avr5", 0x800100},
135  {"atmega168p", "avr5", "avr5", 0x800100},
136  {"atmega168pa", "avr5", "avr5", 0x800100},
137  {"atmega168pb", "avr5", "avr5", 0x800100},
138  {"atmega169", "avr5", "avr5", 0x800100},
139  {"atmega169a", "avr5", "avr5", 0x800100},
140  {"atmega169p", "avr5", "avr5", 0x800100},
141  {"atmega169pa", "avr5", "avr5", 0x800100},
142  {"atmega32", "avr5", "avr5", 0x800060},
143  {"atmega32a", "avr5", "avr5", 0x800060},
144  {"atmega323", "avr5", "avr5", 0x800060},
145  {"atmega324a", "avr5", "avr5", 0x800100},
146  {"atmega324p", "avr5", "avr5", 0x800100},
147  {"atmega324pa", "avr5", "avr5", 0x800100},
148  {"atmega325", "avr5", "avr5", 0x800100},
149  {"atmega325a", "avr5", "avr5", 0x800100},
150  {"atmega325p", "avr5", "avr5", 0x800100},
151  {"atmega325pa", "avr5", "avr5", 0x800100},
152  {"atmega3250", "avr5", "avr5", 0x800100},
153  {"atmega3250a", "avr5", "avr5", 0x800100},
154  {"atmega3250p", "avr5", "avr5", 0x800100},
155  {"atmega3250pa", "avr5", "avr5", 0x800100},
156  {"atmega328", "avr5", "avr5", 0x800100},
157  {"atmega328p", "avr5", "avr5", 0x800100},
158  {"atmega329", "avr5", "avr5", 0x800100},
159  {"atmega329a", "avr5", "avr5", 0x800100},
160  {"atmega329p", "avr5", "avr5", 0x800100},
161  {"atmega329pa", "avr5", "avr5", 0x800100},
162  {"atmega3290", "avr5", "avr5", 0x800100},
163  {"atmega3290a", "avr5", "avr5", 0x800100},
164  {"atmega3290p", "avr5", "avr5", 0x800100},
165  {"atmega3290pa", "avr5", "avr5", 0x800100},
166  {"atmega406", "avr5", "avr5", 0x800100},
167  {"atmega64", "avr5", "avr5", 0x800100},
168  {"atmega64a", "avr5", "avr5", 0x800100},
169  {"atmega640", "avr5", "avr5", 0x800200},
170  {"atmega644", "avr5", "avr5", 0x800100},
171  {"atmega644a", "avr5", "avr5", 0x800100},
172  {"atmega644p", "avr5", "avr5", 0x800100},
173  {"atmega644pa", "avr5", "avr5", 0x800100},
174  {"atmega645", "avr5", "avr5", 0x800100},
175  {"atmega645a", "avr5", "avr5", 0x800100},
176  {"atmega645p", "avr5", "avr5", 0x800100},
177  {"atmega649", "avr5", "avr5", 0x800100},
178  {"atmega649a", "avr5", "avr5", 0x800100},
179  {"atmega649p", "avr5", "avr5", 0x800100},
180  {"atmega6450", "avr5", "avr5", 0x800100},
181  {"atmega6450a", "avr5", "avr5", 0x800100},
182  {"atmega6450p", "avr5", "avr5", 0x800100},
183  {"atmega6490", "avr5", "avr5", 0x800100},
184  {"atmega6490a", "avr5", "avr5", 0x800100},
185  {"atmega6490p", "avr5", "avr5", 0x800100},
186  {"atmega64rfr2", "avr5", "avr5", 0x800200},
187  {"atmega644rfr2", "avr5", "avr5", 0x800200},
188  {"atmega16hva", "avr5", "avr5", 0x800100},
189  {"atmega16hva2", "avr5", "avr5", 0x800100},
190  {"atmega16hvb", "avr5", "avr5", 0x800100},
191  {"atmega16hvbrevb", "avr5", "avr5", 0x800100},
192  {"atmega32hvb", "avr5", "avr5", 0x800100},
193  {"atmega32hvbrevb", "avr5", "avr5", 0x800100},
194  {"atmega64hve", "avr5", "avr5", 0x800100},
195  {"at90can32", "avr5", "avr5", 0x800100},
196  {"at90can64", "avr5", "avr5", 0x800100},
197  {"at90pwm161", "avr5", "avr5", 0x800100},
198  {"at90pwm216", "avr5", "avr5", 0x800100},
199  {"at90pwm316", "avr5", "avr5", 0x800100},
200  {"atmega32c1", "avr5", "avr5", 0x800100},
201  {"atmega64c1", "avr5", "avr5", 0x800100},
202  {"atmega16m1", "avr5", "avr5", 0x800100},
203  {"atmega32m1", "avr5", "avr5", 0x800100},
204  {"atmega64m1", "avr5", "avr5", 0x800100},
205  {"atmega16u4", "avr5", "avr5", 0x800100},
206  {"atmega32u4", "avr5", "avr5", 0x800100},
207  {"atmega32u6", "avr5", "avr5", 0x800100},
208  {"at90usb646", "avr5", "avr5", 0x800100},
209  {"at90usb647", "avr5", "avr5", 0x800100},
210  {"at90scr100", "avr5", "avr5", 0x800100},
211  {"at94k", "avr5", "avr5", 0x800060},
212  {"m3000", "avr5", "avr5", 0x800060},
213  {"atmega128", "avr51", "avr51", 0x800100},
214  {"atmega128a", "avr51", "avr51", 0x800100},
215  {"atmega1280", "avr51", "avr51", 0x800200},
216  {"atmega1281", "avr51", "avr51", 0x800200},
217  {"atmega1284", "avr51", "avr51", 0x800100},
218  {"atmega1284p", "avr51", "avr51", 0x800100},
219  {"atmega128rfa1", "avr51", "avr51", 0x800200},
220  {"atmega128rfr2", "avr51", "avr51", 0x800200},
221  {"atmega1284rfr2", "avr51", "avr51", 0x800200},
222  {"at90can128", "avr51", "avr51", 0x800200},
223  {"at90usb1286", "avr51", "avr51", 0x800200},
224  {"at90usb1287", "avr51", "avr51", 0x800200},
225  {"atmega2560", "avr6", "avr6", 0x800200},
226  {"atmega2561", "avr6", "avr6", 0x800200},
227  {"atmega256rfr2", "avr6", "avr6", 0x800200},
228  {"atmega2564rfr2", "avr6", "avr6", 0x800200},
229  {"attiny4", "avrtiny", "avrtiny", 0x800040},
230  {"attiny5", "avrtiny", "avrtiny", 0x800040},
231  {"attiny9", "avrtiny", "avrtiny", 0x800040},
232  {"attiny10", "avrtiny", "avrtiny", 0x800040},
233  {"attiny20", "avrtiny", "avrtiny", 0x800040},
234  {"attiny40", "avrtiny", "avrtiny", 0x800040},
235  {"atxmega16a4", "avrxmega2", "avrxmega2", 0x802000},
236  {"atxmega16a4u", "avrxmega2", "avrxmega2", 0x802000},
237  {"atxmega16c4", "avrxmega2", "avrxmega2", 0x802000},
238  {"atxmega16d4", "avrxmega2", "avrxmega2", 0x802000},
239  {"atxmega32a4", "avrxmega2", "avrxmega2", 0x802000},
240  {"atxmega32a4u", "avrxmega2", "avrxmega2", 0x802000},
241  {"atxmega32c4", "avrxmega2", "avrxmega2", 0x802000},
242  {"atxmega32d4", "avrxmega2", "avrxmega2", 0x802000},
243  {"atxmega32e5", "avrxmega2", "avrxmega2", 0x802000},
244  {"atxmega16e5", "avrxmega2", "avrxmega2", 0x802000},
245  {"atxmega8e5", "avrxmega2", "avrxmega2", 0x802000},
246  {"atxmega64a3u", "avrxmega4", "avrxmega4", 0x802000},
247  {"atxmega64a4u", "avrxmega4", "avrxmega4", 0x802000},
248  {"atxmega64b1", "avrxmega4", "avrxmega4", 0x802000},
249  {"atxmega64b3", "avrxmega4", "avrxmega4", 0x802000},
250  {"atxmega64c3", "avrxmega4", "avrxmega4", 0x802000},
251  {"atxmega64d3", "avrxmega4", "avrxmega4", 0x802000},
252  {"atxmega64d4", "avrxmega4", "avrxmega4", 0x802000},
253  {"atxmega64a1", "avrxmega5", "avrxmega5", 0x802000},
254  {"atxmega64a1u", "avrxmega5", "avrxmega5", 0x802000},
255  {"atxmega128a3", "avrxmega6", "avrxmega6", 0x802000},
256  {"atxmega128a3u", "avrxmega6", "avrxmega6", 0x802000},
257  {"atxmega128b1", "avrxmega6", "avrxmega6", 0x802000},
258  {"atxmega128b3", "avrxmega6", "avrxmega6", 0x802000},
259  {"atxmega128c3", "avrxmega6", "avrxmega6", 0x802000},
260  {"atxmega128d3", "avrxmega6", "avrxmega6", 0x802000},
261  {"atxmega128d4", "avrxmega6", "avrxmega6", 0x802000},
262  {"atxmega192a3", "avrxmega6", "avrxmega6", 0x802000},
263  {"atxmega192a3u", "avrxmega6", "avrxmega6", 0x802000},
264  {"atxmega192c3", "avrxmega6", "avrxmega6", 0x802000},
265  {"atxmega192d3", "avrxmega6", "avrxmega6", 0x802000},
266  {"atxmega256a3", "avrxmega6", "avrxmega6", 0x802000},
267  {"atxmega256a3u", "avrxmega6", "avrxmega6", 0x802000},
268  {"atxmega256a3b", "avrxmega6", "avrxmega6", 0x802000},
269  {"atxmega256a3bu", "avrxmega6", "avrxmega6", 0x802000},
270  {"atxmega256c3", "avrxmega6", "avrxmega6", 0x802000},
271  {"atxmega256d3", "avrxmega6", "avrxmega6", 0x802000},
272  {"atxmega384c3", "avrxmega6", "avrxmega6", 0x802000},
273  {"atxmega384d3", "avrxmega6", "avrxmega6", 0x802000},
274  {"atxmega128a1", "avrxmega7", "avrxmega7", 0x802000},
275  {"atxmega128a1u", "avrxmega7", "avrxmega7", 0x802000},
276  {"atxmega128a4u", "avrxmega7", "avrxmega7", 0x802000},
277 };
278 
279 std::string GetMCUSubPath(StringRef MCUName) {
280  for (const auto &MCU : MCUInfo)
281  if (MCU.Name == MCUName)
282  return std::string(MCU.SubPath);
283  return "";
284 }
285 
286 llvm::Optional<StringRef> GetMCUFamilyName(StringRef MCUName) {
287  for (const auto &MCU : MCUInfo)
288  if (MCU.Name == MCUName)
289  return Optional<StringRef>(MCU.Family);
290  return Optional<StringRef>();
291 }
292 
293 llvm::Optional<unsigned> GetMCUSectionAddressData(StringRef MCUName) {
294  for (const auto &MCU : MCUInfo)
295  if (MCU.Name == MCUName && MCU.DataAddr > 0)
296  return Optional<unsigned>(MCU.DataAddr);
297  return Optional<unsigned>();
298 }
299 
300 const StringRef PossibleAVRLibcLocations[] = {
301  "/usr/avr",
302  "/usr/lib/avr",
303 };
304 
305 } // end anonymous namespace
306 
307 /// AVR Toolchain
308 AVRToolChain::AVRToolChain(const Driver &D, const llvm::Triple &Triple,
309  const ArgList &Args)
310  : Generic_ELF(D, Triple, Args), LinkStdlib(false) {
311  GCCInstallation.init(Triple, Args);
312 
313  // Only add default libraries if the user hasn't explicitly opted out.
314  if (!Args.hasArg(options::OPT_nostdlib) &&
315  !Args.hasArg(options::OPT_nodefaultlibs) &&
316  !Args.hasArg(options::OPT_c /* does not apply when not linking */)) {
317  std::string CPU = getCPUName(Args, Triple);
318 
319  if (CPU.empty()) {
320  // We cannot link any standard libraries without an MCU specified.
321  D.Diag(diag::warn_drv_avr_mcu_not_specified);
322  } else {
323  Optional<StringRef> FamilyName = GetMCUFamilyName(CPU);
324  Optional<std::string> AVRLibcRoot = findAVRLibcInstallation();
325 
326  if (!FamilyName.hasValue()) {
327  // We do not have an entry for this CPU in the family
328  // mapping table yet.
329  D.Diag(diag::warn_drv_avr_family_linking_stdlibs_not_implemented)
330  << CPU;
331  } else if (!GCCInstallation.isValid()) {
332  // No avr-gcc found and so no runtime linked.
333  D.Diag(diag::warn_drv_avr_gcc_not_found);
334  } else if (!AVRLibcRoot.hasValue()) {
335  // No avr-libc found and so no runtime linked.
336  D.Diag(diag::warn_drv_avr_libc_not_found);
337  } else { // We have enough information to link stdlibs
340  std::string LibcRoot = AVRLibcRoot.getValue();
341  std::string SubPath = GetMCUSubPath(CPU);
342 
343  getProgramPaths().push_back(GCCParentPath + "/../bin");
344  getFilePaths().push_back(LibcRoot + std::string("/lib/") + SubPath);
345  getFilePaths().push_back(GCCRoot + std::string("/") + SubPath);
346 
347  LinkStdlib = true;
348  }
349  }
350 
351  if (!LinkStdlib)
352  D.Diag(diag::warn_drv_avr_stdlib_not_linked);
353  }
354 }
355 
357  return new tools::AVR::Linker(getTriple(), *this, LinkStdlib);
358 }
359 
360 void AVR::Linker::ConstructJob(Compilation &C, const JobAction &JA,
361  const InputInfo &Output,
362  const InputInfoList &Inputs, const ArgList &Args,
363  const char *LinkingOutput) const {
364  // Compute information about the target AVR.
365  std::string CPU = getCPUName(Args, getToolChain().getTriple());
366  llvm::Optional<StringRef> FamilyName = GetMCUFamilyName(CPU);
367  llvm::Optional<unsigned> SectionAddressData = GetMCUSectionAddressData(CPU);
368 
369  std::string Linker = getToolChain().GetProgramPath(getShortName());
370  ArgStringList CmdArgs;
371  AddLinkerInputs(getToolChain(), Inputs, Args, CmdArgs, JA);
372 
373  CmdArgs.push_back("-o");
374  CmdArgs.push_back(Output.getFilename());
375 
376  // Enable garbage collection of unused sections.
377  CmdArgs.push_back("--gc-sections");
378 
379  // Add library search paths before we specify libraries.
380  Args.AddAllArgs(CmdArgs, options::OPT_L);
381  getToolChain().AddFilePathLibArgs(Args, CmdArgs);
382 
383  if (SectionAddressData.hasValue()) {
384  std::string DataSectionArg = std::string("-Tdata=0x") +
385  llvm::utohexstr(SectionAddressData.getValue());
386  CmdArgs.push_back(Args.MakeArgString(DataSectionArg));
387  } else {
388  // We do not have an entry for this CPU in the address mapping table yet.
389  getToolChain().getDriver().Diag(
390  diag::warn_drv_avr_linker_section_addresses_not_implemented)
391  << CPU;
392  }
393 
394  // If the family name is known, we can link with the device-specific libgcc.
395  // Without it, libgcc will simply not be linked. This matches avr-gcc
396  // behavior.
397  if (LinkStdlib) {
398  assert(!CPU.empty() && "CPU name must be known in order to link stdlibs");
399 
400  // Add the object file for the CRT.
401  std::string CrtFileName = std::string("-l:crt") + CPU + std::string(".o");
402  CmdArgs.push_back(Args.MakeArgString(CrtFileName));
403 
404  CmdArgs.push_back("-lgcc");
405  CmdArgs.push_back("-lm");
406  CmdArgs.push_back("-lc");
407 
408  // Add the link library specific to the MCU.
409  CmdArgs.push_back(Args.MakeArgString(std::string("-l") + CPU));
410 
411  // Specify the family name as the emulation mode to use.
412  // This is almost always required because otherwise avr-ld
413  // will assume 'avr2' and warn about the program being larger
414  // than the bare minimum supports.
415  CmdArgs.push_back(Args.MakeArgString(std::string("-m") + *FamilyName));
416  }
417 
418  C.addCommand(std::make_unique<Command>(
419  JA, *this, ResponseFileSupport::AtFileCurCP(), Args.MakeArgString(Linker),
420  CmdArgs, Inputs, Output));
421 }
422 
423 llvm::Optional<std::string> AVRToolChain::findAVRLibcInstallation() const {
424  for (StringRef PossiblePath : PossibleAVRLibcLocations) {
425  std::string Path = getDriver().SysRoot + PossiblePath.str();
426  // Return the first avr-libc installation that exists.
427  if (llvm::sys::fs::is_directory(Path))
428  return Optional<std::string>(Path);
429  }
430 
431  return llvm::None;
432 }
clang::driver::toolchains
Definition: AIX.h:55
clang::driver::ToolChain::getProgramPaths
path_list & getProgramPaths()
Definition: ToolChain.h:255
string
string(SUBSTRING ${CMAKE_CURRENT_BINARY_DIR} 0 ${PATH_LIB_START} PATH_HEAD) string(SUBSTRING $
Definition: CMakeLists.txt:22
llvm::SmallVector
Definition: LLVM.h:38
clang::driver::toolchains::Generic_GCC::GCCInstallation
GCCInstallationDetector GCCInstallation
Definition: Gnu.h:288
clang::driver::tools
Definition: AIX.h:17
clang::driver::ToolChain::getDriver
const Driver & getDriver() const
Definition: ToolChain.h:214
clang::driver::toolchains::Generic_GCC::GCCInstallationDetector::isValid
bool isValid() const
Check whether we detected a valid GCC install.
Definition: Gnu.h:224
llvm::Optional
Definition: LLVM.h:40
clang::driver::toolchains::Generic_GCC::GCCInstallationDetector::init
void init(const llvm::Triple &TargetTriple, const llvm::opt::ArgList &Args, ArrayRef< std::string > ExtraTripleAliases=None)
Initialize a GCCInstallationDetector from the driver.
Definition: Gnu.cpp:1896
clang::driver::InputInfo
InputInfo - Wrapper for information about an input source.
Definition: InputInfo.h:22
InputInfo.h
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::ToolChain::getFilePaths
path_list & getFilePaths()
Definition: ToolChain.h:252
clang::driver::Driver::Diag
DiagnosticBuilder Diag(unsigned DiagID) const
Definition: Driver.h:109
clang::driver::tools::AVR::Linker
Definition: AVR.h:43
clang::driver::Tool
Tool - Information on a specific compilation tool.
Definition: Tool.h:32
clang::driver::toolchains::Generic_ELF
Definition: Gnu.h:367
Options.h
llvm::opt
Definition: DiagnosticOptions.h:19
DriverDiagnostic.h
clang::driver::ResponseFileSupport::AtFileCurCP
static constexpr ResponseFileSupport AtFileCurCP()
Definition: Job.h:91
clang::driver::toolchains::Generic_GCC::GCCInstallationDetector::getParentLibPath
StringRef getParentLibPath() const
Get the detected GCC parent lib path.
Definition: Gnu.h:233
clang::driver::ToolChain::getTriple
const llvm::Triple & getTriple() const
Definition: ToolChain.h:216
clang::driver::Driver::SysRoot
std::string SysRoot
sysroot, if present
Definition: Driver.h:148
false
#define false
Definition: stdbool.h:17
Compilation.h
clang::driver::toolchains::AVRToolChain::buildLinker
Tool * buildLinker() const override
Definition: AVR.cpp:356
clang::driver::tools::getCPUName
std::string getCPUName(const llvm::opt::ArgList &Args, const llvm::Triple &T, bool FromAs=false)
clang::driver::toolchains::Generic_GCC::GCCInstallationDetector::getInstallPath
StringRef getInstallPath() const
Get the detected GCC installation path.
Definition: Gnu.h:230
clang::driver::Compilation
Compilation - A set of tasks to perform for a single driver invocation.
Definition: Compilation.h:45
clang::driver::InputInfo::getFilename
const char * getFilename() const
Definition: InputInfo.h:83
CommonArgs.h
clang
Dataflow Directional Tag Classes.
Definition: CalledOnceCheck.h:17
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::AVRToolChain::AVRToolChain
AVRToolChain(const Driver &D, const llvm::Triple &Triple, const llvm::opt::ArgList &Args)
AVR Toolchain.
Definition: AVR.cpp:308
clang::driver
Definition: Action.h:31
AVR.h
clang::driver::JobAction
Definition: Action.h:380