Wiki Roadmap Timeline Tickets New Ticket Source Search Help / Guide About Trac Login

Changeset 715:30b42a283c8e

Show
Ignore:
Timestamp:
10/22/08 08:55:33 (3 years ago)
Author:
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
branch:
default
Message:

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.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • dmd/impcnvtab.c

    r410 r715  
    33unsigned char Type::impcnvResult[TMAX][TMAX] = 
    44{ 
    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, 
     536,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 
     636,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 
     736,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 
     836,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 
     936,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 
     1036,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 
     1136,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 
     1236,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 
     1336,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 
     1436,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 
     1536,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 
     1636,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 
     1736,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 
     1836,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 
     1936,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, 
     2036,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, 
     2136,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, 
     2236,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, 
     2336,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, 
     2436,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, 
     2536,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, 
     2636,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, 
     2736,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, 
     2836,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, 
     2936,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, 
     3036,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, 
     3136,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, 
     3236,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, 
     3336,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, 
     3436,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, 
     3536,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, 
     3636,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, 
     3736,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, 
     3836,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 
     3936,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 
     4036,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 
     4136,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 
     4236,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 
     4336,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 
     4436,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 
     4536,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 
    4746}; 
    4847unsigned char Type::impcnvType1[TMAX][TMAX] = 
    4948{ 
    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, 
     4936,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 
     5036,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 
     5136,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 
     5236,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 
     5336,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 
     5436,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 
     5536,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 
     5636,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 
     5736,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 
     5836,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 
     5936,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 
     6036,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 
     6136,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 
     6236,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 
     6336,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, 
     6436,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, 
     6536,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, 
     6636,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, 
     6736,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, 
     6836,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, 
     6936,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, 
     7036,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, 
     7136,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, 
     7236,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, 
     7336,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, 
     7436,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, 
     7536,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, 
     7636,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, 
     7736,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, 
     7836,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, 
     7936,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, 
     8036,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, 
     8136,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, 
     8236,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 
     8336,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 
     8436,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 
     8536,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 
     8636,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 
     8736,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 
     8836,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 
     8936,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 
    9290}; 
    9391unsigned char Type::impcnvType2[TMAX][TMAX] = 
    9492{ 
    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, 
     9336,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 
     9436,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 
     9536,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 
     9636,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 
     9736,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 
     9836,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 
     9936,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 
     10036,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 
     10136,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 
     10236,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 
     10336,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 
     10436,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 
     10536,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 
     10636,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 
     10736,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, 
     10836,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, 
     10936,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, 
     11036,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, 
     11136,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, 
     11236,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, 
     11336,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, 
     11436,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, 
     11536,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, 
     11636,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, 
     11736,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, 
     11836,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, 
     11936,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, 
     12036,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, 
     12136,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, 
     12236,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, 
     12336,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, 
     12436,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, 
     12536,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, 
     12636,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 
     12736,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 
     12836,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 
     12936,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 
     13036,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 
     13136,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 
     13236,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 
     13336,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36, 
    137134}; 
    138135unsigned char Type::impcnvWarn[TMAX][TMAX] = 
    139136{ 
    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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}; 
  • dmd/mtype.c

    r664 r715  
    104104ClassDeclaration *Type::typeinfotypelist; 
    105105 
    106 // LDC 
    107 Type* Type::topaque; 
    108  
    109106Type *Type::tvoidptr; 
    110107Type *Type::basic[TMAX]; 
     
    211208    mangleChar[Tslice] = '@'; 
    212209 
    213     // LDC 
    214     mangleChar[Topaque] = 'O'; 
    215  
    216210    for (i = 0; i < TMAX; i++) 
    217211    {   if (!mangleChar[i]) 
     
    234228 
    235229    tvoidptr = tvoid->pointerTo(); 
    236  
    237     // LDC 
    238     topaque = new TypeOpaque(); 
    239230 
    240231    // set size_t / ptrdiff_t types and pointer size 
     
    16261617        Arguments* args = new Arguments; 
    16271618        args->push(new Argument(STCin, Type::typeinfo->type, NULL, NULL)); 
    1628         args->push(new Argument(STCin, Type::topaque->arrayOf(), NULL, NULL)); 
    1629         adDup_fd = FuncDeclaration::genCfunc(args, Type::topaque->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); 
    16301621    } 
    16311622    static FuncDeclaration *adReverse_fd = NULL; 
    16321623    if(!adReverse_fd) { 
    16331624        Arguments* args = new Arguments; 
    1634         args->push(new Argument(STCin, Type::topaque->arrayOf(), NULL, NULL)); 
     1625        args->push(new Argument(STCin, Type::tvoid->arrayOf(), NULL, NULL)); 
    16351626        args->push(new Argument(STCin, Type::tsize_t, NULL, NULL)); 
    1636         adReverse_fd = FuncDeclaration::genCfunc(args, Type::topaque->arrayOf(), Id::adReverse); 
     1627        adReverse_fd = FuncDeclaration::genCfunc(args, Type::tvoid->arrayOf(), Id::adReverse); 
    16371628    } 
    16381629 
     
    16451636    if (dup) 
    16461637        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 
    16481646    if (!dup) 
    16491647        arguments->push(new IntegerExp(0, size, Type::tint32)); 
     
    16611659    if(!adSort_fd) { 
    16621660        Arguments* args = new Arguments; 
    1663         args->push(new Argument(STCin, Type::topaque->arrayOf(), NULL, NULL)); 
     1661        args->push(new Argument(STCin, Type::tvoid->arrayOf(), NULL, NULL)); 
    16641662        args->push(new Argument(STCin, Type::typeinfo->type, NULL, NULL)); 
    1665         adSort_fd = FuncDeclaration::genCfunc(args, Type::topaque->arrayOf(), "_adSort"); 
     1663        adSort_fd = FuncDeclaration::genCfunc(args, Type::tvoid->arrayOf(), "_adSort"); 
    16661664    } 
    16671665    static FuncDeclaration *adSortBit_fd = NULL; 
    16681666    if(!adSortBit_fd) { 
    16691667        Arguments* args = new Arguments; 
    1670         args->push(new Argument(STCin, Type::topaque->arrayOf(), NULL, NULL)); 
     1668        args->push(new Argument(STCin, Type::tvoid->arrayOf(), NULL, NULL)); 
    16711669        args->push(new Argument(STCin, Type::typeinfo->type, NULL, NULL)); 
    1672         adSortBit_fd = FuncDeclaration::genCfunc(args, Type::topaque->arrayOf(), "_adSortBit"); 
     1670        adSortBit_fd = FuncDeclaration::genCfunc(args, Type::tvoid->arrayOf(), "_adSortBit"); 
    16731671    } 
    16741672 
     
    16791677    e = e->castTo(sc, n->arrayOf());    // convert to dynamic array 
    16801678    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 
    16821687    if (next->ty != Tbit) 
    16831688        arguments->push(n->getTypeInfo(sc));   // LDC, we don't support the getInternalTypeInfo 
     
    23512356    if(!aaLen_fd) { 
    23522357        Arguments* args = new Arguments; 
    2353         args->push(new Argument(STCin, Type::topaque->pointerTo(), NULL, NULL)); 
     2358        args->push(new Argument(STCin, Type::tvoid->pointerTo(), NULL, NULL)); 
    23542359        aaLen_fd = FuncDeclaration::genCfunc(args, Type::tsize_t, Id::aaLen); 
    23552360    } 
     
    23722377    if(!aaKeys_fd) { 
    23732378        Arguments* args = new Arguments; 
    2374         args->push(new Argument(STCin, Type::topaque->pointerTo(), NULL, NULL)); 
     2379        args->push(new Argument(STCin, Type::tvoid->pointerTo(), NULL, NULL)); 
    23752380        args->push(new Argument(STCin, Type::tsize_t, NULL, NULL)); 
    2376         aaKeys_fd = FuncDeclaration::genCfunc(args, Type::topaque->arrayOf(), Id::aaKeys); 
     2381        aaKeys_fd = FuncDeclaration::genCfunc(args, Type::tvoid->arrayOf(), Id::aaKeys); 
    23772382    } 
    23782383 
     
    23932398    if(!aaValues_fd) { 
    23942399        Arguments* args = new Arguments; 
    2395         args->push(new Argument(STCin, Type::topaque->pointerTo(), NULL, NULL)); 
     2400        args->push(new Argument(STCin, Type::tvoid->pointerTo(), NULL, NULL)); 
    23962401        args->push(new Argument(STCin, Type::tsize_t, NULL, NULL)); 
    23972402        args->push(new Argument(STCin, Type::tsize_t, NULL, NULL)); 
    2398         aaValues_fd = FuncDeclaration::genCfunc(args, Type::topaque->arrayOf(), Id::aaValues); 
     2403        aaValues_fd = FuncDeclaration::genCfunc(args, Type::tvoid->arrayOf(), Id::aaValues); 
    23992404    } 
    24002405 
     
    24182423    if(!aaRehash_fd) { 
    24192424        Arguments* args = new Arguments; 
    2420         args->push(new Argument(STCin, Type::topaque->pointerTo(), NULL, NULL)); 
     2425        args->push(new Argument(STCin, Type::tvoid->pointerTo(), NULL, NULL)); 
    24212426        args->push(new Argument(STCin, Type::typeinfo->type, NULL, NULL)); 
    24222427        aaRehash_fd = FuncDeclaration::genCfunc(args, Type::tvoidptr, Id::aaRehash); 
     
    52435248} 
    52445249 
    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  
    52555250/***************************** Argument *****************************/ 
    52565251 
  • dmd/mtype.h

    r663 r715  
    9999    Tslice, 
    100100 
    101 // LDC 
    102     Topaque, 
    103  
    104101    TMAX 
    105102}; 
     
    177174    static ClassDeclaration *typeinfodelegate; 
    178175    static ClassDeclaration *typeinfotypelist; 
    179  
    180     // LDC, for runtime function signatures that contain 
    181     // AAs or arrays of unknown type 
    182     static Type* topaque; 
    183176 
    184177    static Type *basic[TMAX]; 
     
    675668}; 
    676669 
    677 //LDC 
    678 struct TypeOpaque : Type 
    679 {  
    680     TypeOpaque() : Type(Topaque, NULL) {} 
    681     void toCBuffer2(OutBuffer *buf, HdrGenState *hgs, int mod); 
    682 }; 
    683  
    684670/**************************************************************/ 
    685671 
  • dmd/statement.c

    r664 r715  
    16031603        if(!aaApply2_fd) { 
    16041604            Arguments* args = new Arguments; 
    1605             args->push(new Argument(STCin, Type::topaque->pointerTo(), NULL, NULL)); 
     1605            args->push(new Argument(STCin, Type::tvoid->pointerTo(), NULL, NULL)); 
    16061606            args->push(new Argument(STCin, Type::tsize_t, NULL, NULL)); 
    16071607            Arguments* dgargs = new Arguments; 
     
    16151615        if(!aaApply_fd) { 
    16161616            Arguments* args = new Arguments; 
    1617             args->push(new Argument(STCin, Type::topaque->pointerTo(), NULL, NULL)); 
     1617            args->push(new Argument(STCin, Type::tvoid->pointerTo(), NULL, NULL)); 
    16181618            args->push(new Argument(STCin, Type::tsize_t, NULL, NULL)); 
    16191619            Arguments* dgargs = new Arguments; 
     
    16701670        //LDC: Build arguments. 
    16711671        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)); 
    16731673        if (dim == 2) { 
    16741674            Arguments* dgargs = new Arguments; 
     
    16901690        if (tab->ty == Tsarray) 
    16911691           aggr = aggr->castTo(sc, tn->arrayOf()); 
    1692        exps->push(aggr); 
     1692        exps->push(aggr); 
    16931693        exps->push(flde); 
    16941694        e = new CallExp(loc, ec, exps); 
  • gen/arrays.cpp

    r683 r715  
    5656    LOG_SCOPE; 
    5757 
    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); 
    10862} 
    10963 
     
    685639    assert(fn); 
    686640 
     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 
    687649    LLValue* lmem; 
    688650    LLValue* rmem; 
    689  
    690     // cast static arrays to dynamic ones, this turns them into DSliceValues 
    691     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 storage 
    706     if (l->isSlice()) { 
    707         lmem = DtoAlloca(DtoType(l->getType()), "tmpparam"); 
    708         DtoSetArray(lmem, DtoArrayLen(l), DtoArrayPtr(l)); 
    709     } 
    710     // also null 
    711     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     else 
    717         lmem = l->getRVal(); 
    718  
    719     // and for the rvalue ... 
    720     // we need to give slices storage 
    721     if (r->isSlice()) { 
    722         rmem = DtoAlloca(DtoType(r->getType()), "tmpparam"); 
    723         DtoSetArray(rmem, DtoArrayLen(r), DtoArrayPtr(r)); 
    724     } 
    725     // also null 
    726     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     else 
    732         rmem = r->getRVal(); 
    733  
    734     const LLType* pt = fn->getFunctionType()->getParamType(0); 
    735  
    736651    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); 
    745659 
    746660    // pass array typeinfo ? 
     
    754668            Logger::cout() << "typeinfo decl: " << *tival << '\n'; 
    755669 
    756         pt = fn->getFunctionType()->getParamType(2); 
    757         args.push_back(DtoBitCast(tival, pt)); 
     670        args.push_back(DtoBitCast(tival, fn->getFunctionType()->getParamType(2))); 
    758671    } 
    759672 
    760673    CallOrInvoke* call = gIR->CreateCallOrInvoke(fn, args.begin(), args.end(), "tmp"); 
    761  
    762     // set param attrs 
    763     llvm::AttrListPtr palist; 
    764     palist = palist.addAttr(1, llvm::Attribute::ByVal); 
    765     palist = palist.addAttr(2, llvm::Attribute::ByVal); 
    766     call->setAttributes(palist); 
    767674 
    768675    return call->get(); 
     
    918825        else if (v->isNull()) 
    919826            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"); 
    921830    } 
    922831    else if (t->ty == Tsarray) { 
     
    944853        else if (v->isNull()) 
    945854            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"); 
    947858    } 
    948859    else if (t->ty == Tsarray) { 
     
    1047958} 
    1048959 
    1049  
    1050960////////////////////////////////////////////////////////////////////////////////////////// 
    1051961void DtoArrayBoundsCheck(Loc& loc, DValue* arr, DValue* index, bool isslice) 
     
    1072982 
    1073983    std::vector<LLValue*> args; 
    1074     llvm::AttrListPtr palist; 
    1075984 
    1076985    // 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)); 
    1079987 
    1080988    // line param 
     
    1085993    llvm::Function* errorfn = LLVM_D_GetRuntimeFunction(gIR->module, "_d_array_bounds"); 
    1086994    CallOrInvoke* call = gIR->CreateCallOrInvoke(errorfn, args.begin(), args.end()); 
    1087     call->setAttributes(palist); 
    1088995 
    1089996    // the function does not return 
    1090997    gIR->ir->CreateUnreachable(); 
    1091998 
    1092  
    1093999    // if ok, proceed in okbb 
    10941000    gIR->scope() = IRScope(okbb, oldend); 
  • gen/dvalue.cpp

    r601 r715  
    4444///////////////////////////////////////////////////////////////////////////////////////////////// 
    4545 
     46LLValue* DSliceValue::getRVal() 
     47{ 
     48    assert(len); 
     49    assert(ptr); 
     50    return DtoAggrPair(len, ptr); 
     51} 
     52 
     53///////////////////////////////////////////////////////////////////////////////////////////////// 
     54///////////////////////////////////////////////////////////////////////////////////////////////// 
     55 
    4656DFuncValue::DFuncValue(FuncDeclaration* fd, LLValue* v, LLValue* vt) 
    4757{ 
  • gen/dvalue.h

    r664 r715  
    3030struct DFuncValue; 
    3131struct DSliceValue; 
    32 struct DArrayLenValue; 
    3332struct DLRValue; 
    3433 
     
    5049    virtual DSliceValue* isSlice() { return NULL; } 
    5150    virtual DFuncValue* isFunc() { return NULL; } 
    52     virtual DArrayLenValue* isArrayLen() { return NULL; } 
    5351    virtual DLRValue* isLRValue() { return NULL; } 
    5452 
     
    128126    DSliceValue(Type* t, LLValue* l, LLValue* p) { type=t; ptr=p; len=l; } 
    129127 
     128    virtual LLValue* getRVal(); 
     129 
    130130    virtual Type*& getType() { assert(type); return type; } 
    131131    virtual DSliceValue* isSlice() { return this; } 
  • gen/functions.cpp

    r632 r715  
    6060        const LLType* arrTy = DtoArrayType(LLType::Int8Ty); 
    6161        const LLType* arrArrTy = DtoArrayType(arrTy); 
    62         paramvec.push_back(getPtrToType(arrArrTy)); 
     62        paramvec.push_back(arrArrTy); 
    6363        } 
    6464    } 
     
    104104        types.push_back(getPtrToType(getPtrToType(ti->ir.irStruct->constInit->getType()))); 
    105105        const LLType* t1 = llvm::StructType::get(types); 
    106         paramvec.push_back(getPtrToType(t1)); 
     106        paramvec.push_back(t1); 
    107107        paramvec.push_back(getPtrToType(LLType::Int8Ty)); 
    108108    } 
     
    124124        const LLType* at = DtoType(argT); 
    125125 
    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)) { 
    144128            Logger::println("opaque param"); 
    145129            assert(argT->ty == Tstruct || argT->ty == Tclass); 
    146130            paramvec.push_back(getPtrToType(at)); 
    147131        } 
     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 
    148153        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; 
    161157            paramvec.push_back(at); 
    162158        } 
     
    361357        PAWI.Attrs = llvm::Attribute::StructRet; 
    362358        attrs.push_back(PAWI); 
    363     } 
    364  
    365     // set byval attrs on implicit main arg 
    366     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++; 
    372359    } 
    373360 
     
    776763    } 
    777764 
    778     // copy _argptr to a memory location 
     765    // copy _argptr and _arguments to a memory location 
    779766    if (f->linkage == LINKd && f->varargs == 1) 
    780767    { 
     768        // _argptr 
    781769        LLValue* argptrmem = DtoAlloca(fd->ir.irFunc->_argptr->getType(), "_argptr_mem"); 
    782770        new llvm::StoreInst(fd->ir.irFunc->_argptr, argptrmem, gIR->scopebb()); 
    783771        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; 
    784777    } 
    785778 
  • gen/llvmhelpers.cpp

    r709 r715  
    118118    llvm::Function* fn = LLVM_D_GetRuntimeFunction(gIR->module, fname); 
    119119 
    120     // param attrs 
    121     llvm::AttrListPtr palist; 
    122     int idx = 1; 
    123  
    124120    // msg param 
    125121    if (msg) 
    126122    { 
    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()); 
    143124    } 
    144125 
    145126    // 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)); 
    149128 
    150129    // line param 
     
    154133    // call 
    155134    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); 
    157139 
    158140    // after assert is always unreachable 
     
    446428        } 
    447429        // reference assignment 
     430        else if (t2->ty == Tarray) { 
     431            DtoStore(rhs->getRVal(), lhs->getLVal()); 
     432        } 
     433        // some implicitly converting ref assignment 
    448434        else { 
    449             DtoArrayAssign(lhs->getLVal(), rhs->getRVal()); 
     435            DtoSetArray(lhs->getLVal(), DtoArrayLen(rhs), DtoArrayPtr(rhs)); 
    450436        } 
    451437    } 
     
    754740        error(loc, "invalid cast from '%s' to '%s'", val->getType()->toChars(), to->toChars()); 
    755741        fatal(); 
     742    } 
     743} 
     744 
     745////////////////////////////////////////////////////////////////////////////////////////// 
     746 
     747DValue* 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()); 
    756788    } 
    757789} 
     
    14141446static LLConstant* expand_to_sarray(Type *base, Expression* exp) 
    14151447{ 
    1416     Logger::println("building type %s from expression (%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()); 
    14171449    const LLType* dstTy = DtoType(base); 
    14181450    if (Logger::enabled()) 
     
    14641496        if (base->ty == Tsarray) 
    14651497        { 
    1466             Logger::println("type is a static array, building constant array initializer from single value"); 
     1498            Logger::println("type is a static array, building constant array initializer to single value"); 
    14671499            return expand_to_sarray(base, exp); 
    14681500        } 
    14691501        else 
    14701502        { 
    1471             error("cannot yet convert default initializer %s from type %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()); 
    14721504            fatal(); 
    14731505        } 
  • gen/llvmhelpers.h

    r664 r715  
    5858DValue* DtoCastDelegate(Loc& loc, DValue* val, Type* to); 
    5959DValue* 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 
     62DValue* DtoPaintType(Loc& loc, DValue* val, Type* to); 
    6063 
    6164// is template instance check 
  • gen/runtime.cpp

    r663 r715  
    111111static const LLType* rt_array(const LLType* elemty) 
    112112{ 
    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); 
    125114} 
    126115 
     
    200189        types.push_back(intTy); 
    201190        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); 
    207194    } 
    208195 
     
    215202        types.push_back(intTy); 
    216203        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); 
    221205    } 
    222206 
     
    383367        const llvm::FunctionType* fty = llvm::FunctionType::get(intTy, types, false); \ 
    384368        llvm::AttrListPtr palist; \ 
    385         palist = palist.addAttr(1, llvm::Attribute::ByVal); \ 
    386369        palist = palist.addAttr(2, llvm::Attribute::ByVal); \ 
    387370        llvm::Function::Create(fty, llvm::GlobalValue::ExternalLinkage, fname, M)->setAttributes(palist); \ 
     
    403386        const llvm::FunctionType* fty = llvm::FunctionType::get(intTy, types, false); \ 
    404387        llvm::AttrListPtr palist; \ 
    405         palist = palist.addAttr(1, llvm::Attribute::ByVal); \ 
    406388        palist = palist.addAttr(2, llvm::Attribute::ByVal); \ 
    407389        llvm::Function::Create(fty, llvm::GlobalValue::ExternalLinkage, fname, M)->setAttributes(palist); \ 
     
    422404        const llvm::FunctionType* fty = llvm::FunctionType::get(intTy, types, false); \ 
    423405        llvm::AttrListPtr palist; \ 
    424         palist = palist.addAttr(1, llvm::Attribute::ByVal); \ 
    425406        palist = palist.addAttr(2, llvm::Attribute::ByVal); \ 
    426407        llvm::Function::Create(fty, llvm::GlobalValue::ExternalLinkage, fname, M)->setAttributes(palist); \ 
     
    441422        const llvm::FunctionType* fty = llvm::FunctionType::get(intTy, types, false); \ 
    442423        llvm::AttrListPtr palist; \ 
    443         palist = palist.addAttr(1, llvm::Attribute::ByVal); \ 
    444424        palist = palist.addAttr(2, llvm::Attribute::ByVal); \ 
    445425        llvm::Function::Create(fty, llvm::GlobalValue::ExternalLinkage, fname, M)->setAttributes(palist); \ 
     
    471451    ///////////////////////////////////////////////////////////////////////////////////// 
    472452 
    473     // builds the d string[] for the D main args from the C main args 
    474     // 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  
    489453    // cast to object 
    490454    // Object _d_toObject(void* p) 
     
    530494        std::vector<const LLType*> types; 
    531495        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); 
    538499    } 
    539500 
     
    545506        std::vector<const LLType*> types; 
    546507        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) 
    556514    { 
    557515        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"); 
    558538        std::vector<const LLType*> types; 
    559539        types.push_back(rt_array(byteTy)); 
    560540        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)); 
    589541        types.push_back(typeInfoTy); 
    590542        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) 
    599548    { 
    600549        std::string fname("_adCmpChar"); 
     
    603552        types.push_back(rt_array(byteTy)); 
    604553        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) 
    612558    { 
    613559        std::string fname("_adSort"); 
    614560        std::vector<const LLType*> types; 
    615561        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); 
    622565    } 
    623566 
     
    681624    } 
    682625 
    683     // ArrayRet_t _aaValues(AA aa, size_t keysize, size_t valuesize) 
     626    // void[] _aaValues(AA aa, size_t keysize, size_t valuesize) 
    684627    { 
    685628        std::string fname("_aaValues"); 
    686629        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); 
    692634        llvm::Function::Create(fty, llvm::GlobalValue::ExternalLinkage, fname, M); 
    693635    } 
     
    703645    } 
    704646 
    705     // ArrayRet_t _aaKeys(AA aa, size_t keysize) 
     647    // void[] _aaKeys(AA aa, size_t keysize) 
    706648    { 
    707649        std::string fname("_aaKeys"); 
    708650        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); 
    713654        llvm::Function::Create(fty, llvm::GlobalValue::ExternalLinkage, fname, M); 
    714655    } 
     
    733674        types.push_back(aaTy); 
    734675        types.push_back(sizeTy); 
    735         types.push_back(rt_dg1()); 
     676        types.push_back(rt_dg2()); 
    736677        const llvm::FunctionType* fty = llvm::FunctionType::get(intTy, types, false); 
    737678        llvm::AttrListPtr palist; 
     
    809750        std::string fname("_d_switch_string"); 
    810751        std::vector<const LLType*> types; 
    811         types.push_back(rt_array(rt_array2(byteTy))); 
     752        types.push_back(rt_array(stringTy)); 
    812753        types.push_back(stringTy); 
    813754        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); 
    818756    } 
    819757 
     
    822760        std::string fname("_d_switch_ustring"); 
    823761        std::vector<const LLType*> types; 
    824         types.push_back(rt_array(rt_array2(shortTy))); 
     762        types.push_back(rt_array(wstringTy)); 
    825763        types.push_back(wstringTy); 
    826764        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); 
    831766    } 
    832767 
     
    835770        std::string fname("_d_switch_dstring"); 
    836771        std::vector<const LLType*> types; 
    837         types.push_back(rt_array(rt_array2(intTy))); 
     772        types.push_back(rt_array(dstringTy)); 
    838773        types.push_back(dstringTy); 
    839774        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); 
    844776    } 
    845777 
  • gen/statements.cpp

    r704 r715  
    677677}; 
    678678 
    679 static LLValue* call_string_switch_runtime(llvm::GlobalVariable* table, Expression* e) 
     679static LLValue* call_string_switch_runtime(llvm::Value* table, Expression* e) 
    680680{ 
    681681    Type* dt = e->type->toBasetype(); 
     
    706706 
    707707    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(); 
    720709    assert(llval->getType() == fn->getFunctionType()->getParamType(1)); 
    721710 
    722711    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); 
    728712 
    729713    return call->get(); 
     
    749733 
    750734    // string switch? 
    751     llvm::GlobalVariable* switchTable = 0; 
     735    llvm::Value* switchTable = 0; 
    752736    Array caseArray; 
    753737    if (!condition->type->isintegral()) 
     
    791775        sinits.push_back(DtoConstSize_t(inits.size())); 
    792776        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); 
    796778    } 
    797779 
     
    11741156    DValue* e = exp->toElem(p); 
    11751157 
     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!!! 
    11761165    DtoDeclarationExp(wthis); 
     1166#endif 
     1167 
    11771168    DtoStore(e->getRVal(), wthis->ir.irLocal->value); 
    11781169 
     
    12701261    llvm::Function* fn = LLVM_D_GetRuntimeFunction(gIR->module, "_d_switch_error"); 
    12711262 
    1272     // param attrs 
    1273     llvm::AttrListPtr palist; 
    1274     int idx = 1; 
    1275  
    12761263    std::vector<LLValue*> args; 
    12771264 
    12781265    // 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)); 
    12811267 
    12821268    // line param 
     
    12861272    // call 
    12871273    CallOrInvoke* call = gIR->CreateCallOrInvoke(fn, args.begin(), args.end()); 
    1288     call->setAttributes(palist); 
    12891274 
    12901275    gIR->ir->CreateUnreachable(); 
  • gen/tocall.cpp

    r632 r715  
    176176 
    177177    // specify arguments 
    178     args.push_back(typeinfoarrayparam); 
     178    args.push_back(DtoLoad(typeinfoarrayparam)); 
    179179    ++argidx; 
    180180    args.push_back(gIR->ir->CreateBitCast(mem, getPtrToType(LLType::Int8Ty), "tmp")); 
     
    320320            if (fnarg) // can fnarg ever be null in this block? 
    321321            { 
    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                } 
    327327                if (arg->getType() != callableTy->getParamType(j)) 
    328328                    arg = DtoBitCast(arg, callableTy->getParamType(j)); 
     
    356356    LLValue* retllval = (retinptr) ? args[0] : call->get(); 
    357357 
    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    } 
    361385 
    362386    // set calling convention and parameter attributes 
  • gen/toir.cpp

    r705 r715  
    784784    LOG_SCOPE; 
    785785 
     786    // get the value to cast 
    786787    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()) 
    793800        return v; 
    794     } 
    795  
     801    // if we're casting a lvalue, keep it around, we might be in a lvalue cast. 
    796802    else if(u->isLVal()) 
    797803        return new DLRValue(u, v); 
    798  
    799     else 
    800         return v; 
     804    // otherwise just return the new value 
     805    return v; 
    801806} 
    802807 
     
    812817 
    813818    if(!isaPointer(c->getType()) || !isaPointer(lltype)) { 
    814         error("can only cast pointers to pointers at compile time, 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()); 
    815820        fatal(); 
    816821    } 
     
    15531558    { 
    15541559        DtoDeleteArray(dval); 
    1555         if (!dval->isSlice()) 
    1556             DtoSetArrayToNull(dval->getRVal()); 
     1560        if (dval->isLVal()) 
     1561            DtoSetArrayToNull(dval->getLVal()); 
    15571562    } 
    15581563    // unknown/invalid 
  • gen/tollvm.cpp

    r705 r715  
    2626    Type* typ = type->toBasetype(); 
    2727    TY t = typ->ty; 
    28     return (t == Tstruct || t == Tarray || t == Tdelegate || t == Tsarray); 
     28    return (t == Tstruct || t == Tdelegate || t == Tsarray); 
    2929} 
    3030 
     
    3333    Type* typ = type->toBasetype(); 
    3434    TY t = typ->ty; 
    35     return (t == Tstruct || t == Tarray || t == Tdelegate || t == Tsarray); 
     35    return (t == Tstruct || t == Tdelegate || t == Tsarray); 
    3636} 
    3737 
     
    180180    } 
    181181*/ 
    182     // opaque type 
    183     case Topaque: 
    184         return llvm::OpaqueType::get(); 
    185182 
    186183    default: 
     
    561558LLValue* DtoLoad(LLValue* src, const char* name) 
    562559{ 
     560    if (Logger::enabled()) 
     561        Logger::cout() << "loading " << *src <<  '\n'; 
    563562    LLValue* ld = gIR->ir->CreateLoad(src, name ? name : "tmp"); 
    564563    //ld->setVolatile(gIR->func()->inVolatile); 
     
    568567void DtoStore(LLValue* src, LLValue* dst) 
    569568{ 
     569    if (Logger::enabled()) 
     570        Logger::cout() << "storing " << *src << " into " << *dst << '\n'; 
    570571    LLValue* st = gIR->ir->CreateStore(src,dst); 
    571572    //st->setVolatile(gIR->func()->inVolatile); 
     
    578579    if (v->getType() == t) 
    579580        return v; 
     581    assert(!(isaStruct(t) || isaStruct(v->getType()))); 
    580582    return gIR->ir->CreateBitCast(v, t, name ? name : "tmp"); 
    581583} 
     
    807809    return gIR->ir->CreateInsertValue(res, V2, 1, name?name:"tmp"); 
    808810} 
     811 
     812LLValue* 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 
     818LLValue* 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  
    9999// pair type helpers 
    100100LLValue* DtoAggrPair(const LLType* type, LLValue* V1, LLValue* V2, const char* name = 0); 
     101LLValue* DtoAggrPair(LLValue* V1, LLValue* V2, const char* name = 0); 
     102LLValue* DtoAggrPaint(LLValue* aggr, const LLType* as); 
    101103 
    102104/** 
  • gen/toobj.cpp

    r708 r715  
    7676    LOG_SCOPE; 
    7777 
    78 //    printf("codegen: %s\n", srcfile->toChars()); 
     78    //printf("codegen: %s\n", srcfile->toChars()); 
    7979 
    8080    // start by deleting the old object file 
  • runtime/internal/aApply.d

    r443 r715  
    3737private import util.utf; 
    3838 
     39//debug = apply; 
     40debug(apply) 
     41{ 
     42    extern(C) int printf(char*, ...); 
     43} 
     44 
    3945/********************************************** 
    4046 */ 
     
    357363 
    358364        d = aa[i]; 
     365        debug(apply) printf("d = %u\n", d); 
    359366        if (d & ~0x7F) 
    360367        { 
     
    364371            foreach (char c2; b) 
    365372            { 
     373                debug(apply) printf("c2 = %d\n", c2); 
    366374                result = dg(&i, cast(void *)&c2); 
    367375                if (result) 
  • runtime/internal/aaA.d

    r664 r715  
    6363//  8_589_934_513UL, 17_179_869_143UL 
    6464]; 
    65  
    66 // This is the type of the return value for dynamic arrays. 
    67 struct Array 
    68 { 
    69     size_t length; 
    70     void* ptr; 
    71 } 
    7265 
    7366struct aaA 
     
    450443 */ 
    451444 
    452 Array _aaValues(AA aa, size_t keysize, size_t valuesize) 
     445void[] _aaValues(AA aa, size_t keysize, size_t valuesize) 
    453446in 
    454447{ 
     
    458451{ 
    459452    size_t resi; 
    460     Array a; 
     453    void[] a; 
    461454 
    462455    void _aaValues_x(aaA* e) 
     
    481474    if (aa) 
    482475    { 
    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, 
    485478                                      valuesize < (void*).sizeof ? BlkAttr.NO_SCAN : 0); 
     479        a = ptr[0 .. len]; 
    486480        resi = 0; 
    487481        foreach (e; aa.b) 
     
    594588 */ 
    595589 
    596 Array _aaKeys(AA aa, size_t keysize) 
     590void[] _aaKeys(AA aa, size_t keysize) 
    597591{ 
    598592    byte[] res; 
     
    618612    auto len = _aaLen(aa); 
    619613    if (!len) 
    620         return Array()
     614        return null
    621615    res = (cast(byte*) gc_malloc(len * keysize, 
    622616                                 !(aa.keyti.flags() & 1) ? BlkAttr.NO_SCAN : 0)) [0 .. len * keysize]; 
     
    629623    assert(resi == len); 
    630624 
    631     return Array(len, res.ptr)
     625    return res.ptr[0 .. len]
    632626} 
    633627 
  • runtime/internal/adi.d

    r486 r715  
    5656 
    5757 
    58 struct Array 
    59 { 
    60     size_t  length; 
    61     void*   ptr; 
    62 } 
    63  
    6458/********************************************** 
    6559 * Reverse array of chars. 
     
    9387 
    9488            uint stridelo = UTF8stride[clo]; 
     89            // don't barf on invalid strides, just ignore it 
     90            if (stridelo == 0xFF) 
     91                stridelo = 1; 
    9592 
    9693            uint stridehi = 1; 
     
    246243 */ 
    247244 
    248 extern (C) Array _adReverse(Array a, size_t szelem) 
     245extern (C) void[] _adReverse(void[] a, size_t szelem) 
    249246    out (result) 
    250247    { 
     
    288285            } 
    289286        } 
    290         return Array(a.length, a.ptr)
     287        return a.ptr[0 .. a.length]
    291288    } 
    292289 
     
    376373 */ 
    377374 
    378 extern (C) int _adEq(Array a1, Array a2, TypeInfo ti) 
     375extern (C) int _adEq(void[] a1, void[] a2, TypeInfo ti) 
    379376{ 
    380377    debug(adi) printf("_adEq(a1.length = %d, a2.length = %d)\n", a1.length, a2.length); 
     
    406403 */ 
    407404 
    408 extern (C) int _adCmp(Array a1, Array a2, TypeInfo ti) 
     405extern (C) int _adCmp(void[] a1, void[] a2, TypeInfo ti) 
    409406{ 
    410407    debug(adi) printf("adCmp()\n"); 
     
    443440 */ 
    444441 
    445 extern (C) int _adCmpChar(Array a1, Array a2) 
     442extern (C) int _adCmpChar(void[] a1, void[] a2) 
    446443{ 
    447444  version(D_InlineAsm_X86) 
  • runtime/internal/ldc.mak

    r684 r715  
    6565targets : lib sharedlib doc 
    6666all     : lib sharedlib doc 
    67 lib     : ldc.bclib ldc.clib ldc.lib 
     67#lib     : ldc.bclib ldc.clib ldc.lib 
     68lib     : ldc.clib ldc.lib 
    6869sharedlib : ldc.sharedlib 
    6970doc     : ldc.doc 
     
    219220###################################################### 
    220221 
    221 ldc.bclib : $(LIB_TARGET_BC_ONLY) 
     222#ldc.bclib : $(LIB_TARGET_BC_ONLY) 
    222223ldc.clib : $(LIB_TARGET_C_ONLY) 
    223224ldc.lib : $(LIB_TARGET_FULL) 
    224225ldc.sharedlib : $(LIB_TARGET_SHARED) 
    225226 
    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) 
    229230 
    230231 
     
    251252clean : 
    252253    find . -name "*.di" | xargs $(RM) 
    253   $(RM) $(ALL_OBJS_BC) 
     254# $(RM) $(ALL_OBJS_BC) 
    254255    $(RM) $(ALL_OBJS_O) 
    255256    $(RM) $(ALL_DOCS) 
  • runtime/internal/lifetime.d

    r663 r715  
    10931093 * Support for array.dup property. 
    10941094 */ 
    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 */ 
     1100extern (C) void[] _adDupT(TypeInfo ti, void[] a) 
    11061101out (result) 
    11071102{ 
     
    11111106body 
    11121107{ 
    1113     Array2 r; 
     1108    void* ptr; 
    11141109 
    11151110    if (a.length) 
     
    11171112        auto sizeelem = ti.next.tsize();                // array element size 
    11181113        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]; 
    11241118} 
    11251119 
  • runtime/internal/qsort2.d

    r443 r715  
    1818private import tango.stdc.stdlib; 
    1919 
    20 struct Array 
    21 { 
    22     size_t length; 
    23     void*  ptr; 
    24 } 
    25  
    2620private TypeInfo tiglobal; 
    2721 
     
    3125} 
    3226 
    33 extern (C) Array _adSort(Array a, TypeInfo ti) 
     27extern (C) void[] _adSort(void[] a, TypeInfo ti) 
    3428{ 
    3529    synchronized 
  • tests/mini/foreach6.d

    r341 r715  
    1 module foreach6; 
     1module mini.foreach6; 
    22 
    33struct S 
  • tests/mini/foreach8.d

    r341 r715  
    1 module tangotests.foreach1
     1module mini.foreach8
    22 
    33extern(C) int printf(char*, ...); 
     
    55int main(){ 
    66    dchar[] array="\u2260"; 
     7    printf("array[0] == %u\n", array[0]); 
    78    int test=0; 
    89    int count=0; 
Copyright © 2008, LDC Development Team.