clang  6.0.0svn
MinGW.cpp
Go to the documentation of this file.
1 //===--- MinGW.cpp - MinGWToolChain Implementation ------------------------===//
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 "MinGW.h"
11 #include "InputInfo.h"
12 #include "CommonArgs.h"
14 #include "clang/Driver/Driver.h"
16 #include "clang/Driver/Options.h"
17 #include "llvm/Option/ArgList.h"
18 #include "llvm/Support/FileSystem.h"
19 #include "llvm/Support/Path.h"
20 #include <system_error>
21 
22 using namespace clang::diag;
23 using namespace clang::driver;
24 using namespace clang;
25 using namespace llvm::opt;
26 
27 /// MinGW Tools
28 void tools::MinGW::Assembler::ConstructJob(Compilation &C, const JobAction &JA,
29  const InputInfo &Output,
30  const InputInfoList &Inputs,
31  const ArgList &Args,
32  const char *LinkingOutput) const {
33  claimNoWarnArgs(Args);
34  ArgStringList CmdArgs;
35 
36  if (getToolChain().getArch() == llvm::Triple::x86) {
37  CmdArgs.push_back("--32");
38  } else if (getToolChain().getArch() == llvm::Triple::x86_64) {
39  CmdArgs.push_back("--64");
40  }
41 
42  Args.AddAllArgValues(CmdArgs, options::OPT_Wa_COMMA, options::OPT_Xassembler);
43 
44  CmdArgs.push_back("-o");
45  CmdArgs.push_back(Output.getFilename());
46 
47  for (const auto &II : Inputs)
48  CmdArgs.push_back(II.getFilename());
49 
50  const char *Exec = Args.MakeArgString(getToolChain().GetProgramPath("as"));
51  C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
52 
53  if (Args.hasArg(options::OPT_gsplit_dwarf))
54  SplitDebugInfo(getToolChain(), C, *this, JA, Args, Output,
55  SplitDebugName(Args, Inputs[0]));
56 }
57 
58 void tools::MinGW::Linker::AddLibGCC(const ArgList &Args,
59  ArgStringList &CmdArgs) const {
60  if (Args.hasArg(options::OPT_mthreads))
61  CmdArgs.push_back("-lmingwthrd");
62  CmdArgs.push_back("-lmingw32");
63 
64  // Make use of compiler-rt if --rtlib option is used
65  ToolChain::RuntimeLibType RLT = getToolChain().GetRuntimeLibType(Args);
66  if (RLT == ToolChain::RLT_Libgcc) {
67  bool Static = Args.hasArg(options::OPT_static_libgcc) ||
68  Args.hasArg(options::OPT_static);
69  bool Shared = Args.hasArg(options::OPT_shared);
70  bool CXX = getToolChain().getDriver().CCCIsCXX();
71 
72  if (Static || (!CXX && !Shared)) {
73  CmdArgs.push_back("-lgcc");
74  CmdArgs.push_back("-lgcc_eh");
75  } else {
76  CmdArgs.push_back("-lgcc_s");
77  CmdArgs.push_back("-lgcc");
78  }
79  } else {
80  AddRunTimeLibs(getToolChain(), getToolChain().getDriver(), CmdArgs, Args);
81  }
82 
83  CmdArgs.push_back("-lmoldname");
84  CmdArgs.push_back("-lmingwex");
85  for (auto Lib : Args.getAllArgValues(options::OPT_l))
86  if (StringRef(Lib).startswith("msvcr") || Lib == "ucrtbase")
87  return;
88  CmdArgs.push_back("-lmsvcrt");
89 }
90 
91 void tools::MinGW::Linker::ConstructJob(Compilation &C, const JobAction &JA,
92  const InputInfo &Output,
93  const InputInfoList &Inputs,
94  const ArgList &Args,
95  const char *LinkingOutput) const {
96  const ToolChain &TC = getToolChain();
97  const Driver &D = TC.getDriver();
98  // const SanitizerArgs &Sanitize = TC.getSanitizerArgs();
99 
100  ArgStringList CmdArgs;
101 
102  // Silence warning for "clang -g foo.o -o foo"
103  Args.ClaimAllArgs(options::OPT_g_Group);
104  // and "clang -emit-llvm foo.o -o foo"
105  Args.ClaimAllArgs(options::OPT_emit_llvm);
106  // and for "clang -w foo.o -o foo". Other warning options are already
107  // handled somewhere else.
108  Args.ClaimAllArgs(options::OPT_w);
109 
110  StringRef LinkerName = Args.getLastArgValue(options::OPT_fuse_ld_EQ, "ld");
111  if (LinkerName.equals_lower("lld")) {
112  CmdArgs.push_back("-flavor");
113  CmdArgs.push_back("gnu");
114  } else if (!LinkerName.equals_lower("ld")) {
115  D.Diag(diag::err_drv_unsupported_linker) << LinkerName;
116  }
117 
118  if (!D.SysRoot.empty())
119  CmdArgs.push_back(Args.MakeArgString("--sysroot=" + D.SysRoot));
120 
121  if (Args.hasArg(options::OPT_s))
122  CmdArgs.push_back("-s");
123 
124  CmdArgs.push_back("-m");
125  switch (TC.getArch()) {
126  case llvm::Triple::x86:
127  CmdArgs.push_back("i386pe");
128  break;
129  case llvm::Triple::x86_64:
130  CmdArgs.push_back("i386pep");
131  break;
132  case llvm::Triple::arm:
133  case llvm::Triple::thumb:
134  // FIXME: this is incorrect for WinCE
135  CmdArgs.push_back("thumb2pe");
136  break;
137  case llvm::Triple::aarch64:
138  CmdArgs.push_back("arm64pe");
139  break;
140  default:
141  llvm_unreachable("Unsupported target architecture.");
142  }
143 
144  if (Args.hasArg(options::OPT_mwindows)) {
145  CmdArgs.push_back("--subsystem");
146  CmdArgs.push_back("windows");
147  } else if (Args.hasArg(options::OPT_mconsole)) {
148  CmdArgs.push_back("--subsystem");
149  CmdArgs.push_back("console");
150  }
151 
152  if (Args.hasArg(options::OPT_static))
153  CmdArgs.push_back("-Bstatic");
154  else {
155  if (Args.hasArg(options::OPT_mdll))
156  CmdArgs.push_back("--dll");
157  else if (Args.hasArg(options::OPT_shared))
158  CmdArgs.push_back("--shared");
159  CmdArgs.push_back("-Bdynamic");
160  if (Args.hasArg(options::OPT_mdll) || Args.hasArg(options::OPT_shared)) {
161  CmdArgs.push_back("-e");
162  if (TC.getArch() == llvm::Triple::x86)
163  CmdArgs.push_back("_DllMainCRTStartup@12");
164  else
165  CmdArgs.push_back("DllMainCRTStartup");
166  CmdArgs.push_back("--enable-auto-image-base");
167  }
168  }
169 
170  CmdArgs.push_back("-o");
171  CmdArgs.push_back(Output.getFilename());
172 
173  Args.AddAllArgs(CmdArgs, options::OPT_e);
174  // FIXME: add -N, -n flags
175  Args.AddLastArg(CmdArgs, options::OPT_r);
176  Args.AddLastArg(CmdArgs, options::OPT_s);
177  Args.AddLastArg(CmdArgs, options::OPT_t);
178  Args.AddAllArgs(CmdArgs, options::OPT_u_Group);
179  Args.AddLastArg(CmdArgs, options::OPT_Z_Flag);
180 
181  if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nostartfiles)) {
182  if (Args.hasArg(options::OPT_shared) || Args.hasArg(options::OPT_mdll)) {
183  CmdArgs.push_back(Args.MakeArgString(TC.GetFilePath("dllcrt2.o")));
184  } else {
185  if (Args.hasArg(options::OPT_municode))
186  CmdArgs.push_back(Args.MakeArgString(TC.GetFilePath("crt2u.o")));
187  else
188  CmdArgs.push_back(Args.MakeArgString(TC.GetFilePath("crt2.o")));
189  }
190  if (Args.hasArg(options::OPT_pg))
191  CmdArgs.push_back(Args.MakeArgString(TC.GetFilePath("gcrt2.o")));
192  CmdArgs.push_back(Args.MakeArgString(TC.GetFilePath("crtbegin.o")));
193  }
194 
195  Args.AddAllArgs(CmdArgs, options::OPT_L);
196  TC.AddFilePathLibArgs(Args, CmdArgs);
197  AddLinkerInputs(TC, Inputs, Args, CmdArgs, JA);
198 
199  // TODO: Add ASan stuff here
200 
201  // TODO: Add profile stuff here
202 
203  if (TC.ShouldLinkCXXStdlib(Args)) {
204  bool OnlyLibstdcxxStatic = Args.hasArg(options::OPT_static_libstdcxx) &&
205  !Args.hasArg(options::OPT_static);
206  if (OnlyLibstdcxxStatic)
207  CmdArgs.push_back("-Bstatic");
208  TC.AddCXXStdlibLibArgs(Args, CmdArgs);
209  if (OnlyLibstdcxxStatic)
210  CmdArgs.push_back("-Bdynamic");
211  }
212 
213  if (!Args.hasArg(options::OPT_nostdlib)) {
214  if (!Args.hasArg(options::OPT_nodefaultlibs)) {
215  if (Args.hasArg(options::OPT_static))
216  CmdArgs.push_back("--start-group");
217 
218  if (Args.hasArg(options::OPT_fstack_protector) ||
219  Args.hasArg(options::OPT_fstack_protector_strong) ||
220  Args.hasArg(options::OPT_fstack_protector_all)) {
221  CmdArgs.push_back("-lssp_nonshared");
222  CmdArgs.push_back("-lssp");
223  }
224  if (Args.hasArg(options::OPT_fopenmp))
225  CmdArgs.push_back("-lgomp");
226 
227  AddLibGCC(Args, CmdArgs);
228 
229  if (Args.hasArg(options::OPT_pg))
230  CmdArgs.push_back("-lgmon");
231 
232  if (Args.hasArg(options::OPT_pthread))
233  CmdArgs.push_back("-lpthread");
234 
235  // add system libraries
236  if (Args.hasArg(options::OPT_mwindows)) {
237  CmdArgs.push_back("-lgdi32");
238  CmdArgs.push_back("-lcomdlg32");
239  }
240  CmdArgs.push_back("-ladvapi32");
241  CmdArgs.push_back("-lshell32");
242  CmdArgs.push_back("-luser32");
243  CmdArgs.push_back("-lkernel32");
244 
245  if (Args.hasArg(options::OPT_static))
246  CmdArgs.push_back("--end-group");
247  else if (!LinkerName.equals_lower("lld"))
248  AddLibGCC(Args, CmdArgs);
249  }
250 
251  if (!Args.hasArg(options::OPT_nostartfiles)) {
252  // Add crtfastmath.o if available and fast math is enabled.
253  TC.AddFastMathRuntimeIfAvailable(Args, CmdArgs);
254 
255  CmdArgs.push_back(Args.MakeArgString(TC.GetFilePath("crtend.o")));
256  }
257  }
258  const char *Exec = Args.MakeArgString(TC.GetProgramPath(LinkerName.data()));
259  C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
260 }
261 
262 // Simplified from Generic_GCC::GCCInstallationDetector::ScanLibDirForGCCTriple.
263 static bool findGccVersion(StringRef LibDir, std::string &GccLibDir,
264  std::string &Ver) {
265  auto Version = toolchains::Generic_GCC::GCCVersion::Parse("0.0.0");
266  std::error_code EC;
267  for (llvm::sys::fs::directory_iterator LI(LibDir, EC), LE; !EC && LI != LE;
268  LI = LI.increment(EC)) {
269  StringRef VersionText = llvm::sys::path::filename(LI->path());
270  auto CandidateVersion =
271  toolchains::Generic_GCC::GCCVersion::Parse(VersionText);
272  if (CandidateVersion.Major == -1)
273  continue;
274  if (CandidateVersion <= Version)
275  continue;
276  Ver = VersionText;
277  GccLibDir = LI->path();
278  }
279  return Ver.size();
280 }
281 
282 void toolchains::MinGW::findGccLibDir() {
284  Archs.emplace_back(getTriple().getArchName());
285  Archs[0] += "-w64-mingw32";
286  Archs.emplace_back("mingw32");
287  Arch = Archs[0].str();
288  // lib: Arch Linux, Ubuntu, Windows
289  // lib64: openSUSE Linux
290  for (StringRef CandidateLib : {"lib", "lib64"}) {
291  for (StringRef CandidateArch : Archs) {
293  llvm::sys::path::append(LibDir, CandidateLib, "gcc", CandidateArch);
294  if (findGccVersion(LibDir, GccLibDir, Ver)) {
295  Arch = CandidateArch;
296  return;
297  }
298  }
299  }
300 }
301 
302 llvm::ErrorOr<std::string> toolchains::MinGW::findGcc() {
304  Gccs.emplace_back(getTriple().getArchName());
305  Gccs[0] += "-w64-mingw32-gcc";
306  Gccs.emplace_back("mingw32-gcc");
307  // Please do not add "gcc" here
308  for (StringRef CandidateGcc : Gccs)
309  if (llvm::ErrorOr<std::string> GPPName = llvm::sys::findProgramByName(CandidateGcc))
310  return GPPName;
311  return make_error_code(std::errc::no_such_file_or_directory);
312 }
313 
314 toolchains::MinGW::MinGW(const Driver &D, const llvm::Triple &Triple,
315  const ArgList &Args)
316  : ToolChain(D, Triple, Args), CudaInstallation(D, Triple, Args) {
317  getProgramPaths().push_back(getDriver().getInstalledDir());
318 
319  if (getDriver().SysRoot.size())
320  Base = getDriver().SysRoot;
321  else if (llvm::ErrorOr<std::string> GPPName = findGcc())
322  Base = llvm::sys::path::parent_path(
323  llvm::sys::path::parent_path(GPPName.get()));
324  else
325  Base = llvm::sys::path::parent_path(getDriver().getInstalledDir());
326 
327  Base += llvm::sys::path::get_separator();
328  findGccLibDir();
329  // GccLibDir must precede Base/lib so that the
330  // correct crtbegin.o ,cetend.o would be found.
331  getFilePaths().push_back(GccLibDir);
332  getFilePaths().push_back(
333  (Base + Arch + llvm::sys::path::get_separator() + "lib").str());
334  getFilePaths().push_back(Base + "lib");
335  // openSUSE
336  getFilePaths().push_back(Base + Arch + "/sys-root/mingw/lib");
337 }
338 
340 
342  switch (AC) {
344  if (!Preprocessor)
345  Preprocessor.reset(new tools::gcc::Preprocessor(*this));
346  return Preprocessor.get();
348  if (!Compiler)
349  Compiler.reset(new tools::gcc::Compiler(*this));
350  return Compiler.get();
351  default:
352  return ToolChain::getTool(AC);
353  }
354 }
355 
357  return new tools::MinGW::Assembler(*this);
358 }
359 
361  return new tools::MinGW::Linker(*this);
362 }
363 
364 bool toolchains::MinGW::IsUnwindTablesDefault(const ArgList &Args) const {
365  return getArch() == llvm::Triple::x86_64;
366 }
367 
369  return getArch() == llvm::Triple::x86_64;
370 }
371 
372 bool toolchains::MinGW::isPIEDefault() const { return false; }
373 
375  return getArch() == llvm::Triple::x86_64;
376 }
377 
379  return getArch() == llvm::Triple::x86_64;
380 }
381 
382 void toolchains::MinGW::AddCudaIncludeArgs(const ArgList &DriverArgs,
383  ArgStringList &CC1Args) const {
384  CudaInstallation.AddCudaIncludeArgs(DriverArgs, CC1Args);
385 }
386 
387 void toolchains::MinGW::printVerboseInfo(raw_ostream &OS) const {
388  CudaInstallation.print(OS);
389 }
390 
391 // Include directories for various hosts:
392 
393 // Windows, mingw.org
394 // c:\mingw\lib\gcc\mingw32\4.8.1\include\c++
395 // c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\mingw32
396 // c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\backward
397 // c:\mingw\include
398 // c:\mingw\mingw32\include
399 
400 // Windows, mingw-w64 mingw-builds
401 // c:\mingw32\i686-w64-mingw32\include
402 // c:\mingw32\i686-w64-mingw32\include\c++
403 // c:\mingw32\i686-w64-mingw32\include\c++\i686-w64-mingw32
404 // c:\mingw32\i686-w64-mingw32\include\c++\backward
405 
406 // Windows, mingw-w64 msys2
407 // c:\msys64\mingw32\include
408 // c:\msys64\mingw32\i686-w64-mingw32\include
409 // c:\msys64\mingw32\include\c++\4.9.2
410 // c:\msys64\mingw32\include\c++\4.9.2\i686-w64-mingw32
411 // c:\msys64\mingw32\include\c++\4.9.2\backward
412 
413 // openSUSE
414 // /usr/lib64/gcc/x86_64-w64-mingw32/5.1.0/include/c++
415 // /usr/lib64/gcc/x86_64-w64-mingw32/5.1.0/include/c++/x86_64-w64-mingw32
416 // /usr/lib64/gcc/x86_64-w64-mingw32/5.1.0/include/c++/backward
417 // /usr/x86_64-w64-mingw32/sys-root/mingw/include
418 
419 // Arch Linux
420 // /usr/i686-w64-mingw32/include/c++/5.1.0
421 // /usr/i686-w64-mingw32/include/c++/5.1.0/i686-w64-mingw32
422 // /usr/i686-w64-mingw32/include/c++/5.1.0/backward
423 // /usr/i686-w64-mingw32/include
424 
425 // Ubuntu
426 // /usr/include/c++/4.8
427 // /usr/include/c++/4.8/x86_64-w64-mingw32
428 // /usr/include/c++/4.8/backward
429 // /usr/x86_64-w64-mingw32/include
430 
431 void toolchains::MinGW::AddClangSystemIncludeArgs(const ArgList &DriverArgs,
432  ArgStringList &CC1Args) const {
433  if (DriverArgs.hasArg(options::OPT_nostdinc))
434  return;
435 
436  if (!DriverArgs.hasArg(options::OPT_nobuiltininc)) {
437  SmallString<1024> P(getDriver().ResourceDir);
438  llvm::sys::path::append(P, "include");
439  addSystemInclude(DriverArgs, CC1Args, P.str());
440  }
441 
442  if (DriverArgs.hasArg(options::OPT_nostdlibinc))
443  return;
444 
445  if (GetRuntimeLibType(DriverArgs) == ToolChain::RLT_Libgcc) {
446  // openSUSE
447  addSystemInclude(DriverArgs, CC1Args,
448  Base + Arch + "/sys-root/mingw/include");
449  }
450 
451  addSystemInclude(DriverArgs, CC1Args,
452  Base + Arch + llvm::sys::path::get_separator() + "include");
453  addSystemInclude(DriverArgs, CC1Args, Base + "include");
454 }
455 
457  const ArgList &DriverArgs, ArgStringList &CC1Args) const {
458  if (DriverArgs.hasArg(options::OPT_nostdlibinc) ||
459  DriverArgs.hasArg(options::OPT_nostdincxx))
460  return;
461 
462  switch (GetCXXStdlibType(DriverArgs)) {
464  addSystemInclude(DriverArgs, CC1Args,
465  Base + "include" + llvm::sys::path::get_separator() +
466  "c++" + llvm::sys::path::get_separator() + "v1");
467  break;
468 
470  llvm::SmallVector<llvm::SmallString<1024>, 4> CppIncludeBases;
471  CppIncludeBases.emplace_back(Base);
472  llvm::sys::path::append(CppIncludeBases[0], Arch, "include", "c++");
473  CppIncludeBases.emplace_back(Base);
474  llvm::sys::path::append(CppIncludeBases[1], Arch, "include", "c++", Ver);
475  CppIncludeBases.emplace_back(Base);
476  llvm::sys::path::append(CppIncludeBases[2], "include", "c++", Ver);
477  CppIncludeBases.emplace_back(GccLibDir);
478  llvm::sys::path::append(CppIncludeBases[3], "include", "c++");
479  for (auto &CppIncludeBase : CppIncludeBases) {
480  addSystemInclude(DriverArgs, CC1Args, CppIncludeBase);
481  CppIncludeBase += llvm::sys::path::get_separator();
482  addSystemInclude(DriverArgs, CC1Args, CppIncludeBase + Arch);
483  addSystemInclude(DriverArgs, CC1Args, CppIncludeBase + "backward");
484  }
485  break;
486  }
487 }
void AddClangSystemIncludeArgs(const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CC1Args) const override
Add the clang cc1 arguments for system include paths.
Definition: MinGW.cpp:431
static bool findGccVersion(StringRef LibDir, std::string &GccLibDir, std::string &Ver)
Definition: MinGW.cpp:263
Tool * getTool(Action::ActionClass AC) const override
Definition: MinGW.cpp:341
StringRef P
void AddRunTimeLibs(const ToolChain &TC, const Driver &D, llvm::opt::ArgStringList &CmdArgs, const llvm::opt::ArgList &Args)
DiagnosticBuilder Diag(unsigned DiagID) const
Definition: Driver.h:116
void print(raw_ostream &OS) const
Print information about the detected CUDA installation.
Definition: Cuda.cpp:220
const char * getFilename() const
Definition: InputInfo.h:84
bool IsUnwindTablesDefault(const llvm::opt::ArgList &Args) const override
IsUnwindTablesDefault - Does this tool chain use -funwind-tables by default.
Definition: MinGW.cpp:364
path_list & getProgramPaths()
Definition: ToolChain.h:197
Tool * buildLinker() const override
Definition: MinGW.cpp:360
bool isPIEDefault() const override
Test whether this toolchain defaults to PIE.
Definition: MinGW.cpp:372
std::error_code make_error_code(BuildPreambleError Error)
InputInfo - Wrapper for information about an input source.
Definition: InputInfo.h:23
std::string GetFilePath(const char *Name) const
Definition: ToolChain.cpp:371
path_list & getFilePaths()
Definition: ToolChain.h:194
virtual bool AddFastMathRuntimeIfAvailable(const llvm::opt::ArgList &Args, llvm::opt::ArgStringList &CmdArgs) const
AddFastMathRuntimeIfAvailable - If a runtime library exists that sets global flags for unsafe floatin...
Definition: ToolChain.cpp:706
Driver - Encapsulate logic for constructing compilation processes from a set of gcc-driver-like comma...
Definition: Driver.h:65
void printVerboseInfo(raw_ostream &OS) const override
Dispatch to the specific toolchain for verbose printing.
Definition: MinGW.cpp:387
Tool * buildAssembler() const override
Definition: MinGW.cpp:356
const char * SplitDebugName(const llvm::opt::ArgList &Args, const InputInfo &Input)
void addCommand(std::unique_ptr< Command > C)
Definition: Compilation.h:189
llvm::Triple::ArchType getArch() const
Definition: ToolChain.h:175
void AddCudaIncludeArgs(const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CC1Args) const
Definition: Cuda.cpp:179
bool isPICDefaultForced() const override
Tests whether this toolchain forces its default for PIC, PIE or non-PIC.
Definition: MinGW.cpp:374
void AddFilePathLibArgs(const llvm::opt::ArgList &Args, llvm::opt::ArgStringList &CmdArgs) const
AddFilePathLibArgs - Add each thing in getFilePaths() as a "-L" option.
Definition: ToolChain.cpp:694
const Driver & getDriver() const
Definition: ToolChain.h:164
void AddCudaIncludeArgs(const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CC1Args) const override
Add arguments to use system-specific CUDA includes.
Definition: MinGW.cpp:382
static void addSystemInclude(const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CC1Args, const Twine &Path)
Utility function to add a system include directory to CC1 arguments.
Definition: ToolChain.cpp:618
void SplitDebugInfo(const ToolChain &TC, Compilation &C, const Tool &T, const JobAction &JA, const llvm::opt::ArgList &Args, const InputInfo &Output, const char *OutFile)
virtual RuntimeLibType GetRuntimeLibType(const llvm::opt::ArgList &Args) const
Definition: ToolChain.cpp:580
bool ShouldLinkCXXStdlib(const llvm::opt::ArgList &Args) const
Returns if the C++ standard library should be linked in.
Definition: ToolChain.cpp:671
Dataflow Directional Tag Classes.
void AddLinkerInputs(const ToolChain &TC, const InputInfoList &Inputs, const llvm::opt::ArgList &Args, llvm::opt::ArgStringList &CmdArgs, const JobAction &JA)
std::string SysRoot
sysroot, if present
Definition: Driver.h:149
Tool - Information on a specific compilation tool.
Definition: Tool.h:34
void claimNoWarnArgs(const llvm::opt::ArgList &Args)
Compilation - A set of tasks to perform for a single driver invocation.
Definition: Compilation.h:34
virtual Tool * getTool(Action::ActionClass AC) const
Definition: ToolChain.cpp:260
std::string GetProgramPath(const char *Name) const
Definition: ToolChain.cpp:375
virtual CXXStdlibType GetCXXStdlibType(const llvm::opt::ArgList &Args) const
Definition: ToolChain.cpp:599
bool IsIntegratedAssemblerDefault() const override
IsIntegratedAssemblerDefault - Does this tool chain enable -integrated-as by default.
Definition: MinGW.cpp:339
bool isPICDefault() const override
Test whether this toolchain defaults to PIC.
Definition: MinGW.cpp:368
void AddClangCXXStdlibIncludeArgs(const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CC1Args) const override
AddClangCXXStdlibIncludeArgs - Add the clang -cc1 level arguments to set the include paths to use for...
Definition: MinGW.cpp:456
virtual void AddCXXStdlibLibArgs(const llvm::opt::ArgList &Args, llvm::opt::ArgStringList &CmdArgs) const
AddCXXStdlibLibArgs - Add the system specific linker arguments to use for the given C++ standard libr...
Definition: ToolChain.cpp:677
Engages in a tight little dance with the lexer to efficiently preprocess tokens.
Definition: Preprocessor.h:98
ToolChain - Access to tools for a single platform.
Definition: ToolChain.h:72