comparison dmd/mars.c @ 133:44a95ac7368a trunk

[svn r137] Many fixes towards tango.io.Console working, but not quite there yet... In particular, assertions has been fixed to include file/line info, and much more!
author lindquist
date Mon, 14 Jan 2008 05:11:54 +0100
parents 1700239cab2e
children 0ab29b838084
comparison
equal deleted inserted replaced
132:1700239cab2e 133:44a95ac7368a
156 extern void backend_init(); 156 extern void backend_init();
157 extern void backend_term(); 157 extern void backend_term();
158 158
159 void usage() 159 void usage()
160 { 160 {
161 printf("LLVM D Compiler %s (based on DMD %s)\n%s\n%s\n", 161 printf("LLVM D Compiler %s (based on DMD %s and LLVM 2.2)\n%s\n%s\n",
162 global.llvmdc_version, global.version, global.copyright, global.written); 162 global.llvmdc_version, global.version, global.copyright, global.written);
163 printf("\ 163 printf("\
164 D Language Documentation: http://www.digitalmars.com/d/1.0/index.html\n\ 164 D Language Documentation: http://www.digitalmars.com/d/1.0/index.html\n\
165 LLVMDC Homepage: http://www.dsource.org/projects/llvmdc\n\ 165 LLVMDC Homepage: http://www.dsource.org/projects/llvmdc\n\
166 Usage:\n\ 166 Usage:\n\
185 -H generate 'header' file\n\ 185 -H generate 'header' file\n\
186 -Hd<hdrdir> write 'header' file to <hdrdir> directory\n\ 186 -Hd<hdrdir> write 'header' file to <hdrdir> directory\n\
187 -Hf<filename> write 'header' file to <filename>\n\ 187 -Hf<filename> write 'header' file to <filename>\n\
188 --help print help\n\ 188 --help print help\n\
189 -I<path> where to look for imports\n\ 189 -I<path> where to look for imports\n\
190 -E<path> where to look for the core runtime\n\
191 -J<path> where to look for string imports\n\ 190 -J<path> where to look for string imports\n\
192 -inline do function inlining\n\ 191 -inline do function inlining\n\
193 -Llinkerflag pass linkerflag to link\n\ 192 -Llinkerflag pass linkerflag to link\n\
194 -m<arch> emit code specific to <arch>\n\ 193 -m<arch> emit code specific to <arch>\n\
195 x86 x86-64 ppc32 ppc64\n\ 194 x86 x86-64 ppc32 ppc64\n\
204 -op do not strip paths from source file\n\ 203 -op do not strip paths from source file\n\
205 -profile profile runtime performance of generated code\n\ 204 -profile profile runtime performance of generated code\n\
206 -quiet suppress unnecessary messages\n\ 205 -quiet suppress unnecessary messages\n\
207 -release compile release version\n\ 206 -release compile release version\n\
208 -run srcfile args... run resulting program, passing args\n\ 207 -run srcfile args... run resulting program, passing args\n\
208 -R<path> provide path to the directory containing the runtime library\n\
209 -unittest compile in unit tests\n\ 209 -unittest compile in unit tests\n\
210 -v verbose\n\ 210 -v verbose\n\
211 -vv very verbose (does not include -v)\n\ 211 -vv very verbose (does not include -v)\n\
212 -v1 D language version 1\n\ 212 -v1 D language version 1\n\
213 -version=level compile in version code >= level\n\ 213 -version=level compile in version code >= level\n\
384 global.params.optimizeLevel = optlevel; 384 global.params.optimizeLevel = optlevel;
385 } 385 }
386 } 386 }
387 } 387 }
388 else if (strcmp(p + 1, "forcebe") == 0) 388 else if (strcmp(p + 1, "forcebe") == 0)
389 global.params.forceBE = 1; 389 global.params.forceBE = 1;
390 else if (strcmp(p + 1, "noruntime") == 0) 390 else if (strcmp(p + 1, "noruntime") == 0)
391 global.params.noruntime = 1; 391 global.params.noruntime = 1;
392 else if (strcmp(p + 1, "noverify") == 0) 392 else if (strcmp(p + 1, "noverify") == 0)
393 global.params.novalidate = 1; 393 global.params.novalidate = 1;
394 else if (strcmp(p + 1, "dis") == 0) 394 else if (strcmp(p + 1, "dis") == 0)
395 global.params.disassemble = 1; 395 global.params.disassemble = 1;
396 else if (strcmp(p + 1, "annotate") == 0) 396 else if (strcmp(p + 1, "annotate") == 0)
397 global.params.llvmAnnotate = 1; 397 global.params.llvmAnnotate = 1;
398 else if (p[1] == 'o') 398 else if (p[1] == 'o')
399 { 399 {
400 switch (p[2]) 400 switch (p[2])
401 { 401 {
402 case '-': 402 case '-':
501 { 501 {
502 if (!global.params.fileImppath) 502 if (!global.params.fileImppath)
503 global.params.fileImppath = new Array(); 503 global.params.fileImppath = new Array();
504 global.params.fileImppath->push(p + 2); 504 global.params.fileImppath->push(p + 2);
505 } 505 }
506 else if (p[1] == 'E') 506 else if (p[1] == 'R')
507 { 507 {
508 global.params.runtimeImppath = p+2; 508 global.params.runtimePath = p+2;
509 } 509 }
510 else if (memcmp(p + 1, "debug", 5) == 0 && p[6] != 'l') 510 else if (memcmp(p + 1, "debug", 5) == 0 && p[6] != 'l')
511 { 511 {
512 // Parse: 512 // Parse:
513 // -debug 513 // -debug
669 669
670 bool allowForceEndianness = false; 670 bool allowForceEndianness = false;
671 671
672 if (global.params.llvmArch == 0) { 672 if (global.params.llvmArch == 0) {
673 std::string err_str; 673 std::string err_str;
674 const llvm::TargetMachineRegistry::Entry* e = llvm::TargetMachineRegistry::getClosestTargetForJIT(err_str); 674 const llvm::TargetMachineRegistry::entry* e = llvm::TargetMachineRegistry::getClosestTargetForJIT(err_str);
675 if (e == 0) { 675 if (e == 0) {
676 error("Failed to find a default target machine: %s", err_str.c_str()); 676 error("Failed to find a default target machine: %s", err_str.c_str());
677 fatal(); 677 fatal();
678 } 678 }
679 else { 679 else {