clang: lib/Driver/ToolChains/VEToolchain.cpp Source File (original) (raw)
1
2
3
4
5
6
7
8
14#include "llvm/Option/ArgList.h"
15#include "llvm/Support/FileSystem.h"
16#include "llvm/Support/Path.h"
17#include
18
21using namespace clang;
23
24
26 const ArgList &Args)
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
47
48
49
50
51
52
58}
59
62}
63
66}
67
69
71 return false;
72}
73
75
77
79
81 ArgStringList &CC1Args) const {
82 if (DriverArgs.hasArg(clang::driver::options::OPT_nostdinc))
83 return;
84
85 if (DriverArgs.hasArg(options::OPT_nobuiltininc) &&
86 DriverArgs.hasArg(options::OPT_nostdlibinc))
87 return;
88
89 if (!DriverArgs.hasArg(options::OPT_nobuiltininc)) {
91 llvm::sys::path::append(P, "include");
93 }
94
95 if (!DriverArgs.hasArg(options::OPT_nostdlibinc)) {
96 if (const char *cl_include_dir = getenv("NCC_C_INCLUDE_PATH")) {
98 const char EnvPathSeparatorStr[] = {llvm::sys::EnvPathSeparator, '\0'};
99 StringRef(cl_include_dir).split(Dirs, StringRef(EnvPathSeparatorStr));
102 } else {
104 getDriver().SysRoot + "/opt/nec/ve/include");
105 }
106 }
107}
108
110 ArgStringList &CC1Args,
112 CC1Args.push_back("-nostdsysteminc");
113 bool UseInitArrayDefault = true;
114 if (!DriverArgs.hasFlag(options::OPT_fuse_init_array,
115 options::OPT_fno_use_init_array, UseInitArrayDefault))
116 CC1Args.push_back("-fno-use-init-array");
117}
118
120 ArgStringList &CC1Args) const {
121 if (DriverArgs.hasArg(clang::driver::options::OPT_nostdinc) ||
122 DriverArgs.hasArg(options::OPT_nostdlibinc) ||
123 DriverArgs.hasArg(options::OPT_nostdincxx))
124 return;
125 if (const char *cl_include_dir = getenv("NCC_CPLUS_INCLUDE_PATH")) {
127 const char EnvPathSeparatorStr[] = {llvm::sys::EnvPathSeparator, '\0'};
128 StringRef(cl_include_dir).split(Dirs, StringRef(EnvPathSeparatorStr));
131 } else {
132
133
134
136 }
137}
138
140 ArgStringList &CmdArgs) const {
142 "Only -lc++ (aka libxx) is supported in this toolchain.");
143
145
146
148 CmdArgs.push_back("-rpath");
149 CmdArgs.push_back(Args.MakeArgString(*Path));
150 }
151
152 CmdArgs.push_back("-lc++");
153 if (Args.hasArg(options::OPT_fexperimental_library))
154 CmdArgs.push_back("-lc++experimental");
155 CmdArgs.push_back("-lc++abi");
156 CmdArgs.push_back("-lunwind");
157
158 CmdArgs.push_back("-lpthread");
159
160 CmdArgs.push_back("-ldl");
161}
162
163llvm::ExceptionHandling
165
166 return llvm::ExceptionHandling::SjLj;
167}
Driver - Encapsulate logic for constructing compilation processes from a set of gcc-driver-like comma...
The JSON file list parser is used to communicate input to InstallAPI.