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  if (!D.SysRoot.empty())
111  CmdArgs.push_back(Args.MakeArgString("--sysroot=" + D.SysRoot));
112 
113  if (Args.hasArg(options::OPT_s))
114  CmdArgs.push_back("-s");
115 
116  CmdArgs.push_back("-m");
117  switch (TC.getArch()) {
118  case llvm::Triple::x86:
119  CmdArgs.push_back("i386pe");
120  break;
121  case llvm::Triple::x86_64:
122  CmdArgs.push_back("i386pep");
123  break;
124  case llvm::Triple::arm:
125  case llvm::Triple::thumb:
126  // FIXME: this is incorrect for WinCE
127  CmdArgs.push_back("thumb2pe");
128  break;
129  case llvm::Triple::aarch64:
130  CmdArgs.push_back("arm64pe");
131  break;
132  default:
133  llvm_unreachable("Unsupported target architecture.");
134  }
135 
136  if (Args.hasArg(options::OPT_mwindows)) {
137  CmdArgs.push_back("--subsystem");
138  CmdArgs.push_back("windows");
139  } else if (Args.hasArg(options::OPT_mconsole)) {
140  CmdArgs.push_back("--subsystem");
141  CmdArgs.push_back("console");
142  }
143 
144  if (Args.hasArg(options::OPT_static))
145  CmdArgs.push_back("-Bstatic");
146  else {
147  if (Args.hasArg(options::OPT_mdll))
148  CmdArgs.push_back("--dll");
149  else if (Args.hasArg(options::OPT_shared))
150  CmdArgs.push_back("--shared");
151  CmdArgs.push_back("-Bdynamic");
152  if (Args.hasArg(options::OPT_mdll) || Args.hasArg(options::OPT_shared)) {
153  CmdArgs.push_back("-e");
154  if (TC.getArch() == llvm::Triple::x86)
155  CmdArgs.push_back("_DllMainCRTStartup@12");
156  else
157  CmdArgs.push_back("DllMainCRTStartup");
158  CmdArgs.push_back("--enable-auto-image-base");
159  }
160  }
161 
162  CmdArgs.push_back("-o");
163  CmdArgs.push_back(Output.getFilename());
164 
165  Args.AddAllArgs(CmdArgs, options::OPT_e);
166  // FIXME: add -N, -n flags
167  Args.AddLastArg(CmdArgs, options::OPT_r);
168  Args.AddLastArg(CmdArgs, options::OPT_s);
169  Args.AddLastArg(CmdArgs, options::OPT_t);
170  Args.AddAllArgs(CmdArgs, options::OPT_u_Group);
171  Args.AddLastArg(CmdArgs, options::OPT_Z_Flag);
172 
173  if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nostartfiles)) {
174  if (Args.hasArg(options::OPT_shared) || Args.hasArg(options::OPT_mdll)) {
175  CmdArgs.push_back(Args.MakeArgString(TC.GetFilePath("dllcrt2.o")));
176  } else {
177  if (Args.hasArg(options::OPT_municode))
178  CmdArgs.push_back(Args.MakeArgString(TC.GetFilePath("crt2u.o")));
179  else
180  CmdArgs.push_back(Args.MakeArgString(TC.GetFilePath("crt2.o")));
181  }
182  if (Args.hasArg(options::OPT_pg))
183  CmdArgs.push_back(Args.MakeArgString(TC.GetFilePath("gcrt2.o")));
184  CmdArgs.push_back(Args.MakeArgString(TC.GetFilePath("crtbegin.o")));
185  }
186 
187  Args.AddAllArgs(CmdArgs, options::OPT_L);
188  TC.AddFilePathLibArgs(Args, CmdArgs);
189  AddLinkerInputs(TC, Inputs, Args, CmdArgs, JA);
190 
191  // TODO: Add ASan stuff here
192 
193  // TODO: Add profile stuff here
194 
195  if (TC.ShouldLinkCXXStdlib(Args)) {
196  bool OnlyLibstdcxxStatic = Args.hasArg(options::OPT_static_libstdcxx) &&
197  !Args.hasArg(options::OPT_static);
198  if (OnlyLibstdcxxStatic)
199  CmdArgs.push_back("-Bstatic");
200  TC.AddCXXStdlibLibArgs(Args, CmdArgs);
201  if (OnlyLibstdcxxStatic)
202  CmdArgs.push_back("-Bdynamic");
203  }
204 
205  if (!Args.hasArg(options::OPT_nostdlib)) {
206  if (!Args.hasArg(options::OPT_nodefaultlibs)) {
207  if (Args.hasArg(options::OPT_static))
208  CmdArgs.push_back("--start-group");
209 
210  if (Args.hasArg(options::OPT_fstack_protector) ||
211  Args.hasArg(options::OPT_fstack_protector_strong) ||
212  Args.hasArg(options::OPT_fstack_protector_all)) {
213  CmdArgs.push_back("-lssp_nonshared");
214  CmdArgs.push_back("-lssp");
215  }
216  if (Args.hasArg(options::OPT_fopenmp))
217  CmdArgs.push_back("-lgomp");
218 
219  AddLibGCC(Args, CmdArgs);
220 
221  if (Args.hasArg(options::OPT_pg))
222  CmdArgs.push_back("-lgmon");
223 
224  if (Args.hasArg(options::OPT_pthread))
225  CmdArgs.push_back("-lpthread");
226 
227  // add system libraries
228  if (Args.hasArg(options::OPT_mwindows)) {
229  CmdArgs.push_back("-lgdi32");
230  CmdArgs.push_back("-lcomdlg32");
231  }
232  CmdArgs.push_back("-ladvapi32");
233  CmdArgs.push_back("-lshell32");
234  CmdArgs.push_back("-luser32");
235  CmdArgs.push_back("-lkernel32");
236 
237  if (Args.hasArg(options::OPT_static))
238  CmdArgs.push_back("--end-group");
239  else
240  AddLibGCC(Args, CmdArgs);
241  }
242 
243  if (!Args.hasArg(options::OPT_nostartfiles)) {
244  // Add crtfastmath.o if available and fast math is enabled.
245  TC.AddFastMathRuntimeIfAvailable(Args, CmdArgs);
246 
247  CmdArgs.push_back(Args.MakeArgString(TC.GetFilePath("crtend.o")));
248  }
249  }
250  const char *Exec = Args.MakeArgString(TC.GetLinkerPath());
251  C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
252 }
253 
254 // Simplified from Generic_GCC::GCCInstallationDetector::ScanLibDirForGCCTriple.
255 static bool findGccVersion(StringRef LibDir, std::string &GccLibDir,
256  std::string &Ver) {
257  auto Version = toolchains::Generic_GCC::GCCVersion::Parse("0.0.0");
258  std::error_code EC;
259  for (llvm::sys::fs::directory_iterator LI(LibDir, EC), LE; !EC && LI != LE;
260  LI = LI.increment(EC)) {
261  StringRef VersionText = llvm::sys::path::filename(LI->path());
262  auto CandidateVersion =
263  toolchains::Generic_GCC::GCCVersion::Parse(VersionText);
264  if (CandidateVersion.Major == -1)
265  continue;
266  if (CandidateVersion <= Version)
267  continue;
268  Ver = VersionText;
269  GccLibDir = LI->path();
270  }
271  return Ver.size();
272 }
273 
274 void toolchains::MinGW::findGccLibDir() {
276  Archs.emplace_back(getTriple().getArchName());
277  Archs[0] += "-w64-mingw32";
278  Archs.emplace_back("mingw32");
279  Arch = Archs[0].str();
280  // lib: Arch Linux, Ubuntu, Windows
281  // lib64: openSUSE Linux
282  for (StringRef CandidateLib : {"lib", "lib64"}) {
283  for (StringRef CandidateArch : Archs) {
285  llvm::sys::path::append(LibDir, CandidateLib, "gcc", CandidateArch);
286  if (findGccVersion(LibDir, GccLibDir, Ver)) {
287  Arch = CandidateArch;
288  return;
289  }
290  }
291  }
292 }
293 
294 llvm::ErrorOr<std::string> toolchains::MinGW::findGcc() {
296  Gccs.emplace_back(getTriple().getArchName());
297  Gccs[0] += "-w64-mingw32-gcc";
298  Gccs.emplace_back("mingw32-gcc");
299  // Please do not add "gcc" here
300  for (StringRef CandidateGcc : Gccs)
301  if (llvm::ErrorOr<std::string> GPPName = llvm::sys::findProgramByName(CandidateGcc))
302  return GPPName;
303  return make_error_code(std::errc::no_such_file_or_directory);
304 }
305 
306 toolchains::MinGW::MinGW(const Driver &D, const llvm::Triple &Triple,
307  const ArgList &Args)
308  : ToolChain(D, Triple, Args), CudaInstallation(D, Triple, Args) {
309  getProgramPaths().push_back(getDriver().getInstalledDir());
310 
311  if (getDriver().SysRoot.size())
312  Base = getDriver().SysRoot;
313  else if (llvm::ErrorOr<std::string> GPPName = findGcc())
314  Base = llvm::sys::path::parent_path(
315  llvm::sys::path::parent_path(GPPName.get()));
316  else
317  Base = llvm::sys::path::parent_path(getDriver().getInstalledDir());
318 
319  Base += llvm::sys::path::get_separator();
320  findGccLibDir();
321  // GccLibDir must precede Base/lib so that the
322  // correct crtbegin.o ,cetend.o would be found.
323  getFilePaths().push_back(GccLibDir);
324  getFilePaths().push_back(
325  (Base + Arch + llvm::sys::path::get_separator() + "lib").str());
326  getFilePaths().push_back(Base + "lib");
327  // openSUSE
328  getFilePaths().push_back(Base + Arch + "/sys-root/mingw/lib");
329 }
330 
332 
334  switch (AC) {
336  if (!Preprocessor)
337  Preprocessor.reset(new tools::gcc::Preprocessor(*this));
338  return Preprocessor.get();
340  if (!Compiler)
341  Compiler.reset(new tools::gcc::Compiler(*this));
342  return Compiler.get();
343  default:
344  return ToolChain::getTool(AC);
345  }
346 }
347 
349  return new tools::MinGW::Assembler(*this);
350 }
351 
353  return new tools::MinGW::Linker(*this);
354 }
355 
356 bool toolchains::MinGW::IsUnwindTablesDefault(const ArgList &Args) const {
357  return getArch() == llvm::Triple::x86_64;
358 }
359 
361  return getArch() == llvm::Triple::x86_64;
362 }
363 
364 bool toolchains::MinGW::isPIEDefault() const { return false; }
365 
367  return getArch() == llvm::Triple::x86_64;
368 }
369 
370 llvm::ExceptionHandling
371 toolchains::MinGW::GetExceptionModel(const ArgList &Args) const {
372  if (getArch() == llvm::Triple::x86_64)
373  return llvm::ExceptionHandling::WinEH;
374  return llvm::ExceptionHandling::DwarfCFI;
375 }
376 
377 void toolchains::MinGW::AddCudaIncludeArgs(const ArgList &DriverArgs,
378  ArgStringList &CC1Args) const {
379  CudaInstallation.AddCudaIncludeArgs(DriverArgs, CC1Args);
380 }
381 
382 void toolchains::MinGW::printVerboseInfo(raw_ostream &OS) const {
383  CudaInstallation.print(OS);
384 }
385 
386 // Include directories for various hosts:
387 
388 // Windows, mingw.org
389 // c:\mingw\lib\gcc\mingw32\4.8.1\include\c++
390 // c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\mingw32
391 // c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\backward
392 // c:\mingw\include
393 // c:\mingw\mingw32\include
394 
395 // Windows, mingw-w64 mingw-builds
396 // c:\mingw32\i686-w64-mingw32\include
397 // c:\mingw32\i686-w64-mingw32\include\c++
398 // c:\mingw32\i686-w64-mingw32\include\c++\i686-w64-mingw32
399 // c:\mingw32\i686-w64-mingw32\include\c++\backward
400 
401 // Windows, mingw-w64 msys2
402 // c:\msys64\mingw32\include
403 // c:\msys64\mingw32\i686-w64-mingw32\include
404 // c:\msys64\mingw32\include\c++\4.9.2
405 // c:\msys64\mingw32\include\c++\4.9.2\i686-w64-mingw32
406 // c:\msys64\mingw32\include\c++\4.9.2\backward
407 
408 // openSUSE
409 // /usr/lib64/gcc/x86_64-w64-mingw32/5.1.0/include/c++
410 // /usr/lib64/gcc/x86_64-w64-mingw32/5.1.0/include/c++/x86_64-w64-mingw32
411 // /usr/lib64/gcc/x86_64-w64-mingw32/5.1.0/include/c++/backward
412 // /usr/x86_64-w64-mingw32/sys-root/mingw/include
413 
414 // Arch Linux
415 // /usr/i686-w64-mingw32/include/c++/5.1.0
416 // /usr/i686-w64-mingw32/include/c++/5.1.0/i686-w64-mingw32
417 // /usr/i686-w64-mingw32/include/c++/5.1.0/backward
418 // /usr/i686-w64-mingw32/include
419 
420 // Ubuntu
421 // /usr/include/c++/4.8
422 // /usr/include/c++/4.8/x86_64-w64-mingw32
423 // /usr/include/c++/4.8/backward
424 // /usr/x86_64-w64-mingw32/include
425 
426 void toolchains::MinGW::AddClangSystemIncludeArgs(const ArgList &DriverArgs,
427  ArgStringList &CC1Args) const {
428  if (DriverArgs.hasArg(options::OPT_nostdinc))
429  return;
430 
431  if (!DriverArgs.hasArg(options::OPT_nobuiltininc)) {
432  SmallString<1024> P(getDriver().ResourceDir);
433  llvm::sys::path::append(P, "include");
434  addSystemInclude(DriverArgs, CC1Args, P.str());
435  }
436 
437  if (DriverArgs.hasArg(options::OPT_nostdlibinc))
438  return;
439 
440  if (GetRuntimeLibType(DriverArgs) == ToolChain::RLT_Libgcc) {
441  // openSUSE
442  addSystemInclude(DriverArgs, CC1Args,
443  Base + Arch + "/sys-root/mingw/include");
444  }
445 
446  addSystemInclude(DriverArgs, CC1Args,
447  Base + Arch + llvm::sys::path::get_separator() + "include");
448  addSystemInclude(DriverArgs, CC1Args, Base + "include");
449 }
450 
452  const ArgList &DriverArgs, ArgStringList &CC1Args) const {
453  if (DriverArgs.hasArg(options::OPT_nostdlibinc) ||
454  DriverArgs.hasArg(options::OPT_nostdincxx))
455  return;
456 
457  switch (GetCXXStdlibType(DriverArgs)) {
459  addSystemInclude(DriverArgs, CC1Args,
460  Base + "include" + llvm::sys::path::get_separator() +
461  "c++" + llvm::sys::path::get_separator() + "v1");
462  break;
463 
465  llvm::SmallVector<llvm::SmallString<1024>, 4> CppIncludeBases;
466  CppIncludeBases.emplace_back(Base);
467  llvm::sys::path::append(CppIncludeBases[0], Arch, "include", "c++");
468  CppIncludeBases.emplace_back(Base);
469  llvm::sys::path::append(CppIncludeBases[1], Arch, "include", "c++", Ver);
470  CppIncludeBases.emplace_back(Base);
471  llvm::sys::path::append(CppIncludeBases[2], "include", "c++", Ver);
472  CppIncludeBases.emplace_back(GccLibDir);
473  llvm::sys::path::append(CppIncludeBases[3], "include", "c++");
474  for (auto &CppIncludeBase : CppIncludeBases) {
475  addSystemInclude(DriverArgs, CC1Args, CppIncludeBase);
476  CppIncludeBase += llvm::sys::path::get_separator();
477  addSystemInclude(DriverArgs, CC1Args, CppIncludeBase + Arch);
478  addSystemInclude(DriverArgs, CC1Args, CppIncludeBase + "backward");
479  }
480  break;
481  }
482 }
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:426
static bool findGccVersion(StringRef LibDir, std::string &GccLibDir, std::string &Ver)
Definition: MinGW.cpp:255
Tool * getTool(Action::ActionClass AC) const override
Definition: MinGW.cpp:333
StringRef P
void AddRunTimeLibs(const ToolChain &TC, const Driver &D, llvm::opt::ArgStringList &CmdArgs, const llvm::opt::ArgList &Args)
std::string GetLinkerPath() const
Returns the linker path, respecting the -fuse-ld= argument to determine the linker suffix or name...
Definition: ToolChain.cpp:399
void print(raw_ostream &OS) const
Print information about the detected CUDA installation.
Definition: Cuda.cpp:228
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:356
path_list & getProgramPaths()
Definition: ToolChain.h:205
Tool * buildLinker() const override
Definition: MinGW.cpp:352
bool isPIEDefault() const override
Test whether this toolchain defaults to PIE.
Definition: MinGW.cpp:364
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:391
path_list & getFilePaths()
Definition: ToolChain.h:202
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:752
Driver - Encapsulate logic for constructing compilation processes from a set of gcc-driver-like comma...
Definition: Driver.h:65
llvm::ExceptionHandling GetExceptionModel(const llvm::opt::ArgList &Args) const override
GetExceptionModel - Return the tool chain exception model.
Definition: MinGW.cpp:371
void printVerboseInfo(raw_ostream &OS) const override
Dispatch to the specific toolchain for verbose printing.
Definition: MinGW.cpp:382
Tool * buildAssembler() const override
Definition: MinGW.cpp:348
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:183
void AddCudaIncludeArgs(const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CC1Args) const
Definition: Cuda.cpp:185
bool isPICDefaultForced() const override
Tests whether this toolchain forces its default for PIC, PIE or non-PIC.
Definition: MinGW.cpp:366
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:740
const Driver & getDriver() const
Definition: ToolChain.h:167
void AddCudaIncludeArgs(const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CC1Args) const override
Add arguments to use system-specific CUDA includes.
Definition: MinGW.cpp:377
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:664
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:626
bool ShouldLinkCXXStdlib(const llvm::opt::ArgList &Args) const
Returns if the C++ standard library should be linked in.
Definition: ToolChain.cpp:717
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:276
virtual CXXStdlibType GetCXXStdlibType(const llvm::opt::ArgList &Args) const
Definition: ToolChain.cpp:645
bool IsIntegratedAssemblerDefault() const override
IsIntegratedAssemblerDefault - Does this tool chain enable -integrated-as by default.
Definition: MinGW.cpp:331
bool isPICDefault() const override
Test whether this toolchain defaults to PIC.
Definition: MinGW.cpp:360
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:451
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:723
Engages in a tight little dance with the lexer to efficiently preprocess tokens.
Definition: Preprocessor.h:127
ToolChain - Access to tools for a single platform.
Definition: ToolChain.h:73