comparison runtime/ldc.diff @ 754:f34b552619fd

Update tango patch to latest tango revision.
author Christian Kamm <kamm incasoftware de>
date Sat, 08 Nov 2008 10:22:08 +0100
parents f0ba5d37dd86
children 61c7a96f28c3
comparison
equal deleted inserted replaced
753:405e40f20ef9 754:f34b552619fd
1 Index: object.di 1 Index: object.di
2 =================================================================== 2 ===================================================================
3 --- object.di (revision 4002) 3 --- object.di (revision 4071)
4 +++ object.di (working copy) 4 +++ object.di (working copy)
5 @@ -150,6 +150,9 @@ 5 @@ -150,6 +150,9 @@
6 void function() dtor; 6 void function() dtor;
7 void function() unitTest; 7 void function() unitTest;
8 8
10 + void function() ictor; 10 + void function() ictor;
11 + 11 +
12 static int opApply( int delegate( inout ModuleInfo ) ); 12 static int opApply( int delegate( inout ModuleInfo ) );
13 } 13 }
14 14
15 Index: lib/unittest.sh
16 ===================================================================
17 --- lib/unittest.sh (revision 4071)
18 +++ lib/unittest.sh (working copy)
19 @@ -18,8 +18,9 @@
20 --help: This message
21 --run-all: Reports result instead of breaking. Do not use this if you want to
22 run unittest runner through a debugger.
23 - dmd: Builds unittests for dmd
24 - gdc: Builds unittests for gdc
25 + dmd: Builds unittests for dmd
26 + gdc: Builds unittests for gdc
27 + ldc: Builds unittests for ldc
28
29 <none>: Builds unittests for all known compilers.'
30 exit 0
31 @@ -86,7 +87,7 @@
32 void main() {}
33 EOF
34
35 - rebuild -w -d -g -L-ldl -L-lz -L-lbz2 -debug=UnitTest -debug -full -clean -unittest \
36 + rebuild -w -d -L-ldl -L-lz -L-lbz2 -debug=UnitTest -debug -full -clean -unittest \
37 -version=UnitTest $EXE.d tango/core/*.d tango/core/sync/*.d tango/io/digest/*.d \
38 tango/io/model/*.d tango/io/protocol/*.d tango/io/selector/*.d tango/io/*.d \
39 tango/io/vfs/*.d tango/io/vfs/model/*.d \
40 @@ -125,6 +126,9 @@
41 gdc)
42 GDC=1
43 ;;
44 + ldc)
45 + LDC=1
46 + ;;
47 *)
48 usage
49 ;;
50 @@ -132,10 +136,11 @@
51 shift
52 done
53
54 -if [ ! "$DMD" -a ! "$GDC" ]
55 +if [ ! "$DMD" -a ! "$GDC" -a ! "$LDC" ]
56 then
57 DMD=1
58 GDC=1
59 + LDC=1
60 fi
61
62 if [ "$DMD" = "1" ]
63 @@ -146,4 +151,7 @@
64 then
65 compile gdc runUnitTest_gdc
66 fi
67 -
68 +if [ "$LDC" = "1" ]
69 +then
70 + compile ldc runUnitTest_ldc
71 +fi
15 Index: lib/common/tango/core/BitManip.d 72 Index: lib/common/tango/core/BitManip.d
16 =================================================================== 73 ===================================================================
17 --- lib/common/tango/core/BitManip.d (revision 4002) 74 --- lib/common/tango/core/BitManip.d (revision 4071)
18 +++ lib/common/tango/core/BitManip.d (working copy) 75 +++ lib/common/tango/core/BitManip.d (working copy)
19 @@ -171,6 +171,10 @@ 76 @@ -171,6 +171,10 @@
20 */ 77 */
21 uint outpl( uint port_address, uint value ); 78 uint outpl( uint port_address, uint value );
22 } 79 }
27 else 84 else
28 { 85 {
29 public import std.intrinsic; 86 public import std.intrinsic;
30 Index: lib/common/tango/core/Thread.d 87 Index: lib/common/tango/core/Thread.d
31 =================================================================== 88 ===================================================================
32 --- lib/common/tango/core/Thread.d (revision 4002) 89 --- lib/common/tango/core/Thread.d (revision 4071)
33 +++ lib/common/tango/core/Thread.d (working copy) 90 +++ lib/common/tango/core/Thread.d (working copy)
34 @@ -235,6 +235,7 @@ 91 @@ -247,6 +247,7 @@
35 // used to track the number of suspended threads 92 // used to track the number of suspended threads
36 // 93 //
37 sem_t suspendCount; 94 sem_t suspendCount;
38 + sem_t* suspendCountPtr; 95 + sem_t* suspendCountPtr;
39 96
40 97
41 extern (C) void thread_suspendHandler( int sig ) 98 extern (C) void thread_suspendHandler( int sig )
42 @@ -244,8 +245,29 @@ 99 @@ -256,8 +257,29 @@
43 } 100 }
44 body 101 body
45 { 102 {
46 - version( D_InlineAsm_X86 ) 103 - version( D_InlineAsm_X86 )
47 + version( LDC) 104 + version( LDC)
68 + else version( D_InlineAsm_X86 ) 125 + else version( D_InlineAsm_X86 )
69 + { 126 + {
70 asm 127 asm
71 { 128 {
72 pushad; 129 pushad;
73 @@ -286,7 +308,7 @@ 130 @@ -298,7 +320,7 @@
74 status = sigdelset( &sigres, SIGUSR2 ); 131 status = sigdelset( &sigres, SIGUSR2 );
75 assert( status == 0 ); 132 assert( status == 0 );
76 133
77 - status = sem_post( &suspendCount ); 134 - status = sem_post( &suspendCount );
78 + status = sem_post( suspendCountPtr ); 135 + status = sem_post( suspendCountPtr );
79 assert( status == 0 ); 136 assert( status == 0 );
80 137
81 sigsuspend( &sigres ); 138 sigsuspend( &sigres );
82 @@ -297,8 +319,12 @@ 139 @@ -309,8 +331,12 @@
83 } 140 }
84 } 141 }
85 142
86 - version( D_InlineAsm_X86 ) 143 - version( D_InlineAsm_X86 )
87 + version( LDC) 144 + version( LDC)
91 + else version( D_InlineAsm_X86 ) 148 + else version( D_InlineAsm_X86 )
92 + { 149 + {
93 asm 150 asm
94 { 151 {
95 popad; 152 popad;
96 @@ -1572,8 +1598,14 @@ 153 @@ -1584,8 +1610,14 @@
97 status = sigaction( SIGUSR2, &sigusr2, null ); 154 status = sigaction( SIGUSR2, &sigusr2, null );
98 assert( status == 0 ); 155 assert( status == 0 );
99 156
100 - status = sem_init( &suspendCount, 0, 0 ); 157 - status = sem_init( &suspendCount, 0, 0 );
101 - assert( status == 0 ); 158 - assert( status == 0 );
108 + assert(status==0); 165 + assert(status==0);
109 + } 166 + }
110 167
111 status = pthread_key_create( &Thread.sm_this, null ); 168 status = pthread_key_create( &Thread.sm_this, null );
112 assert( status == 0 ); 169 assert( status == 0 );
113 @@ -1781,7 +1813,7 @@ 170 @@ -1793,7 +1825,7 @@
114 // to simply loop on sem_wait at the end, but I'm not 171 // to simply loop on sem_wait at the end, but I'm not
115 // convinced that this would be much faster than the 172 // convinced that this would be much faster than the
116 // current approach. 173 // current approach.
117 - sem_wait( &suspendCount ); 174 - sem_wait( &suspendCount );
118 + sem_wait( suspendCountPtr ); 175 + sem_wait( suspendCountPtr );
119 } 176 }
120 else if( !t.m_lock ) 177 else if( !t.m_lock )
121 { 178 {
122 @@ -2286,6 +2318,13 @@ 179 @@ -2298,6 +2330,13 @@
123 version = AsmPPC_Posix; 180 version = AsmPPC_Posix;
124 } 181 }
125 182
126 + version( LLVM_InlineAsm_X86 ) 183 + version( LLVM_InlineAsm_X86 )
127 + { 184 + {
131 + version = LLVM_AsmX86_Posix; 188 + version = LLVM_AsmX86_Posix;
132 + } 189 + }
133 190
134 version( Posix ) 191 version( Posix )
135 { 192 {
136 @@ -2296,6 +2328,8 @@ 193 @@ -2308,6 +2347,8 @@
137 version( AsmX86_Win32 ) {} else 194 version( AsmX86_Win32 ) {} else
138 version( AsmX86_Posix ) {} else 195 version( AsmX86_Posix ) {} else
139 version( AsmPPC_Posix ) {} else 196 version( AsmPPC_Posix ) {} else
140 + version( LLVM_AsmX86_Win32 ) {} else 197 + version( LLVM_AsmX86_Win32 ) {} else
141 + version( LLVM_AsmX86_Posix ) {} else 198 + version( LLVM_AsmX86_Posix ) {} else
142 { 199 {
143 // NOTE: The ucontext implementation requires architecture specific 200 // NOTE: The ucontext implementation requires architecture specific
144 // data definitions to operate so testing for it must be done 201 // data definitions to operate so testing for it must be done
145 @@ -2306,10 +2340,10 @@ 202 @@ -2318,10 +2359,10 @@
146 import tango.stdc.posix.ucontext; 203 import tango.stdc.posix.ucontext;
147 } 204 }
148 } 205 }
149 - 206 -
150 - const size_t PAGESIZE; 207 - const size_t PAGESIZE;
153 +// this can't be private since it's used as default argument to a public function 210 +// this can't be private since it's used as default argument to a public function
154 +const size_t PAGESIZE; 211 +const size_t PAGESIZE;
155 212
156 static this() 213 static this()
157 { 214 {
158 @@ -2336,7 +2370,7 @@ 215 @@ -2348,7 +2389,7 @@
159 } 216 }
160 } 217 }
161 218
162 - 219 -
163 +extern(C) int printf(char*, ...); 220 +extern(C) int printf(char*, ...);
164 //////////////////////////////////////////////////////////////////////////////// 221 ////////////////////////////////////////////////////////////////////////////////
165 // Fiber Entry Point and Context Switch 222 // Fiber Entry Point and Context Switch
166 //////////////////////////////////////////////////////////////////////////////// 223 ////////////////////////////////////////////////////////////////////////////////
167 @@ -2450,6 +2484,22 @@ 224 @@ -2462,6 +2503,22 @@
168 ret; 225 ret;
169 } 226 }
170 } 227 }
171 + else version( LLVM_AsmX86_Posix ) 228 + else version( LLVM_AsmX86_Posix )
172 + { 229 + {
185 + } 242 + }
186 + } 243 + }
187 else static if( is( ucontext_t ) ) 244 else static if( is( ucontext_t ) )
188 { 245 {
189 Fiber cfib = Fiber.getThis(); 246 Fiber cfib = Fiber.getThis();
190 @@ -3115,6 +3165,16 @@ 247 @@ -3127,6 +3184,16 @@
191 push( 0x00000000 ); // ESI 248 push( 0x00000000 ); // ESI
192 push( 0x00000000 ); // EDI 249 push( 0x00000000 ); // EDI
193 } 250 }
194 + else version( LLVM_AsmX86_Posix ) 251 + else version( LLVM_AsmX86_Posix )
195 + { 252 + {
202 + push( 0x00000000 ); // EDI 259 + push( 0x00000000 ); // EDI
203 + } 260 + }
204 else version( AsmPPC_Posix ) 261 else version( AsmPPC_Posix )
205 { 262 {
206 version( StackGrowsDown ) 263 version( StackGrowsDown )
207 Index: lib/unittest.sh
208 ===================================================================
209 --- lib/unittest.sh (revision 4002)
210 +++ lib/unittest.sh (working copy)
211 @@ -18,8 +18,9 @@
212 --help: This message
213 --run-all: Reports result instead of breaking. Do not use this if you want to
214 run unittest runner through a debugger.
215 - dmd: Builds unittests for dmd
216 - gdc: Builds unittests for gdc
217 + dmd: Builds unittests for dmd
218 + gdc: Builds unittests for gdc
219 + ldc: Builds unittests for ldc
220
221 <none>: Builds unittests for all known compilers.'
222 exit 0
223 @@ -86,7 +87,7 @@
224 void main() {}
225 EOF
226
227 - rebuild -w -d -g -L-ldl -L-lz -L-lbz2 -debug=UnitTest -debug -full -clean -unittest \
228 + rebuild -w -d -L-ldl -L-lz -L-lbz2 -debug=UnitTest -debug -full -clean -unittest \
229 -version=UnitTest $EXE.d tango/core/*.d tango/core/sync/*.d tango/io/digest/*.d \
230 tango/io/model/*.d tango/io/protocol/*.d tango/io/selector/*.d tango/io/*.d \
231 tango/io/vfs/*.d tango/io/vfs/model/*.d \
232 @@ -125,6 +126,9 @@
233 gdc)
234 GDC=1
235 ;;
236 + ldc)
237 + LDC=1
238 + ;;
239 *)
240 usage
241 ;;
242 @@ -132,10 +136,11 @@
243 shift
244 done
245
246 -if [ ! "$DMD" -a ! "$GDC" ]
247 +if [ ! "$DMD" -a ! "$GDC" -a ! "$LDC" ]
248 then
249 DMD=1
250 GDC=1
251 + LDC=1
252 fi
253
254 if [ "$DMD" = "1" ]
255 @@ -146,4 +151,7 @@
256 then
257 compile gdc runUnitTest_gdc
258 fi
259 -
260 +if [ "$LDC" = "1" ]
261 +then
262 + compile ldc runUnitTest_ldc
263 +fi
264 Index: lib/gc/basic/gcx.d 264 Index: lib/gc/basic/gcx.d
265 =================================================================== 265 ===================================================================
266 --- lib/gc/basic/gcx.d (revision 4002) 266 --- lib/gc/basic/gcx.d (revision 4071)
267 +++ lib/gc/basic/gcx.d (working copy) 267 +++ lib/gc/basic/gcx.d (working copy)
268 @@ -65,6 +65,13 @@ 268 @@ -65,6 +65,13 @@
269 } 269 }
270 270
271 271
333 else 333 else
334 { 334 {
335 asm 335 asm
336 Index: lib/gc/basic/gcbits.d 336 Index: lib/gc/basic/gcbits.d
337 =================================================================== 337 ===================================================================
338 --- lib/gc/basic/gcbits.d (revision 4002) 338 --- lib/gc/basic/gcbits.d (revision 4071)
339 +++ lib/gc/basic/gcbits.d (working copy) 339 +++ lib/gc/basic/gcbits.d (working copy)
340 @@ -39,6 +39,10 @@ 340 @@ -39,6 +39,10 @@
341 { 341 {
342 // use the unoptimized version 342 // use the unoptimized version
343 } 343 }
348 else version (D_InlineAsm_X86) 348 else version (D_InlineAsm_X86)
349 { 349 {
350 version = Asm86; 350 version = Asm86;
351 Index: lib/build-tango.sh 351 Index: lib/build-tango.sh
352 =================================================================== 352 ===================================================================
353 --- lib/build-tango.sh (revision 4002) 353 --- lib/build-tango.sh (revision 4071)
354 +++ lib/build-tango.sh (working copy) 354 +++ lib/build-tango.sh (working copy)
355 @@ -23,7 +23,7 @@ 355 @@ -23,7 +23,7 @@
356 --debug: Will enable debug info 356 --debug: Will enable debug info
357 --warn: Will enable warnings 357 --warn: Will enable warnings
358 --verbose: Increase verbosity 358 --verbose: Increase verbosity
380 mac) 380 mac)
381 # build Universal Binary version of the Tango library 381 # build Universal Binary version of the Tango library
382 build powerpc-apple-darwin8-gdmd libgtango.a.ppc libgphobos.a.ppc 382 build powerpc-apple-darwin8-gdmd libgtango.a.ppc libgphobos.a.ppc
383 Index: tango/text/convert/Layout.d 383 Index: tango/text/convert/Layout.d
384 =================================================================== 384 ===================================================================
385 --- tango/text/convert/Layout.d (revision 4002) 385 --- tango/text/convert/Layout.d (revision 4071)
386 +++ tango/text/convert/Layout.d (working copy) 386 +++ tango/text/convert/Layout.d (working copy)
387 @@ -47,6 +47,12 @@ 387 @@ -47,6 +47,12 @@
388 alias void* Arg; 388 alias void* Arg;
389 alias va_list ArgList; 389 alias va_list ArgList;
390 } 390 }
395 + alias va_list ArgList; 395 + alias va_list ArgList;
396 + } 396 + }
397 else 397 else
398 { 398 {
399 alias void* Arg; 399 alias void* Arg;
400 @@ -197,9 +203,18 @@ 400 @@ -295,7 +301,7 @@
401 assert (formatStr, "null format specifier"); 401 foreach (i, arg; arguments)
402 assert (arguments.length < 64, "too many args in Layout.convert"); 402 {
403 403 arglist[i] = args;
404 - version (GNU) 404 - args += (arg.tsize + int.sizeof - 1) & ~ (int.sizeof - 1);
405 + version (LDC)
406 {
407 Arg[64] arglist = void;
408 + foreach (i, arg; arguments)
409 + {
410 + arglist[i] = args;
411 + args += (arg.tsize + size_t.sizeof - 1) & ~ (size_t.sizeof - 1); 405 + args += (arg.tsize + size_t.sizeof - 1) & ~ (size_t.sizeof - 1);
412 + } 406 }
413 + } 407 }
414 + else version (GNU) 408 return parse (formatStr, arguments, arglist, sink);
415 + {
416 + Arg[64] arglist = void;
417 int[64] intargs = void;
418 byte[64] byteargs = void;
419 long[64] longargs = void;
420 Index: tango/net/cluster/CacheInvalidator.d 409 Index: tango/net/cluster/CacheInvalidator.d
421 =================================================================== 410 ===================================================================
422 --- tango/net/cluster/CacheInvalidator.d (revision 4002) 411 --- tango/net/cluster/CacheInvalidator.d (revision 4071)
423 +++ tango/net/cluster/CacheInvalidator.d (working copy) 412 +++ tango/net/cluster/CacheInvalidator.d (working copy)
424 @@ -79,7 +79,7 @@ 413 @@ -79,7 +79,7 @@
425 414
426 *******************************************************************************/ 415 *******************************************************************************/
427 416
430 { 419 {
431 private char[] key_; 420 private char[] key_;
432 421
433 Index: tango/core/Vararg.d 422 Index: tango/core/Vararg.d
434 =================================================================== 423 ===================================================================
435 --- tango/core/Vararg.d (revision 4002) 424 --- tango/core/Vararg.d (revision 4071)
436 +++ tango/core/Vararg.d (working copy) 425 +++ tango/core/Vararg.d (working copy)
437 @@ -15,6 +15,10 @@ 426 @@ -15,6 +15,10 @@
438 { 427 {
439 public import std.stdarg; 428 public import std.stdarg;
440 } 429 }
445 else 434 else
446 { 435 {
447 /** 436 /**
448 Index: tango/core/sync/Semaphore.d 437 Index: tango/core/sync/Semaphore.d
449 =================================================================== 438 ===================================================================
450 --- tango/core/sync/Semaphore.d (revision 3979) 439 --- tango/core/sync/Semaphore.d (revision 4071)
451 +++ tango/core/sync/Semaphore.d (working copy) 440 +++ tango/core/sync/Semaphore.d (working copy)
452 @@ -329,7 +329,8 @@ 441 @@ -329,7 +329,8 @@
453 { 442 {
454 synchronized( synComplete ) 443 synchronized( synComplete )
455 { 444 {
481 + testWaitTimeout();} 470 + testWaitTimeout();}
482 } 471 }
483 } 472 }
484 Index: tango/core/sync/Condition.d 473 Index: tango/core/sync/Condition.d
485 =================================================================== 474 ===================================================================
486 --- tango/core/sync/Condition.d (revision 3979) 475 --- tango/core/sync/Condition.d (revision 4071)
487 +++ tango/core/sync/Condition.d (working copy) 476 +++ tango/core/sync/Condition.d (working copy)
488 @@ -553,8 +553,11 @@ 477 @@ -553,8 +553,11 @@
489 478
490 unittest 479 unittest
491 { 480 {
497 + } 486 + }
498 } 487 }
499 } 488 }
500 Index: tango/core/Atomic.d 489 Index: tango/core/Atomic.d
501 =================================================================== 490 ===================================================================
502 --- tango/core/Atomic.d (revision 4002) 491 --- tango/core/Atomic.d (revision 4071)
503 +++ tango/core/Atomic.d (working copy) 492 +++ tango/core/Atomic.d (working copy)
504 @@ -270,6 +270,167 @@ 493 @@ -270,6 +270,167 @@
505 494
506 495
507 //////////////////////////////////////////////////////////////////////////////// 496 ////////////////////////////////////////////////////////////////////////////////
667 + 656 +
668 +//////////////////////////////////////////////////////////////////////////////// 657 +////////////////////////////////////////////////////////////////////////////////
669 // x86 Atomic Function Implementation 658 // x86 Atomic Function Implementation
670 //////////////////////////////////////////////////////////////////////////////// 659 ////////////////////////////////////////////////////////////////////////////////
671 660
672 @@ -282,9 +598,9 @@ 661 @@ -282,9 +443,9 @@
673 { 662 {
674 pragma( msg, "tango.core.Atomic: using IA-32 inline asm" ); 663 pragma( msg, "tango.core.Atomic: using IA-32 inline asm" );
675 } 664 }
676 - 665 -
677 + version(darwin){} 666 + version(darwin){}
681 } 670 }
682 version( X86_64 ) 671 version( X86_64 )
683 { 672 {
684 Index: tango/math/IEEE.d 673 Index: tango/math/IEEE.d
685 =================================================================== 674 ===================================================================
686 --- tango/math/IEEE.d (revision 3979) 675 --- tango/math/IEEE.d (revision 4071)
687 +++ tango/math/IEEE.d (working copy) 676 +++ tango/math/IEEE.d (working copy)
688 @@ -1543,7 +1543,12 @@ 677 @@ -1543,7 +1543,12 @@
689 else return 0; 678 else return 0;
690 } 679 }
691 } else { 680 } else {
699 } 688 }
700 } 689 }
701 690
702 Index: tango/math/Math.d 691 Index: tango/math/Math.d
703 =================================================================== 692 ===================================================================
704 --- tango/math/Math.d (revision 4002) 693 --- tango/math/Math.d (revision 4071)
705 +++ tango/math/Math.d (working copy) 694 +++ tango/math/Math.d (working copy)
706 @@ -76,6 +76,14 @@ 695 @@ -76,6 +76,14 @@
707 version = DigitalMars_D_InlineAsm_X86; 696 version = DigitalMars_D_InlineAsm_X86;
708 } 697 }
709 } 698 }
848 } 837 }
849 838
850 debug(UnitTest) { 839 debug(UnitTest) {
851 Index: tango/stdc/posix/sys/types.d 840 Index: tango/stdc/posix/sys/types.d
852 =================================================================== 841 ===================================================================
853 --- tango/stdc/posix/sys/types.d (revision 3979) 842 --- tango/stdc/posix/sys/types.d (revision 4071)
854 +++ tango/stdc/posix/sys/types.d (working copy) 843 +++ tango/stdc/posix/sys/types.d (working copy)
855 @@ -422,7 +422,11 @@ 844 @@ -422,7 +422,11 @@
856 } 845 }
857 else version( darwin ) 846 else version( darwin )
858 { 847 {
865 } 854 }
866 else version( freebsd ) 855 else version( freebsd )
867 { 856 {
868 Index: tango/stdc/stdlib.d 857 Index: tango/stdc/stdlib.d
869 =================================================================== 858 ===================================================================
870 --- tango/stdc/stdlib.d (revision 4002) 859 --- tango/stdc/stdlib.d (revision 4071)
871 +++ tango/stdc/stdlib.d (working copy) 860 +++ tango/stdc/stdlib.d (working copy)
872 @@ -94,6 +94,11 @@ 861 @@ -94,6 +94,11 @@
873 { 862 {
874 void* alloca(size_t size); 863 void* alloca(size_t size);
875 } 864 }
881 else version( GNU ) 870 else version( GNU )
882 { 871 {
883 private import gcc.builtins; 872 private import gcc.builtins;
884 Index: tango/stdc/stdarg.d 873 Index: tango/stdc/stdarg.d
885 =================================================================== 874 ===================================================================
886 --- tango/stdc/stdarg.d (revision 4002) 875 --- tango/stdc/stdarg.d (revision 4071)
887 +++ tango/stdc/stdarg.d (working copy) 876 +++ tango/stdc/stdarg.d (working copy)
888 @@ -13,6 +13,10 @@ 877 @@ -13,6 +13,10 @@
889 { 878 {
890 public import std.c.stdarg; 879 public import std.c.stdarg;
891 } 880 }