comparison runtime/internal/aApply.d @ 715:30b42a283c8e

Removed TypeOpaque from DMD. Changed runtime functions taking opaque[] to void[]. Implemented proper type painting, to avoid "resizing" array casts in runtime calls that previously took opaque[]. Implemented dynamic arrays as first class types, this implements proper ABI for these types on x86. Added dwarf region end after call to assert function, fixes some problems with llvm not allowing this to be missing. Reverted change to WithStatement from rev [704] it breaks MiniD, mini/with2.d needs to be fixed some other way... Fixed tango bug 1339 in runtime, problem with _adReverseChar on invalid UTF-8. Disabled .bc generation in the compiler runtime part, genobj.d triggers some llvm bug when using debug info. the .o seems to work fine.
author Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
date Wed, 22 Oct 2008 14:55:33 +0200
parents 44f08170f4ef
children
comparison
equal deleted inserted replaced
714:1e98c99a87cb 715:30b42a283c8e
34 * and dchar, and 2 of each of those. 34 * and dchar, and 2 of each of those.
35 */ 35 */
36 36
37 private import util.utf; 37 private import util.utf;
38 38
39 //debug = apply;
40 debug(apply)
41 {
42 extern(C) int printf(char*, ...);
43 }
44
39 /********************************************** 45 /**********************************************
40 */ 46 */
41 47
42 // dg is D, but _aApplycd() is C 48 // dg is D, but _aApplycd() is C
43 extern (D) typedef int delegate(void *) dg_t; 49 extern (D) typedef int delegate(void *) dg_t;
354 for (i = 0; i < len; i++) 360 for (i = 0; i < len; i++)
355 { dchar d; 361 { dchar d;
356 char c; 362 char c;
357 363
358 d = aa[i]; 364 d = aa[i];
365 debug(apply) printf("d = %u\n", d);
359 if (d & ~0x7F) 366 if (d & ~0x7F)
360 { 367 {
361 char[4] buf; 368 char[4] buf;
362 369
363 auto b = toUTF8(buf, d); 370 auto b = toUTF8(buf, d);
364 foreach (char c2; b) 371 foreach (char c2; b)
365 { 372 {
373 debug(apply) printf("c2 = %d\n", c2);
366 result = dg(&i, cast(void *)&c2); 374 result = dg(&i, cast(void *)&c2);
367 if (result) 375 if (result)
368 return result; 376 return result;
369 } 377 }
370 continue; 378 continue;