Changeset ada4575


Ignore:
Timestamp:
Feb 15, 2019, 2:37:56 PM (5 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, persistent-indexer, pthread-emulation, qualifiedEnum
Children:
ee06e41b
Parents:
fba51ab
Message:

programmatically creation basic-type declarations

Location:
src
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • src/BasicTypes-gen.cc

    rfba51ab rada4575  
    249249        } // for
    250250
    251         #define startMK "// GENERATED START, DO NOT EDIT"
    252         #define endMK "// GENERATED END"
     251        #define STARTMK "// GENERATED START, DO NOT EDIT"
     252        #define BYMK "// GENERATED BY " __FILE__
     253        #define ENDMK "// GENERATED END"
    253254        fstream file;
    254255        stringstream buffer, code;
     
    260261        resetInput( file, Type, buffer, code, str );
    261262
    262         if ( (start = str.find( startMK )) == string::npos ) Abort( "start", Type );
    263         start += sizeof( startMK );                                                     // includes newline
     263        if ( (start = str.find( STARTMK )) == string::npos ) Abort( "start", Type );
     264        start += sizeof( STARTMK );                                                     // includes newline
    264265        code << str.substr( 0, start );
    265266
    266         code << "\t// GENERATED BY " __FILE__ << endl;
     267        code << "\t" << BYMK << endl;
    267268        code << "\tenum Kind {" << endl;
    268269        for ( int r = 0; r < NUMBER_OF_BASIC_TYPES; r += 1 ) {
     
    273274        code << "\t";                                                                           // indentation for end marker
    274275
    275         if ( (start = str.find( endMK, start + 1 )) == string::npos ) Abort( "end", Type );
     276        if ( (start = str.find( ENDMK, start + 1 )) == string::npos ) Abort( "end", Type );
    276277        code << str.substr( start );
    277278
     
    283284        resetInput( file, ConversionCost, buffer, code, str );
    284285
    285         if ( (start = str.find( startMK )) == string::npos ) Abort( "start", ConversionCost );
    286         start += sizeof( startMK );                                                     // includes newline
     286        if ( (start = str.find( STARTMK )) == string::npos ) Abort( "start", ConversionCost );
     287        start += sizeof( STARTMK );                                                     // includes newline
    287288        code << str.substr( 0, start );
    288289
    289         code << "\t// GENERATED BY " __FILE__ << endl;
     290        code << "\t" << BYMK << endl;
    290291        code << "\t/* EXTENDED INTEGRAL RANK HIERARCHY (root to leaves)" << endl;
    291292        for ( int c = 0; c < NUMBER_OF_BASIC_TYPES; c += 1 ) {
     
    305306        code << "\t";                                                                           // indentation for end marker
    306307
    307         if ( (start = str.find( endMK, start + 1 )) == string::npos ) Abort( "end", ConversionCost );
    308         if ( (end = str.find( startMK, start + 1 )) == string::npos ) Abort( "start", ConversionCost );
    309         end += sizeof( startMK );
     308        if ( (start = str.find( ENDMK, start + 1 )) == string::npos ) Abort( "end", ConversionCost );
     309        if ( (end = str.find( STARTMK, start + 1 )) == string::npos ) Abort( "start", ConversionCost );
     310        end += sizeof( STARTMK );
    310311        code << str.substr( start, end - start );
    311312       
    312         code << "\t// GENERATED BY " __FILE__ << endl;
     313        code << "\t" << BYMK << endl;
    313314        code << "\tstatic const int costMatrix[BasicType::NUMBER_OF_BASIC_TYPES][BasicType::NUMBER_OF_BASIC_TYPES] = { // path length from root to node" << endl
    314315                 << "\t\t/*       ";
     
    327328        code << "\t";                                                                           // indentation for end marker
    328329
    329         if ( (start = str.find( endMK, start + 1 )) == string::npos ) Abort( "end", ConversionCost );
    330         if ( (end = str.find( startMK, start + 1 )) == string::npos ) Abort( "start", ConversionCost );
    331         end += sizeof( startMK );
     330        if ( (start = str.find( ENDMK, start + 1 )) == string::npos ) Abort( "end", ConversionCost );
     331        if ( (end = str.find( STARTMK, start + 1 )) == string::npos ) Abort( "start", ConversionCost );
     332        end += sizeof( STARTMK );
    332333        code << str.substr( start, end - start );
    333334
    334         code << "\t// GENERATED BY " __FILE__ << endl;
     335        code << "\t" << BYMK << endl;
    335336        code << "\tstatic const int signMatrix[BasicType::NUMBER_OF_BASIC_TYPES][BasicType::NUMBER_OF_BASIC_TYPES] = { // number of sign changes in safe conversion" << endl
    336337                 << "\t\t/*       ";
     
    349350        code << "\t";                                                                           // indentation for end marker
    350351
    351         if ( (start = str.find( endMK, start + 1 )) == string::npos ) Abort( "end", ConversionCost );
     352        if ( (start = str.find( ENDMK, start + 1 )) == string::npos ) Abort( "end", ConversionCost );
    352353        code << str.substr( start );
    353354
     
    359360        resetInput( file, CommonType, buffer, code, str );
    360361
    361         if ( (start = str.find( startMK )) == string::npos ) Abort( "start", CommonType );
    362         start += sizeof( startMK );                                                     // includes newline
     362        if ( (start = str.find( STARTMK )) == string::npos ) Abort( "start", CommonType );
     363        start += sizeof( STARTMK );                                                     // includes newline
    363364        code << str.substr( 0, start );
    364365
    365366        enum { PER_ROW = 6 };
    366         code << "\t// GENERATED BY " __FILE__ << endl;
     367        code << "\t" << BYMK << endl;
    367368        code << "\t#define BT BasicType::" << endl;
    368369        code << "\tstatic const BasicType::Kind commonTypes[BasicType::NUMBER_OF_BASIC_TYPES][BasicType::NUMBER_OF_BASIC_TYPES] = { // nearest common ancestor" << endl
     
    394395        code << "\t";                                                                           // indentation for end marker
    395396
    396         if ( (start = str.find( endMK, start + 1 )) == string::npos ) Abort( "end", CommonType );
     397        if ( (start = str.find( ENDMK, start + 1 )) == string::npos ) Abort( "end", CommonType );
    397398        code << str.substr( start );
    398399
     
    404405        resetInput( file, ManglerCommon, buffer, code, str );
    405406
    406         if ( (start = str.find( startMK )) == string::npos ) Abort( "start", ManglerCommon );
    407         start += sizeof( startMK );                                                     // includes newline
     407        if ( (start = str.find( STARTMK )) == string::npos ) Abort( "start", ManglerCommon );
     408        start += sizeof( STARTMK );                                                     // includes newline
    408409        code << str.substr( 0, start );
    409410
     
    432433        code << "\t\t\t";                                                                       // indentation for end marker
    433434
    434         if ( (start = str.find( endMK, start + 1 )) == string::npos ) Abort( "end", ManglerCommon );
     435        if ( (start = str.find( ENDMK, start + 1 )) == string::npos ) Abort( "end", ManglerCommon );
    435436        code << str.substr( start );
    436437
  • src/Makefile.am

    rfba51ab rada4575  
    1111## Created On       : Sun May 31 08:51:46 2015
    1212## Last Modified By : Peter A. Buhr
    13 ## Last Modified On : Sat Feb  9 19:07:14 2019
    14 ## Update Count     : 81
     13## Last Modified On : Fri Feb 15 09:44:09 2019
     14## Update Count     : 97
    1515###############################################################################
    1616
     
    4040include Validate/module.mk
    4141include Virtual/module.mk
     42
     43$(addprefix $(srcdir)/, ResolvExpr/ConversionCost.cc ResolvExpr/CommonType.cc SymTab/ManglerCommon.cc) : $(srcdir)/SynTree/Type.h
     44
     45$(srcdir)/SynTree/Type.h : BasicTypes-gen.cc
     46        ${AM_V_GEN}${CXX} ${AM_CXXFLAGS} ${CXXFLAGS} ${AM_CFLAGS} ${<} -o BasicTypes-gen -Wall -Wextra -O2 -g -std=c++14
     47        @./BasicTypes-gen
     48        @rm BasicTypes-gen
    4249
    4350# put into lib for now
  • src/Makefile.in

    rfba51ab rada4575  
    15571557
    15581558
     1559$(addprefix $(srcdir)/, ResolvExpr/ConversionCost.cc ResolvExpr/CommonType.cc SymTab/ManglerCommon.cc) : $(srcdir)/SynTree/Type.h
     1560
     1561$(srcdir)/SynTree/Type.h : BasicTypes-gen.cc
     1562        ${AM_V_GEN}${CXX} ${AM_CXXFLAGS} ${CXXFLAGS} ${AM_CFLAGS} ${<} -o BasicTypes-gen -Wall -Wextra -O2 -g -std=c++14
     1563        @./BasicTypes-gen
     1564        @rm BasicTypes-gen
     1565
    15591566# Tell versions [3.59,3.63) of GNU make to not export all variables.
    15601567# Otherwise a system limit (for SysV at least) may be exceeded.
  • src/ResolvExpr/CommonType.cc

    rfba51ab rada4575  
    1010// Created On       : Sun May 17 06:59:27 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Feb 13 22:30:32 2019
    13 // Update Count     : 22
     12// Last Modified On : Thu Feb 14 17:10:10 2019
     13// Update Count     : 24
    1414//
    1515
     
    175175                return result;
    176176        }
    177 #if 0
    178         #define BT BasicType::
    179         static const BasicType::Kind combinedType[][ BasicType::NUMBER_OF_BASIC_TYPES ] =
    180         {
    181 /*              Bool            Char    SignedChar      UnsignedChar    ShortSignedInt  ShortUnsignedInt        SignedInt       UnsignedInt     LongSignedInt   LongUnsignedInt LongLongSignedInt       LongLongUnsignedInt     Float   Double  LongDouble      FloatComplex    DoubleComplex   LongDoubleComplex       FloatImaginary  DoubleImaginary LongDoubleImaginary   SignedInt128   UnsignedInt128   Float80   Float128 */
    182                 /* Bool */      { BT Bool,              BT Char,        BT SignedChar,  BT UnsignedChar,        BT ShortSignedInt,      BT ShortUnsignedInt,    BT SignedInt,   BT UnsignedInt, BT LongSignedInt,       BT LongUnsignedInt,     BT LongLongSignedInt,   BT LongLongUnsignedInt, BT Float,       BT Double,      BT LongDouble,  BT FloatComplex,        BT DoubleComplex,       BT LongDoubleComplex,   BT FloatComplex,        BT DoubleComplex,       BT LongDoubleComplex,   BT SignedInt128,        BT UnsignedInt128, BT Float80, BT Float128, BT _Float16, BT _Float32, BT _Float32x, BT _Float64, BT _Float64x, BT _Float128, BT _Float128x, BT _Float16Complex, BT _Float32Complex, BT _Float32xComplex, BT _Float64Complex, BT _Float64xComplex, BT _Float128Complex, BT _Float128xComplex },
    183                 /* Char */      { BT Char,              BT Char,        BT UnsignedChar,        BT UnsignedChar,        BT ShortSignedInt,      BT ShortUnsignedInt,    BT SignedInt,   BT UnsignedInt, BT LongSignedInt,       BT LongUnsignedInt,     BT LongLongSignedInt,   BT LongLongUnsignedInt, BT Float,       BT Double,      BT LongDouble,  BT FloatComplex,        BT DoubleComplex,       BT LongDoubleComplex,   BT FloatComplex,        BT DoubleComplex,       BT LongDoubleComplex,   BT SignedInt128,        BT UnsignedInt128, BT Float80, BT Float128, BT _Float16, BT _Float32, BT _Float32x, BT _Float64, BT _Float64x, BT _Float128, BT _Float128x, BT _Float16Complex, BT _Float32Complex, BT _Float32xComplex, BT _Float64Complex, BT _Float64xComplex, BT _Float128Complex, BT _Float128xComplex },
    184                 /* SignedChar */        { BT SignedChar,        BT UnsignedChar,        BT SignedChar,  BT UnsignedChar,        BT ShortSignedInt,      BT ShortUnsignedInt,    BT SignedInt,   BT UnsignedInt, BT LongSignedInt,       BT LongUnsignedInt,     BT LongLongSignedInt,   BT LongLongUnsignedInt, BT Float,       BT Double,      BT LongDouble,  BT FloatComplex,        BT DoubleComplex,       BT LongDoubleComplex,   BT FloatComplex,        BT DoubleComplex,       BT LongDoubleComplex,   BT SignedInt128,        BT UnsignedInt128, BT Float80, BT Float128, BT _Float16, BT _Float32, BT _Float32x, BT _Float64, BT _Float64x, BT _Float128, BT _Float128x, BT _Float16Complex, BT _Float32Complex, BT _Float32xComplex, BT _Float64Complex, BT _Float64xComplex, BT _Float128Complex, BT _Float128xComplex },
    185                 /* UnsignedChar */      { BT UnsignedChar,      BT UnsignedChar,        BT UnsignedChar,        BT UnsignedChar,        BT ShortSignedInt,      BT ShortUnsignedInt,    BT SignedInt,   BT UnsignedInt, BT LongSignedInt,       BT LongUnsignedInt,     BT LongLongSignedInt,   BT LongLongUnsignedInt, BT Float,       BT Double,      BT LongDouble,  BT FloatComplex,        BT DoubleComplex,       BT LongDoubleComplex,   BT FloatComplex,        BT DoubleComplex,       BT LongDoubleComplex,   BT SignedInt128,        BT UnsignedInt128, BT Float80, BT Float128, BT _Float16, BT _Float32, BT _Float32x, BT _Float64, BT _Float64x, BT _Float128, BT _Float128x, BT _Float16Complex, BT _Float32Complex, BT _Float32xComplex, BT _Float64Complex, BT _Float64xComplex, BT _Float128Complex, BT _Float128xComplex },
    186                 /* ShortSignedInt */    { BT ShortSignedInt,    BT ShortSignedInt,      BT ShortSignedInt,      BT ShortSignedInt,      BT ShortSignedInt,      BT ShortUnsignedInt,    BT SignedInt,   BT UnsignedInt, BT LongSignedInt,       BT LongUnsignedInt,     BT LongLongSignedInt,   BT LongLongUnsignedInt, BT Float,       BT Double,      BT LongDouble,  BT FloatComplex,        BT DoubleComplex,       BT LongDoubleComplex,   BT FloatComplex,        BT DoubleComplex,       BT LongDoubleComplex,   BT SignedInt128,        BT UnsignedInt128, BT Float80, BT Float128, BT _Float16, BT _Float32, BT _Float32x, BT _Float64, BT _Float64x, BT _Float128, BT _Float128x, BT _Float16Complex, BT _Float32Complex, BT _Float32xComplex, BT _Float64Complex, BT _Float64xComplex, BT _Float128Complex, BT _Float128xComplex },
    187                 /* ShortUnsignedInt */  { BT ShortUnsignedInt,  BT ShortUnsignedInt,    BT ShortUnsignedInt,    BT ShortUnsignedInt,    BT ShortUnsignedInt,    BT ShortUnsignedInt,    BT SignedInt,   BT UnsignedInt, BT LongSignedInt,       BT LongUnsignedInt,     BT LongLongSignedInt,   BT LongLongUnsignedInt, BT Float,       BT Double,      BT LongDouble,  BT FloatComplex,        BT DoubleComplex,       BT LongDoubleComplex,   BT FloatComplex,        BT DoubleComplex,       BT LongDoubleComplex,   BT SignedInt128,        BT UnsignedInt128, BT Float80, BT Float128, BT _Float16, BT _Float32, BT _Float32x, BT _Float64, BT _Float64x, BT _Float128, BT _Float128x, BT _Float16Complex, BT _Float32Complex, BT _Float32xComplex, BT _Float64Complex, BT _Float64xComplex, BT _Float128Complex, BT _Float128xComplex },
    188                 /* SignedInt */         { BT SignedInt,         BT SignedInt,   BT SignedInt,   BT SignedInt,   BT SignedInt,   BT SignedInt,   BT SignedInt,   BT UnsignedInt, BT LongSignedInt,       BT LongUnsignedInt,     BT LongLongSignedInt,   BT LongLongUnsignedInt, BT Float,       BT Double,      BT LongDouble,  BT FloatComplex,        BT DoubleComplex,       BT LongDoubleComplex,   BT FloatComplex,        BT DoubleComplex,       BT LongDoubleComplex,   BT SignedInt128,        BT UnsignedInt128, BT Float80, BT Float128, BT _Float16, BT _Float32, BT _Float32x, BT _Float64, BT _Float64x, BT _Float128, BT _Float128x, BT _Float16Complex, BT _Float32Complex, BT _Float32xComplex, BT _Float64Complex, BT _Float64xComplex, BT _Float128Complex, BT _Float128xComplex },
    189                 /* UnsignedInt */       { BT UnsignedInt,               BT UnsignedInt, BT UnsignedInt, BT UnsignedInt, BT UnsignedInt, BT UnsignedInt, BT UnsignedInt, BT UnsignedInt, BT LongUnsignedInt,     BT LongUnsignedInt,     BT LongLongSignedInt,   BT LongLongUnsignedInt, BT Float,       BT Double,      BT LongDouble,  BT FloatComplex,        BT DoubleComplex,       BT LongDoubleComplex,   BT FloatComplex,        BT DoubleComplex,       BT LongDoubleComplex,   BT SignedInt128,        BT UnsignedInt128, BT Float80, BT Float128, BT _Float16, BT _Float32, BT _Float32x, BT _Float64, BT _Float64x, BT _Float128, BT _Float128x, BT _Float16Complex, BT _Float32Complex, BT _Float32xComplex, BT _Float64Complex, BT _Float64xComplex, BT _Float128Complex, BT _Float128xComplex },
    190                 /* LongSignedInt */     { BT LongSignedInt,             BT LongSignedInt,       BT LongSignedInt,       BT LongSignedInt,       BT LongSignedInt,       BT LongSignedInt,       BT LongSignedInt,       BT LongUnsignedInt,     BT LongSignedInt,       BT LongUnsignedInt,     BT LongLongSignedInt,   BT LongLongUnsignedInt, BT Float,       BT Double,      BT LongDouble,  BT FloatComplex,        BT DoubleComplex,       BT LongDoubleComplex,   BT FloatComplex,        BT DoubleComplex,       BT LongDoubleComplex,   BT SignedInt128,        BT UnsignedInt128, BT Float80, BT Float128, BT _Float16, BT _Float32, BT _Float32x, BT _Float64, BT _Float64x, BT _Float128, BT _Float128x, BT _Float16Complex, BT _Float32Complex, BT _Float32xComplex, BT _Float64Complex, BT _Float64xComplex, BT _Float128Complex, BT _Float128xComplex },
    191                 /* LongUnsignedInt */   { BT LongUnsignedInt,   BT LongUnsignedInt,     BT LongUnsignedInt,     BT LongUnsignedInt,     BT LongUnsignedInt,     BT LongUnsignedInt,     BT LongUnsignedInt,     BT LongUnsignedInt,     BT LongUnsignedInt,     BT LongUnsignedInt,     BT LongLongSignedInt,   BT LongLongUnsignedInt, BT Float,       BT Double,      BT LongDouble,  BT FloatComplex,        BT DoubleComplex,       BT LongDoubleComplex,   BT FloatComplex,        BT DoubleComplex,       BT LongDoubleComplex,   BT SignedInt128,        BT UnsignedInt128, BT Float80, BT Float128, BT _Float16, BT _Float32, BT _Float32x, BT _Float64, BT _Float64x, BT _Float128, BT _Float128x, BT _Float16Complex, BT _Float32Complex, BT _Float32xComplex, BT _Float64Complex, BT _Float64xComplex, BT _Float128Complex, BT _Float128xComplex },
    192                 /* LongLongSignedInt */         { BT LongLongSignedInt, BT LongLongSignedInt,   BT LongLongSignedInt,   BT LongLongSignedInt,   BT LongLongSignedInt,   BT LongLongSignedInt,   BT LongLongSignedInt,   BT LongLongSignedInt,   BT LongLongSignedInt,   BT LongLongSignedInt,   BT LongLongSignedInt,   BT LongLongUnsignedInt, BT Float,       BT Double,      BT LongDouble,  BT FloatComplex,        BT DoubleComplex,       BT LongDoubleComplex,   BT FloatComplex,        BT DoubleComplex,       BT LongDoubleComplex,   BT SignedInt128,        BT UnsignedInt128, BT Float80, BT Float128, BT _Float16, BT _Float32, BT _Float32x, BT _Float64, BT _Float64x, BT _Float128, BT _Float128x, BT _Float16Complex, BT _Float32Complex, BT _Float32xComplex, BT _Float64Complex, BT _Float64xComplex, BT _Float128Complex, BT _Float128xComplex },
    193                 /* LongLongUnsignedInt */       { BT LongLongUnsignedInt,       BT LongLongUnsignedInt, BT LongLongUnsignedInt, BT LongLongUnsignedInt, BT LongLongUnsignedInt, BT LongLongUnsignedInt, BT LongLongUnsignedInt, BT LongLongUnsignedInt, BT LongLongUnsignedInt, BT LongLongUnsignedInt, BT LongLongUnsignedInt, BT LongLongUnsignedInt, BT Float,       BT Double,      BT LongDouble,  BT FloatComplex,        BT DoubleComplex,       BT LongDoubleComplex,   BT FloatComplex,        BT DoubleComplex,       BT LongDoubleComplex,   BT SignedInt128,        BT UnsignedInt128, BT Float80, BT Float128, BT _Float16, BT _Float32, BT _Float32x, BT _Float64, BT _Float64x, BT _Float128, BT _Float128x, BT _Float16Complex, BT _Float32Complex, BT _Float32xComplex, BT _Float64Complex, BT _Float64xComplex, BT _Float128Complex, BT _Float128xComplex },
    194 
    195                 /* Float */     { BT Float,     BT Float,       BT Float,       BT Float,       BT Float,       BT Float,       BT Float,       BT Float,       BT Float,       BT Float,       BT Float,       BT Float,       BT Float,       BT Double,      BT LongDouble,  BT FloatComplex,        BT DoubleComplex,       BT LongDoubleComplex,   BT FloatComplex,        BT DoubleComplex,       BT LongDoubleComplex,   BT Float,       BT Float, BT Float80, BT Float128, BT Float, BT Float, BT _Float32x, BT _Float64, BT _Float64x, BT _Float128, BT _Float128x, BT FloatComplex, BT FloatComplex, BT _Float32xComplex, BT _Float64Complex, BT _Float64xComplex, BT _Float128Complex, BT _Float128xComplex },
    196                 /* Double */    { BT Double,    BT Double,      BT Double,      BT Double,      BT Double,      BT Double,      BT Double,      BT Double,      BT Double,      BT Double,      BT Double,      BT Double,      BT Double,      BT Double,      BT LongDouble,  BT DoubleComplex,       BT DoubleComplex,       BT LongDoubleComplex,   BT DoubleComplex,       BT DoubleComplex,       BT LongDoubleComplex,   BT Double,      BT Double, BT Float80, BT Float128, BT Double, BT Double, BT Double, BT _Float64, BT _Float64x, BT _Float128, BT _Float128x, BT DoubleComplex, BT DoubleComplex, BT DoubleComplex, BT DoubleComplex, BT _Float64xComplex, BT _Float128Complex, BT _Float128xComplex },
    197                 /* LongDouble */        { BT LongDouble,                BT LongDouble,  BT LongDouble,  BT LongDouble,  BT LongDouble,  BT LongDouble,  BT LongDouble,  BT LongDouble,  BT LongDouble,  BT LongDouble,  BT LongDouble,  BT LongDouble,  BT LongDouble,  BT LongDouble,  BT LongDouble,  BT LongDoubleComplex,   BT LongDoubleComplex,   BT LongDoubleComplex,   BT LongDoubleComplex,   BT LongDoubleComplex,   BT LongDoubleComplex,   BT LongDouble,  BT LongDouble, BT BT LongDouble, BT Float128, BT LongDouble, BT LongDouble, BT LongDouble, BT LongDouble, BT LongDouble, BT LongDouble, BT _Float128x, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT _Float128xComplex },
    198                 /* FloatComplex */      { BT FloatComplex,      BT FloatComplex,        BT FloatComplex,        BT FloatComplex,        BT FloatComplex,        BT FloatComplex,        BT FloatComplex,        BT FloatComplex,        BT FloatComplex,        BT FloatComplex,        BT FloatComplex,        BT FloatComplex,        BT FloatComplex,        BT DoubleComplex,       BT LongDoubleComplex,   BT FloatComplex,        BT DoubleComplex,       BT LongDoubleComplex,   BT FloatComplex,        BT DoubleComplex,       BT LongDoubleComplex,   BT FloatComplex,        BT FloatComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT FloatComplex, BT FloatComplex, BT _Float32xComplex, BT _Float64Complex, BT _Float64xComplex, BT _Float128Complex, BT _Float128xComplex, BT FloatComplex, BT FloatComplex, BT _Float32xComplex, BT _Float64Complex, BT _Float64xComplex, BT _Float128Complex, BT _Float128xComplex },
    199                 /* DoubleComplex */     { BT DoubleComplex,     BT DoubleComplex,       BT DoubleComplex,       BT DoubleComplex,       BT DoubleComplex,       BT DoubleComplex,       BT DoubleComplex,       BT DoubleComplex,       BT DoubleComplex,       BT DoubleComplex,       BT DoubleComplex,       BT DoubleComplex,       BT DoubleComplex,       BT DoubleComplex,       BT LongDoubleComplex,   BT DoubleComplex,       BT DoubleComplex,       BT LongDoubleComplex,   BT DoubleComplex,       BT DoubleComplex,       BT LongDoubleComplex,   BT DoubleComplex,       BT DoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT DoubleComplex, BT DoubleComplex, BT DoubleComplex, BT _Float64Complex, BT _Float64xComplex, BT _Float128Complex, BT _Float128xComplex, BT DoubleComplex, BT DoubleComplex, BT DoubleComplex, BT DoubleComplex, BT _Float64xComplex, BT _Float128Complex, BT _Float128xComplex },
    200                 /* LongDoubleComplex */         { BT LongDoubleComplex, BT LongDoubleComplex,   BT LongDoubleComplex,   BT LongDoubleComplex,   BT LongDoubleComplex,   BT LongDoubleComplex,   BT LongDoubleComplex,   BT LongDoubleComplex,   BT LongDoubleComplex,   BT LongDoubleComplex,   BT LongDoubleComplex,   BT LongDoubleComplex,   BT LongDoubleComplex,   BT LongDoubleComplex,   BT LongDoubleComplex,   BT LongDoubleComplex,   BT LongDoubleComplex,   BT LongDoubleComplex,   BT LongDoubleComplex,   BT LongDoubleComplex,   BT LongDoubleComplex,   BT LongDoubleComplex,   BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT _Float128xComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT _Float128xComplex },
    201                 /* FloatImaginary */    { BT FloatComplex,      BT FloatComplex,        BT FloatComplex,        BT FloatComplex,        BT FloatComplex,        BT FloatComplex,        BT FloatComplex,        BT FloatComplex,        BT FloatComplex,        BT FloatComplex,        BT FloatComplex,        BT FloatComplex,        BT FloatComplex,        BT DoubleComplex,       BT LongDoubleComplex,   BT FloatComplex,        BT DoubleComplex,       BT LongDoubleComplex,   BT FloatImaginary,      BT DoubleImaginary,     BT LongDoubleImaginary, BT FloatImaginary,      BT FloatImaginary, BT LongDoubleImaginary, BT LongDoubleImaginary, BT FloatComplex, BT FloatComplex, BT _Float32xComplex, BT _Float64Complex, BT _Float64xComplex, BT _Float128Complex, BT _Float128xComplex, BT FloatComplex, BT FloatComplex, BT _Float32xComplex, BT _Float64Complex, BT _Float64xComplex, BT _Float128Complex, BT _Float128xComplex },
    202                 /* DoubleImaginary */   { BT DoubleComplex,     BT DoubleComplex,       BT DoubleComplex,       BT DoubleComplex,       BT DoubleComplex,       BT DoubleComplex,       BT DoubleComplex,       BT DoubleComplex,       BT DoubleComplex,       BT DoubleComplex,       BT DoubleComplex,       BT DoubleComplex,       BT DoubleComplex,       BT DoubleComplex,       BT LongDoubleComplex,   BT DoubleComplex,       BT DoubleComplex,       BT LongDoubleComplex,   BT DoubleImaginary,     BT DoubleImaginary,     BT LongDoubleImaginary, BT DoubleImaginary,     BT DoubleImaginary, BT LongDoubleImaginary, BT LongDoubleImaginary, BT DoubleComplex, BT DoubleComplex, BT DoubleComplex, BT _Float64Complex, BT _Float64xComplex, BT _Float128Complex, BT _Float128xComplex, BT DoubleComplex, BT DoubleComplex, BT DoubleComplex, BT DoubleComplex, BT _Float64xComplex, BT _Float128Complex, BT _Float128xComplex },
    203                 /* LongDoubleImaginary */       { BT LongDoubleComplex, BT LongDoubleComplex,   BT LongDoubleComplex,   BT LongDoubleComplex,   BT LongDoubleComplex,   BT LongDoubleComplex,   BT LongDoubleComplex,   BT LongDoubleComplex,   BT LongDoubleComplex,   BT LongDoubleComplex,   BT LongDoubleComplex,   BT LongDoubleComplex,   BT LongDoubleComplex,   BT LongDoubleComplex,   BT LongDoubleComplex,   BT LongDoubleComplex,   BT LongDoubleComplex,   BT LongDoubleComplex,   BT LongDoubleImaginary, BT LongDoubleImaginary, BT LongDoubleImaginary, BT LongDoubleImaginary, BT LongDoubleImaginary, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT _Float128xComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT _Float128xComplex },
    204 
    205                 /* SignedInt128 */      { BT SignedInt128,      BT SignedInt128,        BT SignedInt128,        BT SignedInt128,        BT SignedInt128,        BT SignedInt128,        BT SignedInt128,        BT SignedInt128,        BT SignedInt128,        BT SignedInt128,        BT SignedInt128,        BT SignedInt128,        BT Float,       BT Double,      BT LongDouble,  BT FloatComplex,        BT DoubleComplex,       BT LongDoubleComplex,   BT FloatComplex,        BT DoubleComplex,       BT LongDoubleComplex,   BT SignedInt128,        BT UnsignedInt128, BT Float80, BT Float128, BT _Float16, BT _Float32, BT _Float32x, BT _Float64, BT _Float64x, BT _Float128, BT _Float128x, BT _Float16Complex, BT _Float32Complex, BT _Float32xComplex, BT _Float64Complex, BT _Float64xComplex, BT _Float128Complex, BT _Float128xComplex },
    206                 /* UnsignedInt128 */    { BT UnsignedInt128,    BT UnsignedInt128,      BT UnsignedInt128,      BT UnsignedInt128,      BT UnsignedInt128,      BT UnsignedInt128,      BT UnsignedInt128,      BT UnsignedInt128,      BT UnsignedInt128,      BT UnsignedInt128,      BT UnsignedInt128,      BT UnsignedInt128,      BT Float,       BT Double,      BT LongDouble,  BT FloatComplex,        BT DoubleComplex,       BT LongDoubleComplex,   BT FloatComplex,        BT DoubleComplex,       BT LongDoubleComplex,   BT UnsignedInt128,      BT UnsignedInt128, BT Float80, BT Float128, BT _Float16, BT _Float32, BT _Float32x, BT _Float64, BT _Float64x, BT _Float128, BT _Float128x, BT _Float16Complex, BT _Float32Complex, BT _Float32xComplex, BT _Float64Complex, BT _Float64xComplex, BT _Float128Complex, BT _Float128xComplex },
    207                 /* Float80 */   { BT Float80,   BT Float80,     BT Float80,     BT Float80,     BT Float80,     BT Float80,     BT Float80,     BT Float80,     BT Float80,     BT Float80,     BT Float80,     BT Float80,     BT Float80,     BT Float80,     BT LongDouble,  BT LongDoubleComplex,   BT LongDoubleComplex,   BT LongDoubleComplex,   BT LongDoubleComplex,   BT LongDoubleComplex,   BT LongDoubleComplex,   BT Float80,     BT Float80, BT Float80, BT Float128, BT Float80, BT Float80, BT Float80, BT Float80, BT Float80, BT _Float128, BT _Float128x, BT _Float64xComplex, BT _Float64xComplex, BT _Float64xComplex, BT _Float64xComplex, BT _Float64xComplex, BT _Float128Complex, BT _Float128xComplex },
    208                 /* Float128 */  { BT Float128,  BT Float128,    BT Float128,    BT Float128,    BT Float128,    BT Float128,    BT Float128,    BT Float128,    BT Float128,    BT Float128,    BT Float128,    BT Float128,    BT Float128,    BT Float128,    BT Float128,    BT LongDoubleComplex,   BT LongDoubleComplex,   BT LongDoubleComplex,   BT LongDoubleComplex,   BT LongDoubleComplex,   BT LongDoubleComplex,   BT Float128,    BT Float128, BT Float128, BT Float128, BT Float128, BT Float128, BT Float128, BT Float128, BT Float128, BT Float128, BT _Float128x, BT _Float128Complex, BT _Float128Complex, BT _Float128Complex, BT _Float128Complex, BT _Float128Complex, BT _Float128Complex, BT _Float128xComplex },
    209 
    210                 /* _Float16 */  { BT _Float16,  BT _Float16,    BT _Float16,    BT _Float16,    BT _Float16,    BT _Float16,    BT _Float16,    BT _Float16,    BT _Float16,    BT _Float16,    BT _Float16,    BT _Float16,    BT Float,       BT Double,      BT LongDouble,  BT FloatComplex,        BT DoubleComplex,       BT LongDoubleComplex,   BT FloatComplex,        BT DoubleComplex,       BT LongDoubleComplex,   BT _Float16,    BT _Float16, BT Float80, BT Float128, BT _Float16, BT _Float32, BT _Float32x, BT _Float64, BT _Float64x, BT _Float128, BT _Float128x, BT _Float16Complex, BT _Float32Complex, BT _Float32xComplex, BT _Float64Complex, BT _Float64xComplex, BT _Float128Complex, BT _Float128xComplex },
    211                 /* _Float32 */  { BT _Float32,  BT _Float32,    BT _Float32,    BT _Float32,    BT _Float32,    BT _Float32,    BT _Float32,    BT _Float32,    BT _Float32,    BT _Float32,    BT _Float32,    BT _Float32,    BT _Float32,    BT Double,      BT LongDouble,  BT FloatComplex,        BT DoubleComplex,       BT LongDoubleComplex,   BT FloatComplex,        BT DoubleComplex,       BT LongDoubleComplex,   BT _Float32,    BT _Float32, BT Float80, BT Float128, BT _Float32, BT _Float32, BT _Float32x, BT _Float64, BT _Float64x, BT _Float128, BT _Float128x, BT _Float32Complex, BT _Float32Complex, BT _Float32xComplex, BT _Float64Complex, BT _Float64xComplex, BT _Float128Complex, BT _Float128xComplex },
    212                 /* _Float32x */ { BT _Float32x, BT _Float32x,   BT _Float32x,   BT _Float32x,   BT _Float32x,   BT _Float32x,   BT _Float32x,   BT _Float32x,   BT _Float32x,   BT _Float32x,   BT _Float32x,   BT _Float32x,   BT _Float32x,   BT Double,      BT LongDouble,  BT _Float32xComplex,    BT DoubleComplex,       BT LongDoubleComplex,   BT _Float32xComplex,    BT DoubleComplex,       BT LongDoubleComplex,   BT _Float32x,   BT _Float32x, BT Float80, BT Float128, BT _Float32x, BT _Float32x, BT _Float32x, BT _Float64, BT _Float64x, BT _Float128, BT _Float128x, BT _Float32xComplex, BT _Float32xComplex, BT _Float32xComplex, BT _Float64Complex, BT _Float64xComplex, BT _Float128Complex, BT _Float128xComplex },
    213                 /* _Float64 */  { BT _Float64,  BT _Float64,    BT _Float64,    BT _Float64,    BT _Float64,    BT _Float64,    BT _Float64,    BT _Float64,    BT _Float64,    BT _Float64,    BT _Float64,    BT _Float64,    BT _Float64,    BT Double,      BT LongDouble,  BT _Float64Complex,     BT DoubleComplex,       BT LongDoubleComplex,   BT _Float64Complex,     BT DoubleComplex,       BT LongDoubleComplex,   BT _Float64,    BT _Float64, BT Float80, BT Float128, BT _Float64, BT _Float64, BT _Float64, BT _Float64, BT _Float64x, BT _Float128, BT _Float128x, BT _Float64Complex, BT _Float64Complex, BT _Float64Complex, BT _Float64Complex, BT _Float64xComplex, BT _Float128Complex, BT _Float128xComplex },
    214                 /* _Float64x */         { BT _Float64x, BT _Float64x,   BT _Float64x,   BT _Float64x,   BT _Float64x,   BT _Float64x,   BT _Float64x,   BT _Float64x,   BT _Float64x,   BT _Float64x,   BT _Float64x,   BT _Float64x,   BT _Float64x,   BT _Float64x,   BT LongDouble,  BT _Float64xComplex,    BT _Float64xComplex,    BT LongDoubleComplex,   BT _Float64xComplex,    BT _Float64xComplex,    BT LongDoubleComplex,   BT _Float64x,   BT _Float64x, BT Float80, BT Float128, BT _Float64x, BT _Float64x, BT _Float64x, BT _Float64x, BT _Float64x, BT _Float128, BT _Float128x, BT _Float64xComplex, BT _Float64xComplex, BT _Float64xComplex, BT _Float64xComplex, BT _Float64xComplex, BT _Float128Complex, BT _Float128xComplex },
    215                 /* _Float128 */         { BT _Float128, BT _Float128,   BT _Float128,   BT _Float128,   BT _Float128,   BT _Float128,   BT _Float128,   BT _Float128,   BT _Float128,   BT _Float128,   BT _Float128,   BT _Float128,   BT _Float128,   BT _Float128,   BT LongDouble,  BT _Float128Complex,    BT _Float128Complex,    BT LongDoubleComplex,   BT _Float128Complex,    BT _Float128Complex,    BT LongDoubleComplex,   BT _Float128,   BT _Float128, BT _Float128, BT Float128, BT _Float128, BT _Float128, BT _Float128, BT _Float128, BT _Float128, BT _Float128, BT _Float128x, BT _Float128Complex, BT _Float128Complex, BT _Float128Complex, BT _Float128Complex, BT _Float128Complex, BT _Float128Complex, BT _Float128xComplex },
    216                 /* _Float128x */        { BT _Float128x,        BT _Float128x,  BT _Float128x,  BT _Float128x,  BT _Float128x,  BT _Float128x,  BT _Float128x,  BT _Float128x,  BT _Float128x,  BT _Float128x,  BT _Float128x,  BT _Float128x,  BT _Float128x,  BT _Float128x,  BT _Float128x,  BT _Float128xComplex,   BT _Float128xComplex,   BT _Float128xComplex,   BT _Float128xComplex,   BT _Float128xComplex,   BT _Float128xComplex,   BT _Float128x,  BT _Float128x, BT _Float128x, BT _Float128x, BT _Float128x, BT _Float128x, BT _Float128x, BT _Float128x, BT _Float128x, BT _Float128x, BT _Float128x, BT _Float128xComplex, BT _Float128xComplex, BT _Float128xComplex, BT _Float128xComplex, BT _Float128xComplex, BT _Float128xComplex, BT _Float128xComplex },
    217 
    218                 /* _Float16Complex */   { BT _Float16Complex,   BT _Float16Complex,     BT _Float16Complex,     BT _Float16Complex,     BT _Float16Complex,     BT _Float16Complex,     BT _Float16Complex,     BT _Float16Complex,     BT _Float16Complex,     BT _Float16Complex,     BT _Float16Complex,     BT _Float16Complex,     BT FloatComplex,        BT DoubleComplex,       BT LongDoubleComplex,   BT FloatComplex,        BT DoubleComplex,       BT LongDoubleComplex,   BT FloatComplex,        BT DoubleComplex,       BT LongDoubleComplex,   BT _Float16Complex,     BT _Float16Complex, BT _Float64xComplex, BT _Float128Complex, BT _Float16Complex, BT _Float32Complex, BT _Float32xComplex, BT _Float64Complex, BT _Float64xComplex, BT _Float128Complex, BT _Float128xComplex, BT _Float16Complex, BT _Float32Complex, BT _Float32xComplex, BT _Float64Complex, BT _Float64xComplex, BT _Float128Complex, BT _Float128xComplex },
    219                 /* _Float32Complex */   { BT _Float32Complex,   BT _Float32Complex,     BT _Float32Complex,     BT _Float32Complex,     BT _Float32Complex,     BT _Float32Complex,     BT _Float32Complex,     BT _Float32Complex,     BT _Float32Complex,     BT _Float32Complex,     BT _Float32Complex,     BT _Float32Complex,     BT _Float32Complex,     BT DoubleComplex,       BT LongDoubleComplex,   BT FloatComplex,        BT DoubleComplex,       BT LongDoubleComplex,   BT FloatComplex,        BT DoubleComplex,       BT LongDoubleComplex,   BT _Float32Complex,     BT _Float32Complex, BT _Float64xComplex, BT _Float128Complex, BT _Float32Complex, BT _Float32Complex, BT _Float32xComplex, BT _Float64Complex, BT _Float64xComplex, BT _Float128Complex, BT _Float128xComplex, BT _Float32Complex, BT _Float32Complex, BT _Float32xComplex, BT _Float64Complex, BT _Float64xComplex, BT _Float128Complex, BT _Float128xComplex },
    220                 /* _Float32xComplex */ { BT _Float32xComplex,   BT _Float32xComplex,    BT _Float32xComplex,    BT _Float32xComplex,    BT _Float32xComplex,    BT _Float32xComplex,    BT _Float32xComplex,    BT _Float32xComplex,    BT _Float32xComplex,    BT _Float32xComplex,    BT _Float32xComplex,    BT _Float32xComplex,    BT _Float32xComplex,    BT DoubleComplex,       BT LongDoubleComplex,   BT _Float32xComplex,    BT DoubleComplex,       BT LongDoubleComplex,   BT _Float32xComplex,    BT DoubleComplex,       BT LongDoubleComplex,   BT _Float32xComplex,    BT _Float32xComplex, BT _Float64xComplex, BT _Float128Complex, BT _Float32xComplex, BT _Float32xComplex, BT _Float32xComplex, BT _Float64Complex, BT _Float64xComplex, BT _Float128Complex, BT _Float128xComplex, BT _Float32xComplex, BT _Float32xComplex, BT _Float32xComplex, BT _Float64Complex, BT _Float64xComplex, BT _Float128Complex, BT _Float128xComplex },
    221                 /* _Float64Complex */   { BT _Float64Complex,   BT _Float64Complex,     BT _Float64Complex,     BT _Float64Complex,     BT _Float64Complex,     BT _Float64Complex,     BT _Float64Complex,     BT _Float64Complex,     BT _Float64Complex,     BT _Float64Complex,     BT _Float64Complex,     BT _Float64Complex,     BT _Float64Complex,     BT DoubleComplex,       BT LongDoubleComplex,   BT _Float64Complex,     BT DoubleComplex,       BT LongDoubleComplex,   BT _Float64Complex,     BT DoubleComplex,       BT LongDoubleComplex,   BT _Float64Complex,     BT _Float64Complex, BT _Float64xComplex, BT _Float128Complex, BT _Float64Complex, BT _Float64Complex, BT _Float64Complex, BT _Float64Complex, BT _Float64xComplex, BT _Float128Complex, BT _Float128xComplex, BT _Float64Complex, BT _Float64Complex, BT _Float64Complex, BT _Float64Complex, BT _Float64xComplex, BT _Float128Complex, BT _Float128xComplex },
    222                 /* _Float64xComplex */  { BT _Float64xComplex,  BT _Float64xComplex,    BT _Float64xComplex,    BT _Float64xComplex,    BT _Float64xComplex,    BT _Float64xComplex,    BT _Float64xComplex,    BT _Float64xComplex,    BT _Float64xComplex,    BT _Float64xComplex,    BT _Float64xComplex,    BT _Float64xComplex,    BT _Float64xComplex,    BT _Float64xComplex,    BT LongDoubleComplex,   BT _Float64xComplex,    BT _Float64xComplex,    BT LongDoubleComplex,   BT _Float64xComplex,    BT _Float64xComplex,    BT LongDoubleComplex,   BT _Float64xComplex,    BT _Float64xComplex, BT _Float64xComplex, BT _Float128Complex, BT _Float64xComplex, BT _Float64xComplex, BT _Float64xComplex, BT _Float64xComplex, BT _Float64xComplex, BT _Float128Complex, BT _Float128xComplex, BT _Float64xComplex, BT _Float64xComplex, BT _Float64xComplex, BT _Float64xComplex, BT _Float64xComplex, BT _Float128Complex, BT _Float128xComplex },
    223                 /* _Float128Complex */  { BT _Float128Complex,  BT _Float128Complex,    BT _Float128Complex,    BT _Float128Complex,    BT _Float128Complex,    BT _Float128Complex,    BT _Float128Complex,    BT _Float128Complex,    BT _Float128Complex,    BT _Float128Complex,    BT _Float128Complex,    BT _Float128Complex,    BT _Float128Complex,    BT _Float128Complex,    BT LongDoubleComplex,   BT _Float128Complex,    BT _Float128Complex,    BT LongDoubleComplex,   BT _Float128Complex,    BT _Float128Complex,    BT LongDoubleComplex,   BT _Float128Complex,    BT _Float128Complex, BT _Float128Complex, BT _Float128Complex, BT _Float128Complex, BT _Float128Complex, BT _Float128Complex, BT _Float128Complex, BT _Float128Complex, BT _Float128Complex, BT _Float128xComplex, BT _Float128Complex, BT _Float128Complex, BT _Float128Complex, BT _Float128Complex, BT _Float128Complex, BT _Float128Complex, BT _Float128xComplex },
    224                 /* _Float128xComplex */         { BT _Float128xComplex, BT _Float128xComplex,   BT _Float128xComplex,   BT _Float128xComplex,   BT _Float128xComplex,   BT _Float128xComplex,   BT _Float128xComplex,   BT _Float128xComplex,   BT _Float128xComplex,   BT _Float128xComplex,   BT _Float128xComplex,   BT _Float128xComplex,   BT _Float128xComplex,   BT _Float128xComplex,   BT _Float128xComplex,   BT _Float128xComplex,   BT _Float128xComplex,   BT _Float128xComplex,   BT _Float128xComplex,   BT _Float128xComplex,   BT _Float128xComplex,   BT _Float128xComplex,   BT _Float128xComplex, BT _Float128xComplex, BT _Float128xComplex, BT _Float128xComplex, BT _Float128xComplex, BT _Float128xComplex, BT _Float128xComplex, BT _Float128xComplex, BT _Float128xComplex, BT _Float128xComplex, BT _Float128xComplex, BT _Float128xComplex, BT _Float128xComplex, BT _Float128xComplex, BT _Float128xComplex, BT _Float128xComplex, BT _Float128xComplex },
    225         };
    226         #undef BT
    227 #endif
    228177
    229178        // GENERATED START, DO NOT EDIT
     179        // GENERATED BY BasicTypes-gen.cc
    230180        #define BT BasicType::
    231181        static const BasicType::Kind commonTypes[BasicType::NUMBER_OF_BASIC_TYPES][BasicType::NUMBER_OF_BASIC_TYPES] = { // nearest common ancestor
     
    492442        #undef BT
    493443        // GENERATED END
    494 
    495444        static_assert(
    496445                sizeof(commonTypes)/sizeof(commonTypes[0][0]) == BasicType::NUMBER_OF_BASIC_TYPES*BasicType::NUMBER_OF_BASIC_TYPES,
  • src/ResolvExpr/ConversionCost.cc

    rfba51ab rada4575  
    1010// Created On       : Sun May 17 07:06:19 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Feb 13 23:04:51 2019
    13 // Update Count     : 22
     12// Last Modified On : Thu Feb 14 17:04:31 2019
     13// Update Count     : 23
    1414//
    1515
     
    4343#define PRINT(x)
    4444#endif
     45
    4546        Cost conversionCost( Type *src, Type *dest, const SymTab::Indexer &indexer, const TypeEnvironment &env ) {
    4647                if ( TypeInstType *destAsTypeInst = dynamic_cast< TypeInstType* >( dest ) ) {
     
    179180                : dest( dest ), indexer( indexer ), cost( Cost::infinity ), env( env ), costFunc( costFunc ) {
    180181        }
    181 #if 0
    182 /*
    183             Old
    184             ===
    185            Double
    186              |
    187            Float
    188              |
    189            ULong
    190            /   \
    191         UInt    Long
    192            \   /
    193             Int
    194              |
    195            Ushort
    196              |
    197            Short
    198              |
    199            Uchar
    200            /   \
    201         Schar   Char
    202 
    203                                 New
    204                                 ===
    205                        +-----LongDoubleComplex--+
    206            LongDouble--+          |             +-LongDoubleImag
    207              |         +---DoubleComplex---+         |
    208            Double------+        |          +----DoubleImag
    209              |           +-FloatComplex-+            |
    210            Float---------+              +-------FloatImag
    211              |
    212           ULongLong
    213              |
    214           LongLong
    215              |
    216            ULong
    217            /   \
    218         UInt    Long
    219            \   /
    220             Int
    221              |
    222            Ushort
    223              |
    224            Short
    225              |
    226            Uchar
    227            /   \
    228         Schar   Char
    229            \   /
    230             Bool
    231 */
    232 
    233         static const int costMatrix[][ BasicType::NUMBER_OF_BASIC_TYPES ] = {
    234         /* Src \ Dest:  Bool    Char    SChar   UChar   Short   UShort  Int     UInt    Long    ULong   LLong   ULLong  Float   Double  LDbl    FCplex  DCplex  LDCplex FImag   DImag   LDImag  I128,   U128, F80, F128 */
    235                 /* Bool */      { 0,    1,              1,              2,              3,              4,              5,              6,              6,              7,              8,              9,              12,             13,             14,             12,             13,             14,             -1,             -1,             -1,             10,             11,       14,   15},
    236                 /* Char */      { -1,   0,              -1,             1,              2,              3,              4,              5,              5,              6,              7,              8,              11,             12,             13,             11,             12,             13,             -1,             -1,             -1,             9,              10,       13,   14},
    237                 /* SChar */ { -1,       -1,             0,              1,              2,              3,              4,              5,              5,              6,              7,              8,              11,             12,             13,             11,             12,             13,             -1,             -1,             -1,             9,              10,       13,   14},
    238                 /* UChar */ { -1,       -1,             -1,             0,              1,              2,              3,              4,              4,              5,              6,              7,              10,             11,             12,             10,             11,             12,             -1,             -1,             -1,             8,              9,        12,   13},
    239                 /* Short */ { -1,       -1,             -1,             -1,             0,              1,              2,              3,              3,              4,              5,              6,              9,              10,             11,             9,              10,             11,             -1,             -1,             -1,             7,              8,        11,   12},
    240                 /* UShort */{ -1,       -1,             -1,             -1,             -1,             0,              1,              2,              2,              3,              4,              5,              8,              9,              10,             8,              9,              10,             -1,             -1,             -1,             6,              7,        10,   11},
    241                 /* Int */       { -1,   -1,             -1,             -1,             -1,             -1,             0,              1,              1,              2,              3,              4,              7,              8,              9,              7,              8,              9,              -1,             -1,             -1,             5,              6,        9,    10},
    242                 /* UInt */      { -1,   -1,             -1,             -1,             -1,             -1,             -1,             0,              -1,             1,              2,              3,              6,              7,              8,              6,              7,              8,              -1,             -1,             -1,             4,              5,        8,    9},
    243                 /* Long */      { -1,   -1,             -1,             -1,             -1,             -1,             -1,             -1,             0,              1,              2,              3,              6,              7,              8,              6,              7,              8,              -1,             -1,             -1,             4,              5,        8,    9},
    244                 /* ULong */ { -1,       -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             0,              1,              2,              5,              6,              7,              5,              6,              7,              -1,             -1,             -1,             3,              4,        7,    8},
    245                 /* LLong */ { -1,       -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             0,              1,              4,              5,              6,              4,              5,              6,              -1,             -1,             -1,             2,              3,        6,    7},
    246                 /* ULLong */{ -1,       -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             0,              3,              4,              5,              3,              4,              5,              -1,             -1,             -1,             1,              2,        5,    6},
    247 
    248                 /* Float */ { -1,       -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             0,              1,              2,              1,              2,              3,              -1,             -1,             -1,             -1,             -1,       2,    3},
    249                 /* Double */{ -1,       -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             0,              1,              -1,             1,              2,              -1,             -1,             -1,             -1,             -1,       1,    2},
    250                 /* LDbl */      { -1,   -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             0,              -1,             -1,             1,              -1,             -1,             -1,             -1,             -1,       -1,   1},
    251                 /* FCplex */{ -1,       -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             0,              1,              2,              -1,             -1,             -1,             -1,             -1,       -1,   -1},
    252                 /* DCplex */{ -1,       -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             0,              1,              -1,             -1,             -1,             -1,             -1,       -1,   -1},
    253                 /* LDCplex */{ -1,      -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             0,              -1,             -1,             -1,             -1,             -1,       -1,   -1},
    254                 /* FImag */ { -1,       -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             1,              2,              3,              0,              1,              2,              -1,             -1,       -1,   -1},
    255                 /* DImag */ { -1,       -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             1,              2,              -1,             0,              1,              -1,             -1,       -1,   -1},
    256                 /* LDImag */{ -1,       -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             1,              -1,             -1,             0,              -1,             -1,       -1,   -1},
    257 
    258                 /* I128 */  { -1,       -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             2,              3,              4,              3,              4,              5,              -1,             -1,             -1,             0,              1,        4,    4},
    259                 /* U128 */  { -1,       -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             1,              2,              3,              2,              3,              4,              -1,             -1,             -1,             -1,             0,        3,    3},
    260 
    261                 /* F80 */       { -1,   -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             1,              -1,             -1,             1,              -1,             -1,             -1,             -1,             -1,       0,    1},
    262                 /* F128 */      { -1,   -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             1,              -1,             -1,             -1,             -1,             -1,       -1,   0},
    263         };
    264         static_assert(
    265                 sizeof(costMatrix)/sizeof(costMatrix[0][0]) == BasicType::NUMBER_OF_BASIC_TYPES*BasicType::NUMBER_OF_BASIC_TYPES,
    266                 "Each basic type kind should have a corresponding row in the cost matrix"
    267         );
    268 #endif
    269182
    270183        // GENERATED START, DO NOT EDIT
     184        // GENERATED BY BasicTypes-gen.cc
    271185        /* EXTENDED INTEGRAL RANK HIERARCHY (root to leaves)
    272186                                 _Bool
     
    293207
    294208        // GENERATED START, DO NOT EDIT
     209        // GENERATED BY BasicTypes-gen.cc
    295210        static const int costMatrix[BasicType::NUMBER_OF_BASIC_TYPES][BasicType::NUMBER_OF_BASIC_TYPES] = { // path length from root to node
    296211                /*          B    C   SC   UC   SI  SUI    I   UI   LI  LUI  LLI LLUI   IB  UIB  _FH  _FH   _F  _FC    F   FC  _FX _FXC   FD _FDC    D   DC F80X _FDXC  F80  _FB _FLDC   FB   LD  LDC _FBX _FLDXC */
     
    339254
    340255        // GENERATED START, DO NOT EDIT
     256        // GENERATED BY BasicTypes-gen.cc
    341257        static const int signMatrix[BasicType::NUMBER_OF_BASIC_TYPES][BasicType::NUMBER_OF_BASIC_TYPES] = { // number of sign changes in safe conversion
    342258                /*          B    C   SC   UC   SI  SUI    I   UI   LI  LUI  LLI LLUI   IB  UIB  _FH  _FH   _F  _FC    F   FC  _FX _FXC   FD _FDC    D   DC F80X _FDXC  F80  _FB _FLDC   FB   LD  LDC _FBX _FLDXC */
  • src/SymTab/ManglerCommon.cc

    rfba51ab rada4575  
    1010// Created On       : Sun May 17 21:44:03 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Feb 14 08:12:17 2019
    13 // Update Count     : 25
     12// Last Modified On : Thu Feb 14 17:06:37 2019
     13// Update Count     : 26
    1414//
    1515
     
    2222                namespace Encoding {
    2323                        const std::string manglePrefix = "_X";
    24 #if 0
    25                         const std::string basicTypes[] = {
    26                                 "b",  // Bool
    27                                 "c",  // Char
    28                                 "a",  // SignedChar
    29                                 "h",  // UnsignedChar
    30                                 "s",  // ShortSignedInt
    31                                 "t",  // ShortUnsignedInt
    32                                 "i",  // SignedInt
    33                                 "j",  // UnsignedInt
    34                                 "l",  // LongSignedInt
    35                                 "m",  // LongUnsignedInt
    36                                 "x",  // LongLongSignedInt
    37                                 "y",  // LongLongUnsignedInt
    38                                 "f",  // Float
    39                                 "d",  // Double
    40                                 "e",  // LongDouble
    41                                 "Cf", // FloatComplex
    42                                 "Cd", // DoubleComplex
    43                                 "Ce", // LongDoubleComplex
    44                                 // Note: imaginary is not an overloadable type in C++
    45                                 // "If", // FloatImaginary
    46                                 // "Id", // DoubleImaginary
    47                                 // "Ie", // LongDoubleImaginary
    48                                 "n",  // SignedInt128
    49                                 "o",  // UnsignedInt128
    50                                 "Dq",  // Float80 -- TODO: itanium says Float80 and LongDouble both encode to "e", but doing this causes problems with constructing long double, because the cost tables are incorrect
    51                                 "g",  // Float128
    52                                 // "z", // ellipsis
    53                                 // "Dd" // # IEEE 754r decimal floating point (64 bits)
    54                                 // "De" // # IEEE 754r decimal floating point (128 bits)
    55                                 // "Df" // # IEEE 754r decimal floating point (32 bits)
    56                                 // "Dh" // # IEEE 754r half-precision floating point (16 bits)
    57                                 // "DF"N_ // # ISO/IEC TS 18661 binary floating point type _FloatN (N bits)
    58                                 // "Di" // char32_t
    59                                 // "Ds" // char16_t
    60                         };
    61                         static_assert(
    62                                 sizeof(basicTypes)/sizeof(basicTypes[0]) == BasicType::NUMBER_OF_BASIC_TYPES,
    63                                 "Each basic type kind should have a corresponding mangler letter"
    64                         );
    65 #endif
     24
    6625                        // GENERATED START, DO NOT EDIT
     26                        // GENERATED BY BasicTypes-gen.cc
    6727                        // NOTES ON MANGLING:
    6828                        // * Itanium spec says that Float80 encodes to "e" (like LongDouble), but the distinct lengths cause resolution problems.
     
    11878                        }; // basicTypes
    11979                        // GENERATED END
     80                        static_assert(
     81                                sizeof(basicTypes)/sizeof(basicTypes[0]) == BasicType::NUMBER_OF_BASIC_TYPES,
     82                                "Each basic type kind should have a corresponding mangler letter"
     83                        );
    12084
    12185                        const std::map<int, std::string> qualifiers = {
  • src/SynTree/Type.h

    rfba51ab rada4575  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Feb 13 18:10:45 2019
    13 // Update Count     : 167
     12// Last Modified On : Thu Feb 14 17:11:24 2019
     13// Update Count     : 169
    1414//
    1515
     
    207207class BasicType : public Type {
    208208  public:
    209 #if 0
    210         enum Kind {
    211                 Bool,
    212                 Char,
    213                 SignedChar,
    214                 UnsignedChar,
    215                 ShortSignedInt,
    216                 ShortUnsignedInt,
    217                 SignedInt,
    218                 UnsignedInt,
    219                 LongSignedInt,
    220                 LongUnsignedInt,
    221                 LongLongSignedInt,
    222                 LongLongUnsignedInt,
    223                 Float,
    224                 Double,
    225                 LongDouble,
    226                 FloatComplex,
    227                 DoubleComplex,
    228                 LongDoubleComplex,
    229                 FloatImaginary,
    230                 DoubleImaginary,
    231                 LongDoubleImaginary,
    232                 SignedInt128,
    233                 UnsignedInt128,
    234                 Float80,
    235                 Float128,
    236                 _Float16,
    237                 _Float32,
    238                 _Float32x,
    239                 _Float64,
    240                 _Float64x,
    241                 _Float128,
    242                 _Float128x,
    243                 _Float16Complex,
    244                 _Float32Complex,
    245                 _Float32xComplex,
    246                 _Float64Complex,
    247                 _Float64xComplex,
    248                 _Float128Complex,
    249                 _Float128xComplex,
    250                 NUMBER_OF_BASIC_TYPES
    251         } kind;
    252 #endif
     209        // GENERATED START, DO NOT EDIT
     210        // GENERATED BY BasicTypes-gen.cc
    253211        enum Kind {
    254212                Bool,
     
    272230                Float,
    273231                FloatComplex,
    274                 // FloatImaginary,
    275232                uFloat32x,
    276233                uFloat32xComplex,
     
    279236                Double,
    280237                DoubleComplex,
    281                 // DoubleImaginary,
    282238                uFloat64x,
    283239                uFloat64xComplex,
     
    288244                LongDouble,
    289245                LongDoubleComplex,
    290                 // LongDoubleImaginary,
    291246                uFloat128x,
    292247                uFloat128xComplex,
    293248                NUMBER_OF_BASIC_TYPES
    294249        } kind;
     250        // GENERATED END
    295251
    296252        static const char *typeNames[];                                         // string names for basic types, MUST MATCH with Kind
Note: See TracChangeset for help on using the changeset viewer.