comparison gen/cl_options.cpp @ 988:2667e3a145be

- Fixed LLVM style CL args for D2. - Moved main() into its own file gen/main.cpp - Fixed basic cross compilation - removed the option for setting OS - added support for llc's mattr, mcpu and mtriple switches - added basic ABI abstraction for return value rewrites, it's not perfect and will probably be completely rewritten once I get to handling parameter rewrites as well. - x86-64 extern(C) abi for cfloat returns now match (llvm-)gcc.
author Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
date Thu, 26 Feb 2009 14:11:49 +0100
parents a8cb25d478c4
children d1ec9ff0e9ba
comparison
equal deleted inserted replaced
987:73ff89728d85 988:2667e3a145be
228 static cl::alias m("m", 228 static cl::alias m("m",
229 cl::desc("Alias for '-march' for backwards compatibility"), 229 cl::desc("Alias for '-march' for backwards compatibility"),
230 cl::Prefix, 230 cl::Prefix,
231 cl::aliasopt(mArch)); 231 cl::aliasopt(mArch));
232 232
233 233 cl::opt<std::string> mCPU("mcpu",
234 static cl::opt<OS, true> os("t", 234 cl::desc("Target a specific cpu type (-mcpu=help for details)"),
235 cl::desc("Emit code for the specified OS:"), 235 cl::value_desc("cpu-name"),
236 cl::values( 236 cl::init(""));
237 #define ENUMVAL_N(Name, Desc) clEnumValN(OS##Name, #Name, Desc) 237
238 #define ENUMVAL(Name) ENUMVAL_N(Name, #Name) 238 cl::list<std::string> mAttrs("mattr",
239 ENUMVAL(Linux), 239 cl::CommaSeparated,
240 ENUMVAL(Windows), 240 cl::desc("Target specific attributes (-mattr=help for details)"),
241 ENUMVAL_N(MacOSX, "Mac OS X"), 241 cl::value_desc("a1,+a2,-a3,..."));
242 ENUMVAL(FreeBSD), 242
243 ENUMVAL(Solaris), 243 cl::opt<std::string> mTargetTriple("mtriple",
244 #undef ENUMVAL 244 cl::desc("Override target triple"));
245 #undef ENUMVAL_N
246 clEnumValEnd),
247 cl::Prefix,
248 cl::location(global.params.os));
249 245
250 246
251 // "Hidden debug switches" 247 // "Hidden debug switches"
252 // Are these ever used? 248 // Are these ever used?
253 static cl::opt<bool, true> debuga("hidden-debug--a", 249 static cl::opt<bool, true> debuga("hidden-debug--a",