clang: lib/Driver/ToolChains/MipsLinux.cpp Source File (original) (raw)
1
2
3
4
5
6
7
8
15#include "llvm/Option/ArgList.h"
16#include "llvm/Support/FileSystem.h"
17#include "llvm/Support/Path.h"
18
21using namespace clang;
23
24
26 const llvm::Triple &Triple,
27 const ArgList &Args)
29
34
35
39}
40
42 const ArgList &DriverArgs, ArgStringList &CC1Args) const {
43 if (DriverArgs.hasArg(clang::driver::options::OPT_nostdinc))
44 return;
45
47
48 if (!DriverArgs.hasArg(options::OPT_nobuiltininc)) {
50 llvm::sys::path::append(P, "include");
52 }
53
54 if (DriverArgs.hasArg(options::OPT_nostdlibinc))
55 return;
56
58 if (Callback) {
61 }
62}
63
66}
67
71
72 const std::string InstalledDir(getDriver().Dir);
73 std::string SysRootPath =
74 InstalledDir + "/../sysroot" + SelectedMultilibs.back().osSuffix();
75 if (llvm::sys::fs::exists(SysRootPath))
76 return SysRootPath;
77
78 return std::string();
79}
80
83 Arg *A = Args.getLastArg(options::OPT_stdlib_EQ);
84 if (A) {
85 StringRef Value = A->getValue();
86 if (Value != "libc++")
87 getDriver().Diag(clang::diag::err_drv_invalid_stdlib_name)
88 << A->getAsString(Args);
89 }
90
92}
93
95 const llvm::opt::ArgList &DriverArgs,
96 llvm::opt::ArgStringList &CC1Args) const {
100 if (llvm::sys::fs::exists(Path)) {
102 return;
103 }
104 }
105 }
106}
107
109 ArgStringList &CmdArgs) const {
111 "Only -lc++ (aka libxx) is supported in this toolchain.");
112
113 CmdArgs.push_back("-lc++");
114 if (Args.hasArg(options::OPT_fexperimental_library))
115 CmdArgs.push_back("-lc++experimental");
116 CmdArgs.push_back("-lc++abi");
117 CmdArgs.push_back("-lunwind");
118}
119
121 StringRef Component,
124 llvm::sys::path::append(Path, SelectedMultilibs.back().osSuffix(), "lib" + LibSuffix,
126 const char *Suffix;
127 switch (Type) {
129 Suffix = ".o";
130 break;
132 Suffix = ".a";
133 break;
135 Suffix = ".so";
136 break;
137 }
138 llvm::sys::path::append(
139 Path, Twine("libclang_rt." + Component + "-" + "mips" + Suffix));
140 return std::string(Path);
141}
The base class of the type hierarchy.
Driver - Encapsulate logic for constructing compilation processes from a set of gcc-driver-like comma...
std::string SysRoot
sysroot, if present
DiagnosticBuilder Diag(unsigned DiagID) const
std::string Dir
The path the driver executable was in, as invoked from the command line.
const IncludeDirsFunc & includeDirsCallback() const
bool findMIPSMultilibs(const Driver &D, const llvm::Triple &TargetTriple, StringRef Path, const llvm::opt::ArgList &Args, DetectedMultilibs &Result)
The JSON file list parser is used to communicate input to InstallAPI.
@ Result
The result type of a method or function.