comparison dmd/mars.c @ 131:5825d48b27d1 trunk

[svn r135] * Merged DMD 1.025 * * Fixed a minor linking order mishap * * Added an command line option -annotate * * Fixed some problems with running optimizations * * Added std.stdio and dependencies to lphobos (still not 100% working, but compiles and links) * * Fixed problems with passing aggregate types to variadic functions * * Added initial code towards full GC support, currently based on malloc and friends, not all the runtime calls the GC yet for memory * * Fixed problems with resolving nested function context pointers for some heavily nested cases * * Redid function argument passing + other minor code cleanups, still lots to do on this end... *
author lindquist
date Fri, 04 Jan 2008 01:38:42 +0100
parents a7dfa0ed966c
children 1700239cab2e
comparison
equal deleted inserted replaced
130:a7dfa0ed966c 131:5825d48b27d1
69 #endif 69 #endif
70 70
71 copyright = "Copyright (c) 1999-2007 by Digital Mars and Tomas Lindquist Olsen"; 71 copyright = "Copyright (c) 1999-2007 by Digital Mars and Tomas Lindquist Olsen";
72 written = "written by Walter Bright and Tomas Lindquist Olsen"; 72 written = "written by Walter Bright and Tomas Lindquist Olsen";
73 llvmdc_version = "0.1"; 73 llvmdc_version = "0.1";
74 version = "v1.024"; 74 version = "v1.025";
75 global.structalign = 8; 75 global.structalign = 8;
76 76
77 memset(&params, 0, sizeof(Param)); 77 memset(&params, 0, sizeof(Param));
78 } 78 }
79 79
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\
167 dmd files.d ... { -switch }\n\ 167 dmd files.d ... { -switch }\n\
168 \n\ 168 \n\
169 files.d D source files\n%s\ 169 files.d D source files\n%s\
170 -annotate annotate the bitcode with human readable source code\n\
170 -c do not link\n\ 171 -c do not link\n\
171 -cov do code coverage analysis\n\ 172 -cov do code coverage analysis\n\
172 -D generate documentation\n\ 173 -D generate documentation\n\
173 -Dd<docdir> write documentation file to <docdir> directory\n\ 174 -Dd<docdir> write documentation file to <docdir> directory\n\
174 -Df<filename> write documentation file to <filename>\n\ 175 -Df<filename> write documentation file to <filename>\n\
288 289
289 global.params.llvmArch = 0; 290 global.params.llvmArch = 0;
290 global.params.forceBE = 0; 291 global.params.forceBE = 0;
291 global.params.noruntime = 0; 292 global.params.noruntime = 0;
292 global.params.novalidate = 0; 293 global.params.novalidate = 0;
293 global.params.optimizeLevel = 2; 294 global.params.optimizeLevel = -1;
294 global.params.runtimeImppath = 0; 295 global.params.runtimeImppath = 0;
295 296
296 global.params.defaultlibname = "phobos"; 297 global.params.defaultlibname = "phobos";
297 global.params.debuglibname = global.params.defaultlibname; 298 global.params.debuglibname = global.params.defaultlibname;
298 299
368 else if (strcmp(p + 1, "w") == 0) 369 else if (strcmp(p + 1, "w") == 0)
369 global.params.warnings = 1; 370 global.params.warnings = 1;
370 else if (p[1] == 'O') 371 else if (p[1] == 'O')
371 { 372 {
372 global.params.optimize = 1; 373 global.params.optimize = 1;
374 global.params.optimizeLevel = 2;
373 if (p[2] != 0) { 375 if (p[2] != 0) {
374 int optlevel = atoi(p+2); 376 int optlevel = atoi(p+2);
375 if (optlevel < 0 || optlevel > 5) { 377 if (optlevel < 0 || optlevel > 5) {
376 error("Optimization level must be between 0 and 5. Using default (%d)", 378 error("Optimization level must be between 0 and 5. Using default (%d)",
377 global.params.optimizeLevel); 379 global.params.optimizeLevel);
387 global.params.noruntime = 1; 389 global.params.noruntime = 1;
388 else if (strcmp(p + 1, "noverify") == 0) 390 else if (strcmp(p + 1, "noverify") == 0)
389 global.params.novalidate = 1; 391 global.params.novalidate = 1;
390 else if (strcmp(p + 1, "dis") == 0) 392 else if (strcmp(p + 1, "dis") == 0)
391 global.params.disassemble = 1; 393 global.params.disassemble = 1;
394 else if (strcmp(p + 1, "annotate") == 0)
395 global.params.llvmAnnotate = 1;
392 else if (p[1] == 'o') 396 else if (p[1] == 'o')
393 { 397 {
394 switch (p[2]) 398 switch (p[2])
395 { 399 {
396 case '-': 400 case '-':
681 } 685 }
682 } 686 }
683 687
684 if (strcmp(global.params.llvmArch,"x86")==0) { 688 if (strcmp(global.params.llvmArch,"x86")==0) {
685 VersionCondition::addPredefinedGlobalIdent("X86"); 689 VersionCondition::addPredefinedGlobalIdent("X86");
690 //VersionCondition::addPredefinedGlobalIdent("LLVM_InlineAsm_X86");
686 global.params.isLE = true; 691 global.params.isLE = true;
687 global.params.is64bit = false; 692 global.params.is64bit = false;
688 tt_arch = "i686"; 693 tt_arch = "i686";
689 data_layout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:8"; 694 data_layout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:8";
690 } 695 }
691 else if (strcmp(global.params.llvmArch,"x86-64")==0) { 696 else if (strcmp(global.params.llvmArch,"x86-64")==0) {
692 VersionCondition::addPredefinedGlobalIdent("X86_64"); 697 VersionCondition::addPredefinedGlobalIdent("X86_64");
698 //VersionCondition::addPredefinedGlobalIdent("LLVM_InlineAsm_X86_64");
693 global.params.isLE = true; 699 global.params.isLE = true;
694 global.params.is64bit = true; 700 global.params.is64bit = true;
695 tt_arch = "x86_64"; 701 tt_arch = "x86_64";
696 data_layout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:8"; 702 data_layout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:8";
697 } 703 }