Changeset 715:30b42a283c8e
- Timestamp:
- 10/22/08 08:55:33 (3 years ago)
- Files:
-
- dmd/impcnvtab.c (modified) (1 diff)
- dmd/mtype.c (modified) (12 diffs)
- dmd/mtype.h (modified) (3 diffs)
- dmd/statement.c (modified) (4 diffs)
- gen/arrays.cpp (modified) (8 diffs)
- gen/dvalue.cpp (modified) (1 diff)
- gen/dvalue.h (modified) (3 diffs)
- gen/functions.cpp (modified) (5 diffs)
- gen/llvmhelpers.cpp (modified) (6 diffs)
- gen/llvmhelpers.h (modified) (1 diff)
- gen/runtime.cpp (modified) (17 diffs)
- gen/statements.cpp (modified) (7 diffs)
- gen/tocall.cpp (modified) (3 diffs)
- gen/toir.cpp (modified) (3 diffs)
- gen/tollvm.cpp (modified) (7 diffs)
- gen/tollvm.h (modified) (1 diff)
- gen/toobj.cpp (modified) (1 diff)
- runtime/internal/aApply.d (modified) (3 diffs)
- runtime/internal/aaA.d (modified) (7 diffs)
- runtime/internal/adi.d (modified) (7 diffs)
- runtime/internal/ldc.mak (modified) (3 diffs)
- runtime/internal/lifetime.d (modified) (3 diffs)
- runtime/internal/qsort2.d (modified) (2 diffs)
- tests/mini/foreach6.d (modified) (1 diff)
- tests/mini/foreach8.d (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
dmd/impcnvtab.c
r410 r715 3 3 unsigned char Type::impcnvResult[TMAX][TMAX] = 4 4 { 5 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 6 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 7 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 8 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 9 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 10 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 11 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 12 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 13 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 14 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 15 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 16 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 17 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 18 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 19 36,36,36,36,36,36,36,36,36,36,36,36,36,36,18,18,18,18,18,19,20,21,22,23,24,22,23,24,28,29,30,18,18,36,36,36,36,36,36,36,36,36, 20 36,36,36,36,36,36,36,36,36,36,36,36,36,36,18,18,18,18,18,19,20,21,22,23,24,22,23,24,28,29,30,18,18,36,36,36,36,36,36,36,36,36, 21 36,36,36,36,36,36,36,36,36,36,36,36,36,36,18,18,18,18,18,19,20,21,22,23,24,22,23,24,28,29,30,18,18,36,36,36,36,36,36,36,36,36, 22 36,36,36,36,36,36,36,36,36,36,36,36,36,36,18,18,18,18,18,19,20,21,22,23,24,22,23,24,28,29,30,18,18,36,36,36,36,36,36,36,36,36, 23 36,36,36,36,36,36,36,36,36,36,36,36,36,36,18,18,18,18,18,19,20,21,22,23,24,22,23,24,28,29,30,18,18,36,36,36,36,36,36,36,36,36, 24 36,36,36,36,36,36,36,36,36,36,36,36,36,36,19,19,19,19,19,19,20,21,22,23,24,22,23,24,28,29,30,19,19,36,36,36,36,36,36,36,36,36, 25 36,36,36,36,36,36,36,36,36,36,36,36,36,36,20,20,20,20,20,20,20,21,22,23,24,22,23,24,28,29,30,20,20,36,36,36,36,36,36,36,36,36, 26 36,36,36,36,36,36,36,36,36,36,36,36,36,36,21,21,21,21,21,21,21,21,22,23,24,22,23,24,28,29,30,21,21,36,36,36,36,36,36,36,36,36, 27 36,36,36,36,36,36,36,36,36,36,36,36,36,36,22,22,22,22,22,22,22,22,22,23,24,22,23,24,28,29,30,22,22,36,36,36,36,36,36,36,36,36, 28 36,36,36,36,36,36,36,36,36,36,36,36,36,36,23,23,23,23,23,23,23,23,23,23,24,23,23,24,29,29,30,23,23,36,36,36,36,36,36,36,36,36, 29 36,36,36,36,36,36,36,36,36,36,36,36,36,36,24,24,24,24,24,24,24,24,24,24,24,24,24,24,30,30,30,24,24,36,36,36,36,36,36,36,36,36, 30 36,36,36,36,36,36,36,36,36,36,36,36,36,36,22,22,22,22,22,22,22,22,22,23,24,25,26,27,28,29,30,22,22,36,36,36,36,36,36,36,36,36, 31 36,36,36,36,36,36,36,36,36,36,36,36,36,36,23,23,23,23,23,23,23,23,23,23,24,26,26,27,29,29,30,23,23,36,36,36,36,36,36,36,36,36, 32 36,36,36,36,36,36,36,36,36,36,36,36,36,36,24,24,24,24,24,24,24,24,24,24,24,27,27,27,30,30,30,24,24,36,36,36,36,36,36,36,36,36, 33 36,36,36,36,36,36,36,36,36,36,36,36,36,36,28,28,28,28,28,28,28,28,28,29,30,28,29,30,28,29,30,28,28,36,36,36,36,36,36,36,36,36, 34 36,36,36,36,36,36,36,36,36,36,36,36,36,36,29,29,29,29,29,29,29,29,29,29,30,29,29,30,29,29,30,29,29,36,36,36,36,36,36,36,36,36, 35 36,36,36,36,36,36,36,36,36,36,36,36,36,36,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,36,36,36,36,36,36,36,36,36, 36 36,36,36,36,36,36,36,36,36,36,36,36,36,36,18,18,18,18,18,19,20,21,22,23,24,22,23,24,28,29,30,18,36,36,36,36,36,36,36,36,36,36, 37 36,36,36,36,36,36,36,36,36,36,36,36,36,36,18,18,18,18,18,19,20,21,22,23,24,22,23,24,28,29,30,36,32,36,36,36,36,36,36,36,36,36, 38 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 39 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 40 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 41 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 42 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 43 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 44 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 45 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 46 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 5 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 6 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 7 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 8 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 9 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 10 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 11 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 12 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 13 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 14 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 15 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 16 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 17 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 18 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 19 36,36,36,36,36,36,36,36,36,36,36,36,36,36,18,18,18,18,18,19,20,21,22,23,24,22,23,24,28,29,30,18,18,36,36,36,36,36,36,36,36, 20 36,36,36,36,36,36,36,36,36,36,36,36,36,36,18,18,18,18,18,19,20,21,22,23,24,22,23,24,28,29,30,18,18,36,36,36,36,36,36,36,36, 21 36,36,36,36,36,36,36,36,36,36,36,36,36,36,18,18,18,18,18,19,20,21,22,23,24,22,23,24,28,29,30,18,18,36,36,36,36,36,36,36,36, 22 36,36,36,36,36,36,36,36,36,36,36,36,36,36,18,18,18,18,18,19,20,21,22,23,24,22,23,24,28,29,30,18,18,36,36,36,36,36,36,36,36, 23 36,36,36,36,36,36,36,36,36,36,36,36,36,36,18,18,18,18,18,19,20,21,22,23,24,22,23,24,28,29,30,18,18,36,36,36,36,36,36,36,36, 24 36,36,36,36,36,36,36,36,36,36,36,36,36,36,19,19,19,19,19,19,20,21,22,23,24,22,23,24,28,29,30,19,19,36,36,36,36,36,36,36,36, 25 36,36,36,36,36,36,36,36,36,36,36,36,36,36,20,20,20,20,20,20,20,21,22,23,24,22,23,24,28,29,30,20,20,36,36,36,36,36,36,36,36, 26 36,36,36,36,36,36,36,36,36,36,36,36,36,36,21,21,21,21,21,21,21,21,22,23,24,22,23,24,28,29,30,21,21,36,36,36,36,36,36,36,36, 27 36,36,36,36,36,36,36,36,36,36,36,36,36,36,22,22,22,22,22,22,22,22,22,23,24,22,23,24,28,29,30,22,22,36,36,36,36,36,36,36,36, 28 36,36,36,36,36,36,36,36,36,36,36,36,36,36,23,23,23,23,23,23,23,23,23,23,24,23,23,24,29,29,30,23,23,36,36,36,36,36,36,36,36, 29 36,36,36,36,36,36,36,36,36,36,36,36,36,36,24,24,24,24,24,24,24,24,24,24,24,24,24,24,30,30,30,24,24,36,36,36,36,36,36,36,36, 30 36,36,36,36,36,36,36,36,36,36,36,36,36,36,22,22,22,22,22,22,22,22,22,23,24,25,26,27,28,29,30,22,22,36,36,36,36,36,36,36,36, 31 36,36,36,36,36,36,36,36,36,36,36,36,36,36,23,23,23,23,23,23,23,23,23,23,24,26,26,27,29,29,30,23,23,36,36,36,36,36,36,36,36, 32 36,36,36,36,36,36,36,36,36,36,36,36,36,36,24,24,24,24,24,24,24,24,24,24,24,27,27,27,30,30,30,24,24,36,36,36,36,36,36,36,36, 33 36,36,36,36,36,36,36,36,36,36,36,36,36,36,28,28,28,28,28,28,28,28,28,29,30,28,29,30,28,29,30,28,28,36,36,36,36,36,36,36,36, 34 36,36,36,36,36,36,36,36,36,36,36,36,36,36,29,29,29,29,29,29,29,29,29,29,30,29,29,30,29,29,30,29,29,36,36,36,36,36,36,36,36, 35 36,36,36,36,36,36,36,36,36,36,36,36,36,36,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,36,36,36,36,36,36,36,36, 36 36,36,36,36,36,36,36,36,36,36,36,36,36,36,18,18,18,18,18,19,20,21,22,23,24,22,23,24,28,29,30,18,36,36,36,36,36,36,36,36,36, 37 36,36,36,36,36,36,36,36,36,36,36,36,36,36,18,18,18,18,18,19,20,21,22,23,24,22,23,24,28,29,30,36,32,36,36,36,36,36,36,36,36, 38 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 39 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 40 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 41 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 42 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 43 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 44 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 45 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 47 46 }; 48 47 unsigned char Type::impcnvType1[TMAX][TMAX] = 49 48 { 50 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 51 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 52 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 53 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 54 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 55 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 56 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 57 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 58 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 59 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 60 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 61 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 62 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 63 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 64 36,36,36,36,36,36,36,36,36,36,36,36,36,36,18,18,18,18,18,19,20,21,22,23,24,22,23,24,22,23,24,18,18,36,36,36,36,36,36,36,36,36, 65 36,36,36,36,36,36,36,36,36,36,36,36,36,36,18,18,18,18,18,19,20,21,22,23,24,22,23,24,22,23,24,18,18,36,36,36,36,36,36,36,36,36, 66 36,36,36,36,36,36,36,36,36,36,36,36,36,36,18,18,18,18,18,19,20,21,22,23,24,22,23,24,22,23,24,18,18,36,36,36,36,36,36,36,36,36, 67 36,36,36,36,36,36,36,36,36,36,36,36,36,36,18,18,18,18,18,19,20,21,22,23,24,22,23,24,22,23,24,18,18,36,36,36,36,36,36,36,36,36, 68 36,36,36,36,36,36,36,36,36,36,36,36,36,36,18,18,18,18,18,19,20,21,22,23,24,22,23,24,22,23,24,18,18,36,36,36,36,36,36,36,36,36, 69 36,36,36,36,36,36,36,36,36,36,36,36,36,36,19,19,19,19,19,19,20,21,22,23,24,22,23,24,22,23,24,19,19,36,36,36,36,36,36,36,36,36, 70 36,36,36,36,36,36,36,36,36,36,36,36,36,36,20,20,20,20,20,20,20,21,22,23,24,22,23,24,22,23,24,20,20,36,36,36,36,36,36,36,36,36, 71 36,36,36,36,36,36,36,36,36,36,36,36,36,36,21,21,21,21,21,21,21,21,22,23,24,22,23,24,22,23,24,21,21,36,36,36,36,36,36,36,36,36, 72 36,36,36,36,36,36,36,36,36,36,36,36,36,36,22,22,22,22,22,22,22,22,22,23,24,22,23,24,22,23,24,22,22,36,36,36,36,36,36,36,36,36, 73 36,36,36,36,36,36,36,36,36,36,36,36,36,36,23,23,23,23,23,23,23,23,23,23,24,23,23,24,23,23,24,23,23,36,36,36,36,36,36,36,36,36, 74 36,36,36,36,36,36,36,36,36,36,36,36,36,36,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,36,36,36,36,36,36,36,36,36, 75 36,36,36,36,36,36,36,36,36,36,36,36,36,36,25,25,25,25,25,25,25,25,25,26,27,25,26,27,25,26,27,25,25,36,36,36,36,36,36,36,36,36, 76 36,36,36,36,36,36,36,36,36,36,36,36,36,36,26,26,26,26,26,26,26,26,26,26,27,26,26,27,26,26,27,26,26,36,36,36,36,36,36,36,36,36, 77 36,36,36,36,36,36,36,36,36,36,36,36,36,36,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,36,36,36,36,36,36,36,36,36, 78 36,36,36,36,36,36,36,36,36,36,36,36,36,36,28,28,28,28,28,28,28,28,28,29,30,28,29,30,28,29,30,28,28,36,36,36,36,36,36,36,36,36, 79 36,36,36,36,36,36,36,36,36,36,36,36,36,36,29,29,29,29,29,29,29,29,29,29,30,29,29,30,29,29,30,29,29,36,36,36,36,36,36,36,36,36, 80 36,36,36,36,36,36,36,36,36,36,36,36,36,36,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,36,36,36,36,36,36,36,36,36, 81 36,36,36,36,36,36,36,36,36,36,36,36,36,36,18,18,18,18,18,19,20,21,22,23,24,22,23,24,22,23,24,18,36,36,36,36,36,36,36,36,36,36, 82 36,36,36,36,36,36,36,36,36,36,36,36,36,36,18,18,18,18,18,19,20,21,22,23,24,22,23,24,22,23,24,36,32,36,36,36,36,36,36,36,36,36, 83 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 84 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 85 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 86 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 87 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 88 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 89 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 90 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 91 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 49 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 50 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 51 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 52 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 53 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 54 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 55 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 56 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 57 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 58 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 59 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 60 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 61 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 62 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 63 36,36,36,36,36,36,36,36,36,36,36,36,36,36,18,18,18,18,18,19,20,21,22,23,24,22,23,24,22,23,24,18,18,36,36,36,36,36,36,36,36, 64 36,36,36,36,36,36,36,36,36,36,36,36,36,36,18,18,18,18,18,19,20,21,22,23,24,22,23,24,22,23,24,18,18,36,36,36,36,36,36,36,36, 65 36,36,36,36,36,36,36,36,36,36,36,36,36,36,18,18,18,18,18,19,20,21,22,23,24,22,23,24,22,23,24,18,18,36,36,36,36,36,36,36,36, 66 36,36,36,36,36,36,36,36,36,36,36,36,36,36,18,18,18,18,18,19,20,21,22,23,24,22,23,24,22,23,24,18,18,36,36,36,36,36,36,36,36, 67 36,36,36,36,36,36,36,36,36,36,36,36,36,36,18,18,18,18,18,19,20,21,22,23,24,22,23,24,22,23,24,18,18,36,36,36,36,36,36,36,36, 68 36,36,36,36,36,36,36,36,36,36,36,36,36,36,19,19,19,19,19,19,20,21,22,23,24,22,23,24,22,23,24,19,19,36,36,36,36,36,36,36,36, 69 36,36,36,36,36,36,36,36,36,36,36,36,36,36,20,20,20,20,20,20,20,21,22,23,24,22,23,24,22,23,24,20,20,36,36,36,36,36,36,36,36, 70 36,36,36,36,36,36,36,36,36,36,36,36,36,36,21,21,21,21,21,21,21,21,22,23,24,22,23,24,22,23,24,21,21,36,36,36,36,36,36,36,36, 71 36,36,36,36,36,36,36,36,36,36,36,36,36,36,22,22,22,22,22,22,22,22,22,23,24,22,23,24,22,23,24,22,22,36,36,36,36,36,36,36,36, 72 36,36,36,36,36,36,36,36,36,36,36,36,36,36,23,23,23,23,23,23,23,23,23,23,24,23,23,24,23,23,24,23,23,36,36,36,36,36,36,36,36, 73 36,36,36,36,36,36,36,36,36,36,36,36,36,36,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,36,36,36,36,36,36,36,36, 74 36,36,36,36,36,36,36,36,36,36,36,36,36,36,25,25,25,25,25,25,25,25,25,26,27,25,26,27,25,26,27,25,25,36,36,36,36,36,36,36,36, 75 36,36,36,36,36,36,36,36,36,36,36,36,36,36,26,26,26,26,26,26,26,26,26,26,27,26,26,27,26,26,27,26,26,36,36,36,36,36,36,36,36, 76 36,36,36,36,36,36,36,36,36,36,36,36,36,36,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,36,36,36,36,36,36,36,36, 77 36,36,36,36,36,36,36,36,36,36,36,36,36,36,28,28,28,28,28,28,28,28,28,29,30,28,29,30,28,29,30,28,28,36,36,36,36,36,36,36,36, 78 36,36,36,36,36,36,36,36,36,36,36,36,36,36,29,29,29,29,29,29,29,29,29,29,30,29,29,30,29,29,30,29,29,36,36,36,36,36,36,36,36, 79 36,36,36,36,36,36,36,36,36,36,36,36,36,36,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,36,36,36,36,36,36,36,36, 80 36,36,36,36,36,36,36,36,36,36,36,36,36,36,18,18,18,18,18,19,20,21,22,23,24,22,23,24,22,23,24,18,36,36,36,36,36,36,36,36,36, 81 36,36,36,36,36,36,36,36,36,36,36,36,36,36,18,18,18,18,18,19,20,21,22,23,24,22,23,24,22,23,24,36,32,36,36,36,36,36,36,36,36, 82 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 83 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 84 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 85 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 86 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 87 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 88 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 89 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 92 90 }; 93 91 unsigned char Type::impcnvType2[TMAX][TMAX] = 94 92 { 95 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 96 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 97 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 98 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 99 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 100 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 101 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 102 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 103 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 104 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 105 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 106 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 107 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 108 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 109 36,36,36,36,36,36,36,36,36,36,36,36,36,36,18,18,18,18,18,19,20,21,22,23,24,25,26,27,28,29,30,18,18,36,36,36,36,36,36,36,36,36, 110 36,36,36,36,36,36,36,36,36,36,36,36,36,36,18,18,18,18,18,19,20,21,22,23,24,25,26,27,28,29,30,18,18,36,36,36,36,36,36,36,36,36, 111 36,36,36,36,36,36,36,36,36,36,36,36,36,36,18,18,18,18,18,19,20,21,22,23,24,25,26,27,28,29,30,18,18,36,36,36,36,36,36,36,36,36, 112 36,36,36,36,36,36,36,36,36,36,36,36,36,36,18,18,18,18,18,19,20,21,22,23,24,25,26,27,28,29,30,18,18,36,36,36,36,36,36,36,36,36, 113 36,36,36,36,36,36,36,36,36,36,36,36,36,36,18,18,18,18,18,19,20,21,22,23,24,25,26,27,28,29,30,18,18,36,36,36,36,36,36,36,36,36, 114 36,36,36,36,36,36,36,36,36,36,36,36,36,36,19,19,19,19,19,19,20,21,22,23,24,25,26,27,28,29,30,19,19,36,36,36,36,36,36,36,36,36, 115 36,36,36,36,36,36,36,36,36,36,36,36,36,36,20,20,20,20,20,20,20,21,22,23,24,25,26,27,28,29,30,20,20,36,36,36,36,36,36,36,36,36, 116 36,36,36,36,36,36,36,36,36,36,36,36,36,36,21,21,21,21,21,21,21,21,22,23,24,25,26,27,28,29,30,21,21,36,36,36,36,36,36,36,36,36, 117 36,36,36,36,36,36,36,36,36,36,36,36,36,36,22,22,22,22,22,22,22,22,22,23,24,25,26,27,28,29,30,22,22,36,36,36,36,36,36,36,36,36, 118 36,36,36,36,36,36,36,36,36,36,36,36,36,36,23,23,23,23,23,23,23,23,23,23,24,26,26,27,29,29,30,23,23,36,36,36,36,36,36,36,36,36, 119 36,36,36,36,36,36,36,36,36,36,36,36,36,36,24,24,24,24,24,24,24,24,24,24,24,27,27,27,30,30,30,24,24,36,36,36,36,36,36,36,36,36, 120 36,36,36,36,36,36,36,36,36,36,36,36,36,36,22,22,22,22,22,22,22,22,22,23,24,25,26,27,28,29,30,22,22,36,36,36,36,36,36,36,36,36, 121 36,36,36,36,36,36,36,36,36,36,36,36,36,36,23,23,23,23,23,23,23,23,23,23,24,26,26,27,29,29,30,23,23,36,36,36,36,36,36,36,36,36, 122 36,36,36,36,36,36,36,36,36,36,36,36,36,36,24,24,24,24,24,24,24,24,24,24,24,27,27,27,30,30,30,24,24,36,36,36,36,36,36,36,36,36, 123 36,36,36,36,36,36,36,36,36,36,36,36,36,36,22,22,22,22,22,22,22,22,22,23,24,25,26,27,28,29,30,22,22,36,36,36,36,36,36,36,36,36, 124 36,36,36,36,36,36,36,36,36,36,36,36,36,36,23,23,23,23,23,23,23,23,23,23,24,26,26,27,29,29,30,23,23,36,36,36,36,36,36,36,36,36, 125 36,36,36,36,36,36,36,36,36,36,36,36,36,36,24,24,24,24,24,24,24,24,24,24,24,27,27,27,30,30,30,24,24,36,36,36,36,36,36,36,36,36, 126 36,36,36,36,36,36,36,36,36,36,36,36,36,36,18,18,18,18,18,19,20,21,22,23,24,25,26,27,28,29,30,18,36,36,36,36,36,36,36,36,36,36, 127 36,36,36,36,36,36,36,36,36,36,36,36,36,36,18,18,18,18,18,19,20,21,22,23,24,25,26,27,28,29,30,36,32,36,36,36,36,36,36,36,36,36, 128 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 129 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 130 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 131 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 132 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 133 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 134 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 135 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 136 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 93 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 94 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 95 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 96 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 97 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 98 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 99 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 100 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 101 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 102 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 103 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 104 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 105 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 106 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 107 36,36,36,36,36,36,36,36,36,36,36,36,36,36,18,18,18,18,18,19,20,21,22,23,24,25,26,27,28,29,30,18,18,36,36,36,36,36,36,36,36, 108 36,36,36,36,36,36,36,36,36,36,36,36,36,36,18,18,18,18,18,19,20,21,22,23,24,25,26,27,28,29,30,18,18,36,36,36,36,36,36,36,36, 109 36,36,36,36,36,36,36,36,36,36,36,36,36,36,18,18,18,18,18,19,20,21,22,23,24,25,26,27,28,29,30,18,18,36,36,36,36,36,36,36,36, 110 36,36,36,36,36,36,36,36,36,36,36,36,36,36,18,18,18,18,18,19,20,21,22,23,24,25,26,27,28,29,30,18,18,36,36,36,36,36,36,36,36, 111 36,36,36,36,36,36,36,36,36,36,36,36,36,36,18,18,18,18,18,19,20,21,22,23,24,25,26,27,28,29,30,18,18,36,36,36,36,36,36,36,36, 112 36,36,36,36,36,36,36,36,36,36,36,36,36,36,19,19,19,19,19,19,20,21,22,23,24,25,26,27,28,29,30,19,19,36,36,36,36,36,36,36,36, 113 36,36,36,36,36,36,36,36,36,36,36,36,36,36,20,20,20,20,20,20,20,21,22,23,24,25,26,27,28,29,30,20,20,36,36,36,36,36,36,36,36, 114 36,36,36,36,36,36,36,36,36,36,36,36,36,36,21,21,21,21,21,21,21,21,22,23,24,25,26,27,28,29,30,21,21,36,36,36,36,36,36,36,36, 115 36,36,36,36,36,36,36,36,36,36,36,36,36,36,22,22,22,22,22,22,22,22,22,23,24,25,26,27,28,29,30,22,22,36,36,36,36,36,36,36,36, 116 36,36,36,36,36,36,36,36,36,36,36,36,36,36,23,23,23,23,23,23,23,23,23,23,24,26,26,27,29,29,30,23,23,36,36,36,36,36,36,36,36, 117 36,36,36,36,36,36,36,36,36,36,36,36,36,36,24,24,24,24,24,24,24,24,24,24,24,27,27,27,30,30,30,24,24,36,36,36,36,36,36,36,36, 118 36,36,36,36,36,36,36,36,36,36,36,36,36,36,22,22,22,22,22,22,22,22,22,23,24,25,26,27,28,29,30,22,22,36,36,36,36,36,36,36,36, 119 36,36,36,36,36,36,36,36,36,36,36,36,36,36,23,23,23,23,23,23,23,23,23,23,24,26,26,27,29,29,30,23,23,36,36,36,36,36,36,36,36, 120 36,36,36,36,36,36,36,36,36,36,36,36,36,36,24,24,24,24,24,24,24,24,24,24,24,27,27,27,30,30,30,24,24,36,36,36,36,36,36,36,36, 121 36,36,36,36,36,36,36,36,36,36,36,36,36,36,22,22,22,22,22,22,22,22,22,23,24,25,26,27,28,29,30,22,22,36,36,36,36,36,36,36,36, 122 36,36,36,36,36,36,36,36,36,36,36,36,36,36,23,23,23,23,23,23,23,23,23,23,24,26,26,27,29,29,30,23,23,36,36,36,36,36,36,36,36, 123 36,36,36,36,36,36,36,36,36,36,36,36,36,36,24,24,24,24,24,24,24,24,24,24,24,27,27,27,30,30,30,24,24,36,36,36,36,36,36,36,36, 124 36,36,36,36,36,36,36,36,36,36,36,36,36,36,18,18,18,18,18,19,20,21,22,23,24,25,26,27,28,29,30,18,36,36,36,36,36,36,36,36,36, 125 36,36,36,36,36,36,36,36,36,36,36,36,36,36,18,18,18,18,18,19,20,21,22,23,24,25,26,27,28,29,30,36,32,36,36,36,36,36,36,36,36, 126 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 127 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 128 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 129 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 130 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 131 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 132 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 133 36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 137 134 }; 138 135 unsigned char Type::impcnvWarn[TMAX][TMAX] = 139 136 { 140 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 141 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 142 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 170 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 171 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 172 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 173 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 174 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 175 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 176 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 177 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 182 178 }; dmd/mtype.c
r664 r715 104 104 ClassDeclaration *Type::typeinfotypelist; 105 105 106 // LDC107 Type* Type::topaque;108 109 106 Type *Type::tvoidptr; 110 107 Type *Type::basic[TMAX]; … … 211 208 mangleChar[Tslice] = '@'; 212 209 213 // LDC214 mangleChar[Topaque] = 'O';215 216 210 for (i = 0; i < TMAX; i++) 217 211 { if (!mangleChar[i]) … … 234 228 235 229 tvoidptr = tvoid->pointerTo(); 236 237 // LDC238 topaque = new TypeOpaque();239 230 240 231 // set size_t / ptrdiff_t types and pointer size … … 1626 1617 Arguments* args = new Arguments; 1627 1618 args->push(new Argument(STCin, Type::typeinfo->type, NULL, NULL)); 1628 args->push(new Argument(STCin, Type::t opaque->arrayOf(), NULL, NULL));1629 adDup_fd = FuncDeclaration::genCfunc(args, Type::t opaque->arrayOf(), Id::adDup);1619 args->push(new Argument(STCin, Type::tvoid->arrayOf(), NULL, NULL)); 1620 adDup_fd = FuncDeclaration::genCfunc(args, Type::tvoid->arrayOf(), Id::adDup); 1630 1621 } 1631 1622 static FuncDeclaration *adReverse_fd = NULL; 1632 1623 if(!adReverse_fd) { 1633 1624 Arguments* args = new Arguments; 1634 args->push(new Argument(STCin, Type::t opaque->arrayOf(), NULL, NULL));1625 args->push(new Argument(STCin, Type::tvoid->arrayOf(), NULL, NULL)); 1635 1626 args->push(new Argument(STCin, Type::tsize_t, NULL, NULL)); 1636 adReverse_fd = FuncDeclaration::genCfunc(args, Type::t opaque->arrayOf(), Id::adReverse);1627 adReverse_fd = FuncDeclaration::genCfunc(args, Type::tvoid->arrayOf(), Id::adReverse); 1637 1628 } 1638 1629 … … 1645 1636 if (dup) 1646 1637 arguments->push(getTypeInfo(sc)); 1647 arguments->push(e); 1638 1639 // LDC repaint array type to void[] 1640 if (n->ty != Tvoid) { 1641 e = new CastExp(e->loc, e, e->type); 1642 e->type = Type::tvoid->arrayOf(); 1643 } 1644 arguments->push(e); 1645 1648 1646 if (!dup) 1649 1647 arguments->push(new IntegerExp(0, size, Type::tint32)); … … 1661 1659 if(!adSort_fd) { 1662 1660 Arguments* args = new Arguments; 1663 args->push(new Argument(STCin, Type::t opaque->arrayOf(), NULL, NULL));1661 args->push(new Argument(STCin, Type::tvoid->arrayOf(), NULL, NULL)); 1664 1662 args->push(new Argument(STCin, Type::typeinfo->type, NULL, NULL)); 1665 adSort_fd = FuncDeclaration::genCfunc(args, Type::t opaque->arrayOf(), "_adSort");1663 adSort_fd = FuncDeclaration::genCfunc(args, Type::tvoid->arrayOf(), "_adSort"); 1666 1664 } 1667 1665 static FuncDeclaration *adSortBit_fd = NULL; 1668 1666 if(!adSortBit_fd) { 1669 1667 Arguments* args = new Arguments; 1670 args->push(new Argument(STCin, Type::t opaque->arrayOf(), NULL, NULL));1668 args->push(new Argument(STCin, Type::tvoid->arrayOf(), NULL, NULL)); 1671 1669 args->push(new Argument(STCin, Type::typeinfo->type, NULL, NULL)); 1672 adSortBit_fd = FuncDeclaration::genCfunc(args, Type::t opaque->arrayOf(), "_adSortBit");1670 adSortBit_fd = FuncDeclaration::genCfunc(args, Type::tvoid->arrayOf(), "_adSortBit"); 1673 1671 } 1674 1672 … … 1679 1677 e = e->castTo(sc, n->arrayOf()); // convert to dynamic array 1680 1678 arguments = new Expressions(); 1681 arguments->push(e); 1679 1680 // LDC repaint array type to void[] 1681 if (n->ty != Tvoid) { 1682 e = new CastExp(e->loc, e, e->type); 1683 e->type = Type::tvoid->arrayOf(); 1684 } 1685 arguments->push(e); 1686 1682 1687 if (next->ty != Tbit) 1683 1688 arguments->push(n->getTypeInfo(sc)); // LDC, we don't support the getInternalTypeInfo … … 2351 2356 if(!aaLen_fd) { 2352 2357 Arguments* args = new Arguments; 2353 args->push(new Argument(STCin, Type::t opaque->pointerTo(), NULL, NULL));2358 args->push(new Argument(STCin, Type::tvoid->pointerTo(), NULL, NULL)); 2354 2359 aaLen_fd = FuncDeclaration::genCfunc(args, Type::tsize_t, Id::aaLen); 2355 2360 } … … 2372 2377 if(!aaKeys_fd) { 2373 2378 Arguments* args = new Arguments; 2374 args->push(new Argument(STCin, Type::t opaque->pointerTo(), NULL, NULL));2379 args->push(new Argument(STCin, Type::tvoid->pointerTo(), NULL, NULL)); 2375 2380 args->push(new Argument(STCin, Type::tsize_t, NULL, NULL)); 2376 aaKeys_fd = FuncDeclaration::genCfunc(args, Type::t opaque->arrayOf(), Id::aaKeys);2381 aaKeys_fd = FuncDeclaration::genCfunc(args, Type::tvoid->arrayOf(), Id::aaKeys); 2377 2382 } 2378 2383 … … 2393 2398 if(!aaValues_fd) { 2394 2399 Arguments* args = new Arguments; 2395 args->push(new Argument(STCin, Type::t opaque->pointerTo(), NULL, NULL));2400 args->push(new Argument(STCin, Type::tvoid->pointerTo(), NULL, NULL)); 2396 2401 args->push(new Argument(STCin, Type::tsize_t, NULL, NULL)); 2397 2402 args->push(new Argument(STCin, Type::tsize_t, NULL, NULL)); 2398 aaValues_fd = FuncDeclaration::genCfunc(args, Type::t opaque->arrayOf(), Id::aaValues);2403 aaValues_fd = FuncDeclaration::genCfunc(args, Type::tvoid->arrayOf(), Id::aaValues); 2399 2404 } 2400 2405 … … 2418 2423 if(!aaRehash_fd) { 2419 2424 Arguments* args = new Arguments; 2420 args->push(new Argument(STCin, Type::t opaque->pointerTo(), NULL, NULL));2425 args->push(new Argument(STCin, Type::tvoid->pointerTo(), NULL, NULL)); 2421 2426 args->push(new Argument(STCin, Type::typeinfo->type, NULL, NULL)); 2422 2427 aaRehash_fd = FuncDeclaration::genCfunc(args, Type::tvoidptr, Id::aaRehash); … … 5243 5248 } 5244 5249 5245 void TypeOpaque::toCBuffer2(OutBuffer *buf, HdrGenState *hgs, int mod)5246 {5247 //printf("TypeOpaquePtr::toCBuffer2()");5248 if (mod != this->mod)5249 { toCBuffer3(buf, hgs, mod);5250 return;5251 }5252 buf->writestring("opaque");5253 }5254 5255 5250 /***************************** Argument *****************************/ 5256 5251 dmd/mtype.h
r663 r715 99 99 Tslice, 100 100 101 // LDC102 Topaque,103 104 101 TMAX 105 102 }; … … 177 174 static ClassDeclaration *typeinfodelegate; 178 175 static ClassDeclaration *typeinfotypelist; 179 180 // LDC, for runtime function signatures that contain181 // AAs or arrays of unknown type182 static Type* topaque;183 176 184 177 static Type *basic[TMAX]; … … 675 668 }; 676 669 677 //LDC678 struct TypeOpaque : Type679 {680 TypeOpaque() : Type(Topaque, NULL) {}681 void toCBuffer2(OutBuffer *buf, HdrGenState *hgs, int mod);682 };683 684 670 /**************************************************************/ 685 671 dmd/statement.c
r664 r715 1603 1603 if(!aaApply2_fd) { 1604 1604 Arguments* args = new Arguments; 1605 args->push(new Argument(STCin, Type::t opaque->pointerTo(), NULL, NULL));1605 args->push(new Argument(STCin, Type::tvoid->pointerTo(), NULL, NULL)); 1606 1606 args->push(new Argument(STCin, Type::tsize_t, NULL, NULL)); 1607 1607 Arguments* dgargs = new Arguments; … … 1615 1615 if(!aaApply_fd) { 1616 1616 Arguments* args = new Arguments; 1617 args->push(new Argument(STCin, Type::t opaque->pointerTo(), NULL, NULL));1617 args->push(new Argument(STCin, Type::tvoid->pointerTo(), NULL, NULL)); 1618 1618 args->push(new Argument(STCin, Type::tsize_t, NULL, NULL)); 1619 1619 Arguments* dgargs = new Arguments; … … 1670 1670 //LDC: Build arguments. 1671 1671 Arguments* args = new Arguments; 1672 args->push(new Argument(STCin, Type::topaque->arrayOf(), NULL, NULL));1672 args->push(new Argument(STCin, tn->arrayOf(), NULL, NULL)); 1673 1673 if (dim == 2) { 1674 1674 Arguments* dgargs = new Arguments; … … 1690 1690 if (tab->ty == Tsarray) 1691 1691 aggr = aggr->castTo(sc, tn->arrayOf()); 1692 exps->push(aggr);1692 exps->push(aggr); 1693 1693 exps->push(flde); 1694 1694 e = new CallExp(loc, ec, exps); gen/arrays.cpp
r683 r715 56 56 LOG_SCOPE; 57 57 58 LLValue* len = DtoGEPi(v,0,0); 59 LLValue* zerolen = llvm::ConstantInt::get(len->getType()->getContainedType(0), 0, false); 60 DtoStore(zerolen, len); 61 62 LLValue* ptr = DtoGEPi(v,0,1); 63 const LLPointerType* pty = isaPointer(ptr->getType()->getContainedType(0)); 64 LLValue* nullptr = llvm::ConstantPointerNull::get(pty); 65 DtoStore(nullptr, ptr); 66 } 67 68 ////////////////////////////////////////////////////////////////////////////////////////// 69 70 void DtoArrayAssign(LLValue* dst, LLValue* src) 71 { 72 Logger::println("DtoArrayAssign"); 73 LOG_SCOPE; 74 75 assert(gIR); 76 if (dst->getType() == src->getType()) 77 { 78 LLValue* ptr = DtoGEPi(src,0,0); 79 LLValue* val = DtoLoad(ptr); 80 ptr = DtoGEPi(dst,0,0); 81 DtoStore(val, ptr); 82 83 ptr = DtoGEPi(src,0,1); 84 val = DtoLoad(ptr); 85 ptr = DtoGEPi(dst,0,1); 86 DtoStore(val, ptr); 87 } 88 else 89 { 90 if (Logger::enabled()) 91 Logger::cout() << "array assignment type dont match: " << *dst->getType() << "\n\n" << *src->getType() << '\n'; 92 const LLArrayType* arrty = isaArray(src->getType()->getContainedType(0)); 93 if (!arrty) 94 { 95 std::cout << "invalid: " << *src << '\n'; 96 assert(0); 97 } 98 const LLType* dstty = getPtrToType(arrty->getElementType()); 99 100 LLValue* dstlen = DtoGEPi(dst,0,0); 101 LLValue* srclen = DtoConstSize_t(arrty->getNumElements()); 102 DtoStore(srclen, dstlen); 103 104 LLValue* dstptr = DtoGEPi(dst,0,1); 105 LLValue* srcptr = DtoBitCast(src, dstty); 106 DtoStore(srcptr, dstptr); 107 } 58 assert(isaPointer(v)); 59 const LLType* t = v->getType()->getContainedType(0); 60 61 DtoStore(LLConstant::getNullValue(t), v); 108 62 } 109 63 … … 685 639 assert(fn); 686 640 641 // find common dynamic array type 642 Type* commonType = l->getType()->toBasetype()->nextOf()->arrayOf(); 643 644 // cast static arrays to dynamic ones, this turns them into DSliceValues 645 Logger::println("casting to dynamic arrays"); 646 l = DtoCastArray(loc, l, commonType); 647 r = DtoCastArray(loc, r, commonType); 648 687 649 LLValue* lmem; 688 650 LLValue* rmem; 689 690 // cast static arrays to dynamic ones, this turns them into DSliceValues691 Logger::println("casting to dynamic arrays");692 Type* l_ty = l->getType()->toBasetype();693 Type* r_ty = r->getType()->toBasetype();694 assert(l_ty->next == r_ty->next);695 if ((l_ty->ty == Tsarray) || (r_ty->ty == Tsarray)) {696 Type* a_ty = l_ty->next->arrayOf();697 if (l_ty->ty == Tsarray)698 l = DtoCastArray(loc, l, a_ty);699 if (r_ty->ty == Tsarray)700 r = DtoCastArray(loc, r, a_ty);701 }702 703 Logger::println("giving storage");704 705 // we need to give slices storage706 if (l->isSlice()) {707 lmem = DtoAlloca(DtoType(l->getType()), "tmpparam");708 DtoSetArray(lmem, DtoArrayLen(l), DtoArrayPtr(l));709 }710 // also null711 else if (l->isNull())712 {713 lmem = DtoAlloca(DtoType(l->getType()), "tmpparam");714 DtoSetArray(lmem, llvm::Constant::getNullValue(DtoSize_t()), llvm::Constant::getNullValue(DtoType(l->getType()->next->pointerTo())));715 }716 else717 lmem = l->getRVal();718 719 // and for the rvalue ...720 // we need to give slices storage721 if (r->isSlice()) {722 rmem = DtoAlloca(DtoType(r->getType()), "tmpparam");723 DtoSetArray(rmem, DtoArrayLen(r), DtoArrayPtr(r));724 }725 // also null726 else if (r->isNull())727 {728 rmem = DtoAlloca(DtoType(r->getType()), "tmpparam");729 DtoSetArray(rmem, llvm::Constant::getNullValue(DtoSize_t()), llvm::Constant::getNullValue(DtoType(r->getType()->next->pointerTo())));730 }731 else732 rmem = r->getRVal();733 734 const LLType* pt = fn->getFunctionType()->getParamType(0);735 736 651 LLSmallVector<LLValue*, 3> args; 737 if (Logger::enabled()) 738 { 739 Logger::cout() << "bitcasting to " << *pt << '\n'; 740 Logger::cout() << *lmem << '\n'; 741 Logger::cout() << *rmem << '\n'; 742 } 743 args.push_back(DtoBitCast(lmem,pt)); 744 args.push_back(DtoBitCast(rmem,pt)); 652 653 // get values, reinterpret cast to void[] 654 lmem = DtoAggrPaint(l->getRVal(), DtoArrayType(LLType::Int8Ty)); 655 args.push_back(lmem); 656 657 rmem = DtoAggrPaint(r->getRVal(), DtoArrayType(LLType::Int8Ty)); 658 args.push_back(rmem); 745 659 746 660 // pass array typeinfo ? … … 754 668 Logger::cout() << "typeinfo decl: " << *tival << '\n'; 755 669 756 pt = fn->getFunctionType()->getParamType(2); 757 args.push_back(DtoBitCast(tival, pt)); 670 args.push_back(DtoBitCast(tival, fn->getFunctionType()->getParamType(2))); 758 671 } 759 672 760 673 CallOrInvoke* call = gIR->CreateCallOrInvoke(fn, args.begin(), args.end(), "tmp"); 761 762 // set param attrs763 llvm::AttrListPtr palist;764 palist = palist.addAttr(1, llvm::Attribute::ByVal);765 palist = palist.addAttr(2, llvm::Attribute::ByVal);766 call->setAttributes(palist);767 674 768 675 return call->get(); … … 918 825 else if (v->isNull()) 919 826 return DtoConstSize_t(0); 920 return DtoLoad(DtoGEPi(v->getRVal(), 0,0)); 827 else if (v->isLVal()) 828 return DtoLoad(DtoGEPi(v->getLVal(), 0,0), ".len"); 829 return gIR->ir->CreateExtractValue(v->getRVal(), 0, ".len"); 921 830 } 922 831 else if (t->ty == Tsarray) { … … 944 853 else if (v->isNull()) 945 854 return getNullPtr(getPtrToType(DtoType(t->next))); 946 return DtoLoad(DtoGEPi(v->getRVal(), 0,1)); 855 else if (v->isLVal()) 856 return DtoLoad(DtoGEPi(v->getLVal(), 0,1), ".ptr"); 857 return gIR->ir->CreateExtractValue(v->getRVal(), 1, ".ptr"); 947 858 } 948 859 else if (t->ty == Tsarray) { … … 1047 958 } 1048 959 1049 1050 960 ////////////////////////////////////////////////////////////////////////////////////////// 1051 961 void DtoArrayBoundsCheck(Loc& loc, DValue* arr, DValue* index, bool isslice) … … 1072 982 1073 983 std::vector<LLValue*> args; 1074 llvm::AttrListPtr palist;1075 984 1076 985 // file param 1077 args.push_back(gIR->dmodule->ir.irModule->fileName); 1078 palist = palist.addAttr(1, llvm::Attribute::ByVal); 986 args.push_back(DtoLoad(gIR->dmodule->ir.irModule->fileName)); 1079 987 1080 988 // line param … … 1085 993 llvm::Function* errorfn = LLVM_D_GetRuntimeFunction(gIR->module, "_d_array_bounds"); 1086 994 CallOrInvoke* call = gIR->CreateCallOrInvoke(errorfn, args.begin(), args.end()); 1087 call->setAttributes(palist);1088 995 1089 996 // the function does not return 1090 997 gIR->ir->CreateUnreachable(); 1091 998 1092 1093 999 // if ok, proceed in okbb 1094 1000 gIR->scope() = IRScope(okbb, oldend); gen/dvalue.cpp
r601 r715 44 44 ///////////////////////////////////////////////////////////////////////////////////////////////// 45 45 46 LLValue* DSliceValue::getRVal() 47 { 48 assert(len); 49 assert(ptr); 50 return DtoAggrPair(len, ptr); 51 } 52 53 ///////////////////////////////////////////////////////////////////////////////////////////////// 54 ///////////////////////////////////////////////////////////////////////////////////////////////// 55 46 56 DFuncValue::DFuncValue(FuncDeclaration* fd, LLValue* v, LLValue* vt) 47 57 { gen/dvalue.h
r664 r715 30 30 struct DFuncValue; 31 31 struct DSliceValue; 32 struct DArrayLenValue;33 32 struct DLRValue; 34 33 … … 50 49 virtual DSliceValue* isSlice() { return NULL; } 51 50 virtual DFuncValue* isFunc() { return NULL; } 52 virtual DArrayLenValue* isArrayLen() { return NULL; }53 51 virtual DLRValue* isLRValue() { return NULL; } 54 52 … … 128 126 DSliceValue(Type* t, LLValue* l, LLValue* p) { type=t; ptr=p; len=l; } 129 127 128 virtual LLValue* getRVal(); 129 130 130 virtual Type*& getType() { assert(type); return type; } 131 131 virtual DSliceValue* isSlice() { return this; } gen/functions.cpp
r632 r715 60 60 const LLType* arrTy = DtoArrayType(LLType::Int8Ty); 61 61 const LLType* arrArrTy = DtoArrayType(arrTy); 62 paramvec.push_back( getPtrToType(arrArrTy));62 paramvec.push_back(arrArrTy); 63 63 } 64 64 } … … 104 104 types.push_back(getPtrToType(getPtrToType(ti->ir.irStruct->constInit->getType()))); 105 105 const LLType* t1 = llvm::StructType::get(types); 106 paramvec.push_back( getPtrToType(t1));106 paramvec.push_back(t1); 107 107 paramvec.push_back(getPtrToType(LLType::Int8Ty)); 108 108 } … … 124 124 const LLType* at = DtoType(argT); 125 125 126 // FIXME: using the llvm type for these is a bad idea... aggregates are first class now and we're starting to use it ... 127 128 if (argT->iscomplex()) { 129 goto Lbadstuff; 130 } 131 else if (isaStruct(at)) { 132 Logger::println("struct param"); 133 paramvec.push_back(getPtrToType(at)); 134 if (!refOrOut) 135 arg->llvmAttrs |= llvm::Attribute::ByVal; 136 } 137 else if (isaArray(at)) { 138 // static array are passed by reference 139 Logger::println("sarray param"); 140 assert(argT->ty == Tsarray); 141 paramvec.push_back(getPtrToType(at)); 142 } 143 else if (llvm::isa<llvm::OpaqueType>(at)) { 126 // opaque types need special handling 127 if (llvm::isa<llvm::OpaqueType>(at)) { 144 128 Logger::println("opaque param"); 145 129 assert(argT->ty == Tstruct || argT->ty == Tclass); 146 130 paramvec.push_back(getPtrToType(at)); 147 131 } 132 // structs and delegates are passed as a reference, but by value 133 else if (argT->ty == Tstruct || argT->ty == Tdelegate) { 134 Logger::println("struct/sarray param"); 135 if (!refOrOut) 136 arg->llvmAttrs |= llvm::Attribute::ByVal; 137 paramvec.push_back(getPtrToType(at)); 138 } 139 // static arrays are passed directly by reference 140 else if (argT->ty == Tsarray) 141 { 142 Logger::println("static array param"); 143 at = getPtrToType(at); 144 paramvec.push_back(at); 145 } 146 // firstclass ' ref/out ' parameter 147 else if (refOrOut) { 148 Logger::println("ref/out param"); 149 at = getPtrToType(at); 150 paramvec.push_back(at); 151 } 152 // firstclass ' in ' parameter 148 153 else { 149 Lbadstuff: 150 if (refOrOut) { 151 Logger::println("by ref param"); 152 at = getPtrToType(at); 153 } 154 else { 155 Logger::println("in param"); 156 if (unsigned ea = DtoShouldExtend(argT)) 157 { 158 arg->llvmAttrs |= ea; 159 } 160 } 154 Logger::println("in param"); 155 if (unsigned ea = DtoShouldExtend(argT)) 156 arg->llvmAttrs |= ea; 161 157 paramvec.push_back(at); 162 158 } … … 361 357 PAWI.Attrs = llvm::Attribute::StructRet; 362 358 attrs.push_back(PAWI); 363 }364 365 // set byval attrs on implicit main arg366 if (fdecl->isMain() && Argument::dim(f->parameters) == 0)367 {368 PAWI.Index = llidx;369 PAWI.Attrs = llvm::Attribute::ByVal;370 attrs.push_back(PAWI);371 llidx++;372 359 } 373 360 … … 776 763 } 777 764 778 // copy _argptr to a memory location765 // copy _argptr and _arguments to a memory location 779 766 if (f->linkage == LINKd && f->varargs == 1) 780 767 { 768 // _argptr 781 769 LLValue* argptrmem = DtoAlloca(fd->ir.irFunc->_argptr->getType(), "_argptr_mem"); 782 770 new llvm::StoreInst(fd->ir.irFunc->_argptr, argptrmem, gIR->scopebb()); 783 771 fd->ir.irFunc->_argptr = argptrmem; 772 773 // _arguments 774 LLValue* argumentsmem = DtoAlloca(fd->ir.irFunc->_arguments->getType(), "_arguments_mem"); 775 new llvm::StoreInst(fd->ir.irFunc->_arguments, argumentsmem, gIR->scopebb()); 776 fd->ir.irFunc->_arguments = argumentsmem; 784 777 } 785 778 gen/llvmhelpers.cpp
r709 r715 118 118 llvm::Function* fn = LLVM_D_GetRuntimeFunction(gIR->module, fname); 119 119 120 // param attrs121 llvm::AttrListPtr palist;122 int idx = 1;123 124 120 // msg param 125 121 if (msg) 126 122 { 127 if (DSliceValue* s = msg->isSlice()) 128 { 129 llvm::AllocaInst* alloc = gIR->func()->msgArg; 130 if (!alloc) 131 { 132 alloc = DtoAlloca(DtoArrayType(LLType::Int8Ty), ".assertmsg"); 133 DtoSetArray(alloc, DtoArrayLen(s), DtoArrayPtr(s)); 134 gIR->func()->msgArg = alloc; 135 } 136 args.push_back(alloc); 137 } 138 else 139 { 140 args.push_back(msg->getRVal()); 141 } 142 palist = palist.addAttr(idx++, llvm::Attribute::ByVal); 123 args.push_back(msg->getRVal()); 143 124 } 144 125 145 126 // file param 146 args.push_back(gIR->dmodule->ir.irModule->fileName); 147 palist = palist.addAttr(idx++, llvm::Attribute::ByVal); 148 127 args.push_back(DtoLoad(gIR->dmodule->ir.irModule->fileName)); 149 128 150 129 // line param … … 154 133 // call 155 134 CallOrInvoke* call = gIR->CreateCallOrInvoke(fn, args.begin(), args.end()); 156 call->setAttributes(palist); 135 136 // end debug info 137 if (global.params.symdebug) 138 DtoDwarfFuncEnd(gIR->func()->decl); 157 139 158 140 // after assert is always unreachable … … 446 428 } 447 429 // reference assignment 430 else if (t2->ty == Tarray) { 431 DtoStore(rhs->getRVal(), lhs->getLVal()); 432 } 433 // some implicitly converting ref assignment 448 434 else { 449 Dto ArrayAssign(lhs->getLVal(), rhs->getRVal());435 DtoSetArray(lhs->getLVal(), DtoArrayLen(rhs), DtoArrayPtr(rhs)); 450 436 } 451 437 } … … 754 740 error(loc, "invalid cast from '%s' to '%s'", val->getType()->toChars(), to->toChars()); 755 741 fatal(); 742 } 743 } 744 745 ////////////////////////////////////////////////////////////////////////////////////////// 746 747 DValue* DtoPaintType(Loc& loc, DValue* val, Type* to) 748 { 749 Type* from = val->getType()->toBasetype(); 750 Logger::println("repainting from '%s' to '%s'", from->toChars(), to->toChars()); 751 752 if (from->ty == Tarray) 753 { 754 Type* at = to->toBasetype(); 755 assert(at->ty == Tarray); 756 Type* elem = at->next->pointerTo(); 757 if (DSliceValue* slice = val->isSlice()) 758 { 759 return new DSliceValue(to, slice->len, DtoBitCast(slice->ptr, DtoType(elem))); 760 } 761 else if (val->isLVal()) 762 { 763 LLValue* ptr = val->getLVal(); 764 ptr = DtoBitCast(ptr, DtoType(at->pointerTo())); 765 return new DVarValue(to, ptr); 766 } 767 else 768 { 769 LLValue *len, *ptr; 770 len = DtoArrayLen(val); 771 ptr = DtoArrayPtr(val); 772 ptr = DtoBitCast(ptr, DtoType(elem)); 773 return new DImValue(to, DtoAggrPair(len, ptr, "tmp")); 774 } 775 } 776 else if (from->ty == Tpointer || from->ty == Tclass || from->ty == Taarray) 777 { 778 Type* b = to->toBasetype(); 779 assert(b->ty == Tpointer || b->ty == Tclass || b->ty == Taarray); 780 LLValue* ptr = DtoBitCast(val->getRVal(), DtoType(b)); 781 return new DImValue(to, ptr); 782 } 783 else 784 { 785 assert(!val->isLVal()); 786 assert(DtoType(to) == DtoType(to)); 787 return new DImValue(to, val->getRVal()); 756 788 } 757 789 } … … 1414 1446 static LLConstant* expand_to_sarray(Type *base, Expression* exp) 1415 1447 { 1416 Logger::println("building type %s fromexpression (%s) of type %s", base->toChars(), exp->toChars(), exp->type->toChars());1448 Logger::println("building type %s to expression (%s) of type %s", base->toChars(), exp->toChars(), exp->type->toChars()); 1417 1449 const LLType* dstTy = DtoType(base); 1418 1450 if (Logger::enabled()) … … 1464 1496 if (base->ty == Tsarray) 1465 1497 { 1466 Logger::println("type is a static array, building constant array initializer fromsingle value");1498 Logger::println("type is a static array, building constant array initializer to single value"); 1467 1499 return expand_to_sarray(base, exp); 1468 1500 } 1469 1501 else 1470 1502 { 1471 error("cannot yet convert default initializer %s fromtype %s to %s", exp->toChars(), exp->type->toChars(), type->toChars());1503 error("cannot yet convert default initializer %s to type %s to %s", exp->toChars(), exp->type->toChars(), type->toChars()); 1472 1504 fatal(); 1473 1505 } gen/llvmhelpers.h
r664 r715 58 58 DValue* DtoCastDelegate(Loc& loc, DValue* val, Type* to); 59 59 DValue* DtoCast(Loc& loc, DValue* val, Type* to); 60 61 // return the same val as passed in, modified to the target type, if possible, otherwise returns a new DValue 62 DValue* DtoPaintType(Loc& loc, DValue* val, Type* to); 60 63 61 64 // is template instance check gen/runtime.cpp
r663 r715 111 111 static const LLType* rt_array(const LLType* elemty) 112 112 { 113 std::vector<const LLType*> t; 114 t.push_back(DtoSize_t()); 115 t.push_back(rt_ptr(elemty)); 116 return rt_ptr(llvm::StructType::get(t)); 117 } 118 119 static const LLType* rt_array2(const LLType* elemty) 120 { 121 std::vector<const LLType*> t; 122 t.push_back(DtoSize_t()); 123 t.push_back(rt_ptr(elemty)); 124 return llvm::StructType::get(t); 113 return llvm::StructType::get(DtoSize_t(), rt_ptr(elemty), 0); 125 114 } 126 115 … … 200 189 types.push_back(intTy); 201 190 const llvm::FunctionType* fty = llvm::FunctionType::get(voidTy, types, false); 202 llvm::AttrListPtr palist; 203 palist = palist.addAttr(1, llvm::Attribute::ByVal); 204 llvm::Function::Create(fty, llvm::GlobalValue::ExternalLinkage, fname, M)->setAttributes(palist); 205 llvm::Function::Create(fty, llvm::GlobalValue::ExternalLinkage, fname2, M)->setAttributes(palist); 206 llvm::Function::Create(fty, llvm::GlobalValue::ExternalLinkage, fname3, M)->setAttributes(palist); 191 llvm::Function::Create(fty, llvm::GlobalValue::ExternalLinkage, fname, M); 192 llvm::Function::Create(fty, llvm::GlobalValue::ExternalLinkage, fname2, M); 193 llvm::Function::Create(fty, llvm::GlobalValue::ExternalLinkage, fname3, M); 207 194 } 208 195 … … 215 202 types.push_back(intTy); 216 203 const llvm::FunctionType* fty = llvm::FunctionType::get(voidPtrTy, types, false); 217 llvm::AttrListPtr palist; 218 palist = palist.addAttr(1, llvm::Attribute::ByVal); 219 palist = palist.addAttr(2, llvm::Attribute::ByVal); 220 llvm::Function::Create(fty, llvm::GlobalValue::ExternalLinkage, fname, M)->setAttributes(palist); 204 llvm::Function::Create(fty, llvm::GlobalValue::ExternalLinkage, fname, M); 221 205 } 222 206 … … 383 367 const llvm::FunctionType* fty = llvm::FunctionType::get(intTy, types, false); \ 384 368 llvm::AttrListPtr palist; \ 385 palist = palist.addAttr(1, llvm::Attribute::ByVal); \386 369 palist = palist.addAttr(2, llvm::Attribute::ByVal); \ 387 370 llvm::Function::Create(fty, llvm::GlobalValue::ExternalLinkage, fname, M)->setAttributes(palist); \ … … 403 386 const llvm::FunctionType* fty = llvm::FunctionType::get(intTy, types, false); \ 404 387 llvm::AttrListPtr palist; \ 405 palist = palist.addAttr(1, llvm::Attribute::ByVal); \406 388 palist = palist.addAttr(2, llvm::Attribute::ByVal); \ 407 389 llvm::Function::Create(fty, llvm::GlobalValue::ExternalLinkage, fname, M)->setAttributes(palist); \ … … 422 404 const llvm::FunctionType* fty = llvm::FunctionType::get(intTy, types, false); \ 423 405 llvm::AttrListPtr palist; \ 424 palist = palist.addAttr(1, llvm::Attribute::ByVal); \425 406 palist = palist.addAttr(2, llvm::Attribute::ByVal); \ 426 407 llvm::Function::Create(fty, llvm::GlobalValue::ExternalLinkage, fname, M)->setAttributes(palist); \ … … 441 422 const llvm::FunctionType* fty = llvm::FunctionType::get(intTy, types, false); \ 442 423 llvm::AttrListPtr palist; \ 443 palist = palist.addAttr(1, llvm::Attribute::ByVal); \444 424 palist = palist.addAttr(2, llvm::Attribute::ByVal); \ 445 425 llvm::Function::Create(fty, llvm::GlobalValue::ExternalLinkage, fname, M)->setAttributes(palist); \ … … 471 451 ///////////////////////////////////////////////////////////////////////////////////// 472 452 473 // builds the d string[] for the D main args from the C main args474 // void _d_main_args(uint n, char** args, ref char[][] res)475 {476 std::string fname("_d_main_args");477 std::vector<const LLType*> types;478 types.push_back(intTy);479 types.push_back(rt_ptr(rt_ptr(byteTy)));480 types.push_back(rt_array(stringTy->getContainedType(0)));481 const llvm::FunctionType* fty = llvm::FunctionType::get(voidTy, types, false);482 llvm::Function::Create(fty, llvm::GlobalValue::ExternalLinkage, fname, M);483 }484 485 /////////////////////////////////////////////////////////////////////////////////////486 /////////////////////////////////////////////////////////////////////////////////////487 /////////////////////////////////////////////////////////////////////////////////////488 489 453 // cast to object 490 454 // Object _d_toObject(void* p) … … 530 494 std::vector<const LLType*> types; 531 495 types.push_back(stringTy); 532 types.push_back(stringTy); 533 const llvm::FunctionType* fty = llvm::FunctionType::get(voidTy, types, false); 534 llvm::AttrListPtr palist; 535 palist = palist.addAttr(2, llvm::Attribute::ByVal); 536 llvm::Function::Create(fty, llvm::GlobalValue::ExternalLinkage, fname, M)->setAttributes(palist); 537 llvm::Function::Create(fty, llvm::GlobalValue::ExternalLinkage, fname2, M)->setAttributes(palist); 496 const llvm::FunctionType* fty = llvm::FunctionType::get(stringTy, types, false); 497 llvm::Function::Create(fty, llvm::GlobalValue::ExternalLinkage, fname, M); 498 llvm::Function::Create(fty, llvm::GlobalValue::ExternalLinkage, fname2, M); 538 499 } 539 500 … … 545 506 std::vector<const LLType*> types; 546 507 types.push_back(wstringTy); 547 types.push_back(wstringTy); 548 const llvm::FunctionType* fty = llvm::FunctionType::get(voidTy, types, false); 549 llvm::AttrListPtr palist; 550 palist = palist.addAttr(2, llvm::Attribute::ByVal); 551 llvm::Function::Create(fty, llvm::GlobalValue::ExternalLinkage, fname, M)->setAttributes(palist); 552 llvm::Function::Create(fty, llvm::GlobalValue::ExternalLinkage, fname2, M)->setAttributes(palist); 553 } 554 555 // Array _adReverse(Array a, size_t szelem) 508 const llvm::FunctionType* fty = llvm::FunctionType::get(wstringTy, types, false); 509 llvm::Function::Create(fty, llvm::GlobalValue::ExternalLinkage, fname, M); 510 llvm::Function::Create(fty, llvm::GlobalValue::ExternalLinkage, fname2, M); 511 } 512 513 // void[] _adReverse(void[] a, size_t szelem) 556 514 { 557 515 std::string fname("_adReverse"); 516 std::vector<const LLType*> types; 517 types.push_back(rt_array(byteTy)); 518 types.push_back(sizeTy); 519 const llvm::FunctionType* fty = llvm::FunctionType::get(rt_array(byteTy), types, false); 520 llvm::Function::Create(fty, llvm::GlobalValue::ExternalLinkage, fname, M); 521 } 522 523 // void[] _adDupT(TypeInfo ti, void[] a) 524 { 525 std::string fname("_adDupT"); 526 std::vector<const LLType*> types; 527 types.push_back(typeInfoTy); 528 types.push_back(rt_array(byteTy)); 529 const llvm::FunctionType* fty = llvm::FunctionType::get(rt_array(byteTy), types, false); 530 llvm::Function::Create(fty, llvm::GlobalValue::ExternalLinkage, fname, M); 531 } 532 533 // int _adEq(void[] a1, void[] a2, TypeInfo ti) 534 // int _adCmp(void[] a1, void[] a2, TypeInfo ti) 535 { 536 std::string fname("_adEq"); 537 std::string fname2("_adCmp"); 558 538 std::vector<const LLType*> types; 559 539 types.push_back(rt_array(byteTy)); 560 540 types.push_back(rt_array(byteTy)); 561 types.push_back(sizeTy);562 const llvm::FunctionType* fty = llvm::FunctionType::get(voidTy, types, false);563 llvm::AttrListPtr palist;564 palist = palist.addAttr(2, llvm::Attribute::ByVal);565 llvm::Function::Create(fty, llvm::GlobalValue::ExternalLinkage, fname, M)->setAttributes(palist);566 }567 568 // Array _adDupT(TypeInfo ti, Array a)569 {570 std::string fname("_adDupT");571 std::vector<const LLType*> types;572 types.push_back(rt_array(byteTy));573 types.push_back(typeInfoTy);574 types.push_back(rt_array(byteTy));575 const llvm::FunctionType* fty = llvm::FunctionType::get(voidTy, types, false);576 llvm::AttrListPtr palist;577 palist = palist.addAttr(3, llvm::Attribute::ByVal);578 llvm::Function::Create(fty, llvm::GlobalValue::ExternalLinkage, fname, M)->setAttributes(palist);579 }580 581 // int _adEq(Array a1, Array a2, TypeInfo ti)582 // int _adCmp(Array a1, Array a2, TypeInfo ti)583 {584 std::string fname("_adEq");585 std::string fname2("_adCmp");586 std::vector<const LLType*> types;587 types.push_back(rt_array(byteTy));588 types.push_back(rt_array(byteTy));589 541 types.push_back(typeInfoTy); 590 542 const llvm::FunctionType* fty = llvm::FunctionType::get(intTy, types, false); 591 llvm::AttrListPtr palist; 592 palist = palist.addAttr(1, llvm::Attribute::ByVal); 593 palist = palist.addAttr(2, llvm::Attribute::ByVal); 594 llvm::Function::Create(fty, llvm::GlobalValue::ExternalLinkage, fname, M)->setAttributes(palist); 595 llvm::Function::Create(fty, llvm::GlobalValue::ExternalLinkage, fname2, M)->setAttributes(palist); 596 } 597 598 // int _adCmpChar(Array a1, Array a2) 543 llvm::Function::Create(fty, llvm::GlobalValue::ExternalLinkage, fname, M); 544 llvm::Function::Create(fty, llvm::GlobalValue::ExternalLinkage, fname2, M); 545 } 546 547 // int _adCmpChar(void[] a1, void[] a2) 599 548 { 600 549 std::string fname("_adCmpChar"); … … 603 552 types.push_back(rt_array(byteTy)); 604 553 const llvm::FunctionType* fty = llvm::FunctionType::get(intTy, types, false); 605 llvm::AttrListPtr palist; 606 palist = palist.addAttr(1, llvm::Attribute::ByVal); 607 palist = palist.addAttr(2, llvm::Attribute::ByVal); 608 llvm::Function::Create(fty, llvm::GlobalValue::ExternalLinkage, fname, M)->setAttributes(palist); 609 } 610 611 // Array _adSort(Array a, TypeInfo ti) 554 llvm::Function::Create(fty, llvm::GlobalValue::ExternalLinkage, fname, M); 555 } 556 557 // void[] _adSort(void[] a, TypeInfo ti) 612 558 { 613 559 std::string fname("_adSort"); 614 560 std::vector<const LLType*> types; 615 561 types.push_back(rt_array(byteTy)); 616 types.push_back(rt_array(byteTy)); 617 types.push_back(typeInfoTy); 618 const llvm::FunctionType* fty = llvm::FunctionType::get(voidTy, types, false); 619 llvm::AttrListPtr palist; 620 palist = palist.addAttr(2, llvm::Attribute::ByVal); 621 llvm::Function::Create(fty, llvm::GlobalValue::ExternalLinkage, fname, M)->setAttributes(palist); 562 types.push_back(typeInfoTy); 563 const llvm::FunctionType* fty = llvm::FunctionType::get(rt_array(byteTy), types, false); 564 llvm::Function::Create(fty, llvm::GlobalValue::ExternalLinkage, fname, M); 622 565 } 623 566 … … 681 624 } 682 625 683 // ArrayRet_t_aaValues(AA aa, size_t keysize, size_t valuesize)626 // void[] _aaValues(AA aa, size_t keysize, size_t valuesize) 684 627 { 685 628 std::string fname("_aaValues"); 686 629 std::vector<const LLType*> types; 687 types.push_back(rt_array(byteTy)); 688 types.push_back(aaTy); 689 types.push_back(sizeTy); 690 types.push_back(sizeTy); 691 const llvm::FunctionType* fty = llvm::FunctionType::get(voidTy, types, false); 630 types.push_back(aaTy); 631 types.push_back(sizeTy); 632 types.push_back(sizeTy); 633 const llvm::FunctionType* fty = llvm::FunctionType::get(rt_array(byteTy), types, false); 692 634 llvm::Function::Create(fty, llvm::GlobalValue::ExternalLinkage, fname, M); 693 635 } … … 703 645 } 704 646 705 // ArrayRet_t_aaKeys(AA aa, size_t keysize)647 // void[] _aaKeys(AA aa, size_t keysize) 706 648 { 707 649 std::string fname("_aaKeys"); 708 650 std::vector<const LLType*> types; 709 types.push_back(rt_array(byteTy)); 710 types.push_back(aaTy); 711 types.push_back(sizeTy); 712 const llvm::FunctionType* fty = llvm::FunctionType::get(voidTy, types, false); 651 types.push_back(aaTy); 652 types.push_back(sizeTy); 653 const llvm::FunctionType* fty = llvm::FunctionType::get(rt_array(byteTy), types, false); 713 654 llvm::Function::Create(fty, llvm::GlobalValue::ExternalLinkage, fname, M); 714 655 } … … 733 674 types.push_back(aaTy); 734 675 types.push_back(sizeTy); 735 types.push_back(rt_dg 1());676 types.push_back(rt_dg2()); 736 677 const llvm::FunctionType* fty = llvm::FunctionType::get(intTy, types, false); 737 678 llvm::AttrListPtr palist; … … 809 750 std::string fname("_d_switch_string"); 810 751 std::vector<const LLType*> types; 811 types.push_back(rt_array( rt_array2(byteTy)));752 types.push_back(rt_array(stringTy)); 812 753 types.push_back(stringTy); 813 754 const llvm::FunctionType* fty = llvm::FunctionType::get(intTy, types, false); 814 llvm::AttrListPtr palist; 815 palist = palist.addAttr(1, llvm::Attribute::ByVal); 816 palist = palist.addAttr(2, llvm::Attribute::ByVal); 817 llvm::Function::Create(fty, llvm::GlobalValue::ExternalLinkage, fname, M)->setAttributes(palist); 755 llvm::Function::Create(fty, llvm::GlobalValue::ExternalLinkage, fname, M); 818 756 } 819 757 … … 822 760 std::string fname("_d_switch_ustring"); 823 761 std::vector<const LLType*> types; 824 types.push_back(rt_array( rt_array2(shortTy)));762 types.push_back(rt_array(wstringTy)); 825 763 types.push_back(wstringTy); 826 764 const llvm::FunctionType* fty = llvm::FunctionType::get(intTy, types, false); 827 llvm::AttrListPtr palist; 828 palist = palist.addAttr(1, llvm::Attribute::ByVal); 829 palist = palist.addAttr(2, llvm::Attribute::ByVal); 830 llvm::Function::Create(fty, llvm::GlobalValue::ExternalLinkage, fname, M)->setAttributes(palist); 765 llvm::Function::Create(fty, llvm::GlobalValue::ExternalLinkage, fname, M); 831 766 } 832 767 … … 835 770 std::string fname("_d_switch_dstring"); 836 771 std::vector<const LLType*> types; 837 types.push_back(rt_array( rt_array2(intTy)));772 types.push_back(rt_array(dstringTy)); 838 773 types.push_back(dstringTy); 839 774 const llvm::FunctionType* fty = llvm::FunctionType::get(intTy, types, false); 840 llvm::AttrListPtr palist; 841 palist = palist.addAttr(1, llvm::Attribute::ByVal); 842 palist = palist.addAttr(2, llvm::Attribute::ByVal); 843 llvm::Function::Create(fty, llvm::GlobalValue::ExternalLinkage, fname, M)->setAttributes(palist); 775 llvm::Function::Create(fty, llvm::GlobalValue::ExternalLinkage, fname, M); 844 776 } 845 777 gen/statements.cpp
r704 r715 677 677 }; 678 678 679 static LLValue* call_string_switch_runtime(llvm:: GlobalVariable* table, Expression* e)679 static LLValue* call_string_switch_runtime(llvm::Value* table, Expression* e) 680 680 { 681 681 Type* dt = e->type->toBasetype(); … … 706 706 707 707 DValue* val = e->toElem(gIR); 708 LLValue* llval; 709 if (DSliceValue* sval = val->isSlice()) 710 { 711 // give storage 712 llval = DtoAlloca(DtoType(e->type), "tmp"); 713 DVarValue* vv = new DVarValue(e->type, llval); 714 DtoAssign(e->loc, vv, val); 715 } 716 else 717 { 718 llval = val->getRVal(); 719 } 708 LLValue* llval = val->getRVal(); 720 709 assert(llval->getType() == fn->getFunctionType()->getParamType(1)); 721 710 722 711 CallOrInvoke* call = gIR->CreateCallOrInvoke2(fn, table, llval, "tmp"); 723 724 llvm::AttrListPtr palist;725 palist = palist.addAttr(1, llvm::Attribute::ByVal);726 palist = palist.addAttr(2, llvm::Attribute::ByVal);727 call->setAttributes(palist);728 712 729 713 return call->get(); … … 749 733 750 734 // string switch? 751 llvm:: GlobalVariable* switchTable = 0;735 llvm::Value* switchTable = 0; 752 736 Array caseArray; 753 737 if (!condition->type->isintegral()) … … 791 775 sinits.push_back(DtoConstSize_t(inits.size())); 792 776 sinits.push_back(arrPtr); 793 LLConstant* sInit = llvm::ConstantStruct::get(sTy, sinits); 794 795 switchTable = new llvm::GlobalVariable(sTy, true, llvm::GlobalValue::InternalLinkage, sInit, ".string_switch_table", gIR->module); 777 switchTable = llvm::ConstantStruct::get(sTy, sinits); 796 778 } 797 779 … … 1174 1156 DValue* e = exp->toElem(p); 1175 1157 1158 #if 1 1159 // this doesn't handle the mini/with2.d test case ... 1160 assert(!wthis->ir.isSet()); 1161 wthis->ir.irLocal = new IrLocal(wthis); 1162 wthis->ir.irLocal->value = DtoAlloca(DtoType(wthis->type), wthis->toChars()); 1163 #else 1164 // ... this does, but it also silently breaks MiniD!!! 1176 1165 DtoDeclarationExp(wthis); 1166 #endif 1167 1177 1168 DtoStore(e->getRVal(), wthis->ir.irLocal->value); 1178 1169 … … 1270 1261 llvm::Function* fn = LLVM_D_GetRuntimeFunction(gIR->module, "_d_switch_error"); 1271 1262 1272 // param attrs1273 llvm::AttrListPtr palist;1274 int idx = 1;1275 1276 1263 std::vector<LLValue*> args; 1277 1264 1278 1265 // file param 1279 args.push_back(gIR->dmodule->ir.irModule->fileName); 1280 palist = palist.addAttr(idx++, llvm::Attribute::ByVal); 1266 args.push_back(DtoLoad(gIR->dmodule->ir.irModule->fileName)); 1281 1267 1282 1268 // line param … … 1286 1272 // call 1287 1273 CallOrInvoke* call = gIR->CreateCallOrInvoke(fn, args.begin(), args.end()); 1288 call->setAttributes(palist);1289 1274 1290 1275 gIR->ir->CreateUnreachable(); gen/tocall.cpp
r632 r715 176 176 177 177 // specify arguments 178 args.push_back( typeinfoarrayparam);178 args.push_back(DtoLoad(typeinfoarrayparam)); 179 179 ++argidx; 180 180 args.push_back(gIR->ir->CreateBitCast(mem, getPtrToType(LLType::Int8Ty), "tmp")); … … 320 320 if (fnarg) // can fnarg ever be null in this block? 321 321 { 322 //if (Logger::enabled())323 //{324 //Logger::cout() << "arg: " << *arg << '\n';325 //Logger::cout() << "expects: " << *callableTy->getParamType(j) << '\n';326 //}322 if (Logger::enabled()) 323 { 324 Logger::cout() << "arg: " << *arg << '\n'; 325 Logger::cout() << "expects: " << *callableTy->getParamType(j) << '\n'; 326 } 327 327 if (arg->getType() != callableTy->getParamType(j)) 328 328 arg = DtoBitCast(arg, callableTy->getParamType(j)); … … 356 356 LLValue* retllval = (retinptr) ? args[0] : call->get(); 357 357 358 // if the type of retllval is abstract, refine to concrete 359 if (retllval->getType()->isAbstract()) 360 retllval = DtoBitCast(retllval, getPtrToType(DtoType(resulttype)), "retval"); 358 // repaint the type if necessary 359 if (resulttype) 360 { 361 Type* rbase = resulttype->toBasetype(); 362 Type* nextbase = tf->next->toBasetype(); 363 if (!rbase->equals(nextbase)) 364 { 365 Logger::println("repainting return value from '%s' to '%s'", tf->next->toChars(), rbase->toChars()); 366 switch(rbase->ty) 367 { 368 case Tarray: 369 retllval = DtoAggrPaint(retllval, DtoType(rbase)); 370 break; 371 372 case Tclass: 373 case Taarray: 374 case Tpointer: 375 retllval = DtoBitCast(retllval, DtoType(rbase)); 376 break; 377 378 default: 379 assert(0 && "unhandled repainting of return value"); 380 } 381 if (Logger::enabled()) 382 Logger::cout() << "final return value: " << *retllval << '\n'; 383 } 384 } 361 385 362 386 // set calling convention and parameter attributes gen/toir.cpp
r705 r715 784 784 LOG_SCOPE; 785 785 786 // get the value to cast 786 787 DValue* u = e1->toElem(p); 787 DValue* v = DtoCast(loc, u, to); 788 // force d type to this->type 789 v->getType() = type; 790 791 if (v->isSlice()) { 792 // only valid as rvalue! 788 789 // cast it to the 'to' type, if necessary 790 DValue* v = u; 791 if (!to->equals(e1->type)) 792 v = DtoCast(loc, u, to); 793 794 // paint the type, if necessary 795 if (!type->equals(to)) 796 v = DtoPaintType(loc, v, type); 797 798 // slices are not valid lvalues 799 if (v->isSlice()) 793 800 return v; 794 } 795 801 // if we're casting a lvalue, keep it around, we might be in a lvalue cast. 796 802 else if(u->isLVal()) 797 803 return new DLRValue(u, v); 798 799 else 800 return v; 804 // otherwise just return the new value 805 return v; 801 806 } 802 807 … … 812 817 813 818 if(!isaPointer(c->getType()) || !isaPointer(lltype)) { 814 error("can only cast pointers to pointers at co mpiletime, not %s to %s", type->toChars(), e1->type->toChars());819 error("can only cast pointers to pointers at code generation time, not %s to %s", type->toChars(), e1->type->toChars()); 815 820 fatal(); 816 821 } … … 1553 1558 { 1554 1559 DtoDeleteArray(dval); 1555 if ( !dval->isSlice())1556 DtoSetArrayToNull(dval->get RVal());1560 if (dval->isLVal()) 1561 DtoSetArrayToNull(dval->getLVal()); 1557 1562 } 1558 1563 // unknown/invalid gen/tollvm.cpp
r705 r715 26 26 Type* typ = type->toBasetype(); 27 27 TY t = typ->ty; 28 return (t == Tstruct || t == T array || t == Tdelegate || t == Tsarray);28 return (t == Tstruct || t == Tdelegate || t == Tsarray); 29 29 } 30 30 … … 33 33 Type* typ = type->toBasetype(); 34 34 TY t = typ->ty; 35 return (t == Tstruct || t == T array || t == Tdelegate || t == Tsarray);35 return (t == Tstruct || t == Tdelegate || t == Tsarray); 36 36 } 37 37 … … 180 180 } 181 181 */ 182 // opaque type183 case Topaque:184 return llvm::OpaqueType::get();185 182 186 183 default: … … 561 558 LLValue* DtoLoad(LLValue* src, const char* name) 562 559 { 560 if (Logger::enabled()) 561 Logger::cout() << "loading " << *src << '\n'; 563 562 LLValue* ld = gIR->ir->CreateLoad(src, name ? name : "tmp"); 564 563 //ld->setVolatile(gIR->func()->inVolatile); … … 568 567 void DtoStore(LLValue* src, LLValue* dst) 569 568 { 569 if (Logger::enabled()) 570 Logger::cout() << "storing " << *src << " into " << *dst << '\n'; 570 571 LLValue* st = gIR->ir->CreateStore(src,dst); 571 572 //st->setVolatile(gIR->func()->inVolatile); … … 578 579 if (v->getType() == t) 579 580 return v; 581 assert(!(isaStruct(t) || isaStruct(v->getType()))); 580 582 return gIR->ir->CreateBitCast(v, t, name ? name : "tmp"); 581 583 } … … 807 809 return gIR->ir->CreateInsertValue(res, V2, 1, name?name:"tmp"); 808 810 } 811 812 LLValue* DtoAggrPair(LLValue* V1, LLValue* V2, const char* name) 813 { 814 const LLType* t = LLStructType::get(V1->getType(), V2->getType(), 0); 815 return DtoAggrPair(t, V1, V2, name); 816 } 817 818 LLValue* DtoAggrPaint(LLValue* aggr, const LLType* as) 819 { 820 if (aggr->getType() == as) 821 return aggr; 822 823 LLValue* res = llvm::UndefValue::get(as); 824 825 LLValue* V = gIR->ir->CreateExtractValue(aggr, 0, "tmp");; 826 V = DtoBitCast(V, as->getContainedType(0)); 827 res = gIR->ir->CreateInsertValue(res, V, 0, "tmp"); 828 829 V = gIR->ir->CreateExtractValue(aggr, 1, "tmp");; 830 V = DtoBitCast(V, as->getContainedType(1)); 831 return gIR->ir->CreateInsertValue(res, V, 1, "tmp"); 832 } gen/tollvm.h
r705 r715 99 99 // pair type helpers 100 100 LLValue* DtoAggrPair(const LLType* type, LLValue* V1, LLValue* V2, const char* name = 0); 101 LLValue* DtoAggrPair(LLValue* V1, LLValue* V2, const char* name = 0); 102 LLValue* DtoAggrPaint(LLValue* aggr, const LLType* as); 101 103 102 104 /** gen/toobj.cpp
r708 r715 76 76 LOG_SCOPE; 77 77 78 //printf("codegen: %s\n", srcfile->toChars());78 //printf("codegen: %s\n", srcfile->toChars()); 79 79 80 80 // start by deleting the old object file runtime/internal/aApply.d
r443 r715 37 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 */ … … 357 363 358 364 d = aa[i]; 365 debug(apply) printf("d = %u\n", d); 359 366 if (d & ~0x7F) 360 367 { … … 364 371 foreach (char c2; b) 365 372 { 373 debug(apply) printf("c2 = %d\n", c2); 366 374 result = dg(&i, cast(void *)&c2); 367 375 if (result) runtime/internal/aaA.d
r664 r715 63 63 // 8_589_934_513UL, 17_179_869_143UL 64 64 ]; 65 66 // This is the type of the return value for dynamic arrays.67 struct Array68 {69 size_t length;70 void* ptr;71 }72 65 73 66 struct aaA … … 450 443 */ 451 444 452 Array_aaValues(AA aa, size_t keysize, size_t valuesize)445 void[] _aaValues(AA aa, size_t keysize, size_t valuesize) 453 446 in 454 447 { … … 458 451 { 459 452 size_t resi; 460 Arraya;453 void[] a; 461 454 462 455 void _aaValues_x(aaA* e) … … 481 474 if (aa) 482 475 { 483 a .length= _aaLen(aa);484 a .ptr = cast(byte*) gc_malloc(a.length* valuesize,476 auto len = _aaLen(aa); 477 auto ptr = cast(byte*) gc_malloc(len * valuesize, 485 478 valuesize < (void*).sizeof ? BlkAttr.NO_SCAN : 0); 479 a = ptr[0 .. len]; 486 480 resi = 0; 487 481 foreach (e; aa.b) … … 594 588 */ 595 589 596 Array_aaKeys(AA aa, size_t keysize)590 void[] _aaKeys(AA aa, size_t keysize) 597 591 { 598 592 byte[] res; … … 618 612 auto len = _aaLen(aa); 619 613 if (!len) 620 return Array();614 return null; 621 615 res = (cast(byte*) gc_malloc(len * keysize, 622 616 !(aa.keyti.flags() & 1) ? BlkAttr.NO_SCAN : 0)) [0 .. len * keysize]; … … 629 623 assert(resi == len); 630 624 631 return Array(len, res.ptr);625 return res.ptr[0 .. len]; 632 626 } 633 627 runtime/internal/adi.d
r486 r715 56 56 57 57 58 struct Array59 {60 size_t length;61 void* ptr;62 }63 64 58 /********************************************** 65 59 * Reverse array of chars. … … 93 87 94 88 uint stridelo = UTF8stride[clo]; 89 // don't barf on invalid strides, just ignore it 90 if (stridelo == 0xFF) 91 stridelo = 1; 95 92 96 93 uint stridehi = 1; … … 246 243 */ 247 244 248 extern (C) Array _adReverse(Arraya, size_t szelem)245 extern (C) void[] _adReverse(void[] a, size_t szelem) 249 246 out (result) 250 247 { … … 288 285 } 289 286 } 290 return Array(a.length, a.ptr);287 return a.ptr[0 .. a.length]; 291 288 } 292 289 … … 376 373 */ 377 374 378 extern (C) int _adEq( Array a1, Arraya2, TypeInfo ti)375 extern (C) int _adEq(void[] a1, void[] a2, TypeInfo ti) 379 376 { 380 377 debug(adi) printf("_adEq(a1.length = %d, a2.length = %d)\n", a1.length, a2.length); … … 406 403 */ 407 404 408 extern (C) int _adCmp( Array a1, Arraya2, TypeInfo ti)405 extern (C) int _adCmp(void[] a1, void[] a2, TypeInfo ti) 409 406 { 410 407 debug(adi) printf("adCmp()\n"); … … 443 440 */ 444 441 445 extern (C) int _adCmpChar( Array a1, Arraya2)442 extern (C) int _adCmpChar(void[] a1, void[] a2) 446 443 { 447 444 version(D_InlineAsm_X86) runtime/internal/ldc.mak
r684 r715 65 65 targets : lib sharedlib doc 66 66 all : lib sharedlib doc 67 lib : ldc.bclib ldc.clib ldc.lib 67 #lib : ldc.bclib ldc.clib ldc.lib 68 lib : ldc.clib ldc.lib 68 69 sharedlib : ldc.sharedlib 69 70 doc : ldc.doc … … 219 220 ###################################################### 220 221 221 ldc.bclib : $(LIB_TARGET_BC_ONLY)222 #ldc.bclib : $(LIB_TARGET_BC_ONLY) 222 223 ldc.clib : $(LIB_TARGET_C_ONLY) 223 224 ldc.lib : $(LIB_TARGET_FULL) 224 225 ldc.sharedlib : $(LIB_TARGET_SHARED) 225 226 226 $(LIB_TARGET_BC_ONLY) : $(ALL_OBJS_O)227 $(RM) $@228 $(LC) $@ $(ALL_OBJS_BC)227 #$(LIB_TARGET_BC_ONLY) : $(ALL_OBJS_O) 228 # $(RM) $@ 229 # $(LC) $@ $(ALL_OBJS_BC) 229 230 230 231 … … 251 252 clean : 252 253 find . -name "*.di" | xargs $(RM) 253 $(RM) $(ALL_OBJS_BC)254 # $(RM) $(ALL_OBJS_BC) 254 255 $(RM) $(ALL_OBJS_O) 255 256 $(RM) $(ALL_DOCS) runtime/internal/lifetime.d
r663 r715 1093 1093 * Support for array.dup property. 1094 1094 */ 1095 struct Array2 1096 { 1097 size_t length; 1098 void* ptr; 1099 } 1100 1101 1102 /** 1103 * 1104 */ 1105 extern (C) Array2 _adDupT(TypeInfo ti, Array2 a) 1095 1096 1097 /** 1098 * 1099 */ 1100 extern (C) void[] _adDupT(TypeInfo ti, void[] a) 1106 1101 out (result) 1107 1102 { … … 1111 1106 body 1112 1107 { 1113 Array2r;1108 void* ptr; 1114 1109 1115 1110 if (a.length) … … 1117 1112 auto sizeelem = ti.next.tsize(); // array element size 1118 1113 auto size = a.length * sizeelem; 1119 r.ptr = gc_malloc(size, !(ti.next.flags() & 1) ? BlkAttr.NO_SCAN : 0); 1120 r.length = a.length; 1121 memcpy(r.ptr, a.ptr, size); 1122 } 1123 return r; 1114 ptr = gc_malloc(size, !(ti.next.flags() & 1) ? BlkAttr.NO_SCAN : 0); 1115 memcpy(ptr, a.ptr, size); 1116 } 1117 return ptr[0 .. a.length]; 1124 1118 } 1125 1119 runtime/internal/qsort2.d
r443 r715 18 18 private import tango.stdc.stdlib; 19 19 20 struct Array21 {22 size_t length;23 void* ptr;24 }25 26 20 private TypeInfo tiglobal; 27 21 … … 31 25 } 32 26 33 extern (C) Array _adSort(Arraya, TypeInfo ti)27 extern (C) void[] _adSort(void[] a, TypeInfo ti) 34 28 { 35 29 synchronized tests/mini/foreach6.d
r341 r715 1 module foreach6;1 module mini.foreach6; 2 2 3 3 struct S tests/mini/foreach8.d
r341 r715 1 module tangotests.foreach1;1 module mini.foreach8; 2 2 3 3 extern(C) int printf(char*, ...); … … 5 5 int main(){ 6 6 dchar[] array="\u2260"; 7 printf("array[0] == %u\n", array[0]); 7 8 int test=0; 8 9 int count=0;

