Changeset b3976bf


Ignore:
Timestamp:
Aug 12, 2019, 11:05:36 AM (4 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
dee1f89
Parents:
cc4218f (diff), 4f5a8a2 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

Files:
12 added
36 edited

Legend:

Unmodified
Added
Removed
  • Jenkinsfile

    rcc4218f rb3976bf  
    106106
    107107def build() {
    108         // build_stage('Build', true) {
    109         //      // Build outside of the src tree to ease cleaning
    110         //      dir (BuildDir) {
    111         //              //Configure the conpilation (Output is not relevant)
    112         //              //Use the current directory as the installation target so nothing escapes the sandbox
    113         //              //Also specify the compiler by hand
    114         //              targets=""
    115         //              if( Settings.RunAllTests || Settings.RunBenchmark ) {
    116         //                      targets="--with-target-hosts='host:debug,host:nodebug'"
    117         //              } else {
    118         //                      targets="--with-target-hosts='host:debug'"
    119         //              }
    120 
    121         //              sh "${SrcDir}/configure CXX=${Settings.Compiler.CXX} CC=${Settings.Compiler.CC} ${Settings.Architecture.flags} ${targets} --quiet"
    122 
    123         //              //Compile the project
    124         //              sh 'make -j 8 --no-print-directory'
    125         //      }
    126         // }
    127 
    128108        debug = true
    129109        release = Settings.RunAllTests || Settings.RunBenchmark
     
    195175                dir (BuildDir) {
    196176                        //Append bench results
    197                         sh "make --no-print-directory -C benchmark jenkins"
     177                        sh "make --no-print-directory -C benchmark jenkins arch=${Settings.Architecture.name}"
    198178                }
    199179        }
     
    221201
    222202                //Then publish the results
    223                 do_plot(Settings.RunBenchmark && Settings.Publish, 'compile'  , groupCompile    , 'Compilation')
    224                 do_plot(Settings.RunBenchmark && Settings.Publish, 'ctxswitch', groupConcurrency, 'Context Switching')
    225                 do_plot(Settings.RunBenchmark && Settings.Publish, 'mutex'    , groupConcurrency, 'Mutual Exclusion')
    226                 do_plot(Settings.RunBenchmark && Settings.Publish, 'signal'   , groupConcurrency, 'Internal and External Scheduling')
     203                do_plot(Settings.RunBenchmark && Settings.Publish, 'compile'       , groupCompile    , 'Compilation')
     204                do_plot(Settings.RunBenchmark && Settings.Publish, 'compile.diff'  , groupCompile    , 'Compilation Speed-Up')
     205                do_plot(Settings.RunBenchmark && Settings.Publish, 'ctxswitch'     , groupConcurrency, 'Context Switching')
     206                do_plot(Settings.RunBenchmark && Settings.Publish, 'ctxswitch.diff', groupConcurrency, 'Context Switching Speed-Up')
     207                do_plot(Settings.RunBenchmark && Settings.Publish, 'mutex'         , groupConcurrency, 'Mutual Exclusion')
     208                do_plot(Settings.RunBenchmark && Settings.Publish, 'mutex.diff'    , groupConcurrency, 'Mutual Exclusion Speed-Up')
     209                do_plot(Settings.RunBenchmark && Settings.Publish, 'signal'        , groupConcurrency, 'Internal and External Scheduling')
     210                do_plot(Settings.RunBenchmark && Settings.Publish, 'signal.diff'   , groupConcurrency, 'Internal and External Scheduling Speed-Up')
    227211        }
    228212}
  • Makefile.in

    rcc4218f rb3976bf  
    281281CYGPATH_W = @CYGPATH_W@
    282282DEFS = @DEFS@
     283DEMANGLER = @DEMANGLER@
    283284DEPDIR = @DEPDIR@
    284285DLLTOOL = @DLLTOOL@
     
    306307LIBCFA_TARGET_DIRS = @LIBCFA_TARGET_DIRS@
    307308LIBCFA_TARGET_MAKEFILES = @LIBCFA_TARGET_MAKEFILES@
     309LIBDEMANGLE = @LIBDEMANGLE@
    308310LIBOBJS = @LIBOBJS@
    309311LIBS = @LIBS@
  • automake/cfa.m4

    rcc4218f rb3976bf  
    6666                "x86-64"     ) cannon_arch_name="x64";;
    6767                "x86_64"     ) cannon_arch_name="x64";;
    68                 "aarch64"    ) cannon_arch_name="x64";;
     68                "aarch64"    ) cannon_arch_name="arm";;
    6969                "x86"        ) cannon_arch_name="x86";;
    7070                "i386"       ) cannon_arch_name="x86";;
  • benchmark/Makefile.am

    rcc4218f rb3976bf  
    5252# NEED AT LEAST 4 DATA VALUES FOR BENCHMARKS BECAUSE THE MAX AND MIN VALUES ARE REMOVED
    5353repeats  = 5 # 31 for benchmarks
     54arch     = x64
    5455skipcompile = no
    5556TIME_FORMAT = "%E"
     
    100101@DOifskipcompile@
    101102        @+make compile.csv
     103        @-+make compile.diff.csv
    102104@DOendif@
    103105        @+make ctxswitch.csv
     106        @-+make ctxswitch.diff.csv
    104107        @+make mutex.csv
     108        @-+make mutex.diff.csv
    105109        @+make signal.csv
     110        @-+make signal.diff.csv
    106111@DOifskipcompile@
    107         @cat compile.csv
     112        cat compile.csv
     113        -cat compile.diff.csv
    108114@DOendif@
    109         @cat ctxswitch.csv
    110         @cat mutex.csv
    111         @cat signal.csv
     115        cat ctxswitch.csv
     116        -cat ctxswitch.diff.csv
     117        cat mutex.csv
     118        -cat mutex.diff.csv
     119        cat signal.csv
     120        -cat signal.diff.csv
    112121
    113122compile.csv:
     
    143152        @+make waitfor-cfa2.runquiet >> $@
    144153        @$(srcdir)/fixcsv.sh $@
     154
     155%.diff.csv: %.csv
     156        @test -e $(srcdir)/baselines/$(arch)/$< || (echo "Error : Missing baseline for ${<}" && false)
     157        @$(srcdir)/baselines/calc.py $(srcdir)/baselines/$(arch)/$(<) $(<) > $@
     158
    145159
    146160## =========================================================================================================
  • benchmark/Makefile.in

    rcc4218f rb3976bf  
    231231CYGPATH_W = @CYGPATH_W@
    232232DEFS = @DEFS@
     233DEMANGLER = @DEMANGLER@
    233234DEPDIR = @DEPDIR@
    234235DLLTOOL = @DLLTOOL@
     
    256257LIBCFA_TARGET_DIRS = @LIBCFA_TARGET_DIRS@
    257258LIBCFA_TARGET_MAKEFILES = @LIBCFA_TARGET_MAKEFILES@
     259LIBDEMANGLE = @LIBDEMANGLE@
    258260LIBOBJS = @LIBOBJS@
    259261LIBS = @LIBS@
     
    398400# NEED AT LEAST 4 DATA VALUES FOR BENCHMARKS BECAUSE THE MAX AND MIN VALUES ARE REMOVED
    399401repeats = 5 # 31 for benchmarks
     402arch = x64
    400403skipcompile = no
    401404TIME_FORMAT = "%E"
     
    762765@DOifskipcompile@
    763766        @+make compile.csv
     767        @-+make compile.diff.csv
    764768@DOendif@
    765769        @+make ctxswitch.csv
     770        @-+make ctxswitch.diff.csv
    766771        @+make mutex.csv
     772        @-+make mutex.diff.csv
    767773        @+make signal.csv
     774        @-+make signal.diff.csv
    768775@DOifskipcompile@
    769         @cat compile.csv
     776        cat compile.csv
     777        -cat compile.diff.csv
    770778@DOendif@
    771         @cat ctxswitch.csv
    772         @cat mutex.csv
    773         @cat signal.csv
     779        cat ctxswitch.csv
     780        -cat ctxswitch.diff.csv
     781        cat mutex.csv
     782        -cat mutex.diff.csv
     783        cat signal.csv
     784        -cat signal.diff.csv
    774785
    775786compile.csv:
     
    806817        @$(srcdir)/fixcsv.sh $@
    807818
     819%.diff.csv: %.csv
     820        @test -e $(srcdir)/baselines/$(arch)/$< || (echo "Error : Missing baseline for ${<}" && false)
     821        @$(srcdir)/baselines/calc.py $(srcdir)/baselines/$(arch)/$(<) $(<) > $@
     822
    808823loop$(EXEEXT):
    809824        $(BENCH_V_CC)$(COMPILE) -DBENCH_N=5000000000 $(srcdir)/loop.c
  • configure

    rcc4218f rb3976bf  
    637637LIBOBJS
    638638CFA_BACKEND_CC
     639DEMANGLER
     640LIBDEMANGLE
    639641WITH_LIBTCMALLOC_FALSE
    640642WITH_LIBTCMALLOC_TRUE
     
    797799with_target_hosts
    798800enable_gprofiler
     801enable_demangler
    799802enable_dependency_tracking
    800803enable_shared
     
    14571460  --disable-silent-rules  verbose build output (undo: "make V=0")
    14581461  --enable-gprofiler     whether or not to enable gprofiler tools (if available)
     1462  --enable-demangler     whether or not to build the demangler (executable and library)
    14591463  --enable-dependency-tracking
    14601464                          do not reject slow dependency extractors
     
    34013405
    34023406
     3407# Check whether --enable-demangler was given.
     3408if test "${enable_demangler+set}" = set; then :
     3409  enableval=$enable_demangler; enable_demangler=$enableval
     3410else
     3411  enable_demangler=yes
     3412fi
     3413
     3414
    34033415TARGET_HOSTS=${target_hosts}
    34043416
     
    34333445                "x86-64"     ) cannon_arch_name="x64";;
    34343446                "x86_64"     ) cannon_arch_name="x64";;
    3435                 "aarch64"    ) cannon_arch_name="x64";;
     3447                "aarch64"    ) cannon_arch_name="arm";;
    34363448                "x86"        ) cannon_arch_name="x86";;
    34373449                "i386"       ) cannon_arch_name="x86";;
     
    34753487                "x86-64"     ) cannon_arch_name="x64";;
    34763488                "x86_64"     ) cannon_arch_name="x64";;
    3477                 "aarch64"    ) cannon_arch_name="x64";;
     3489                "aarch64"    ) cannon_arch_name="arm";;
    34783490                "x86"        ) cannon_arch_name="x86";;
    34793491                "i386"       ) cannon_arch_name="x86";;
     
    1678016792
    1678116793
     16794# conditionnally build the demangler
     16795if test "x$enable_demangler" == xyes; then
     16796        LIBDEMANGLE="libdemangle.a"
     16797        DEMANGLER="demangler"
     16798else
     16799        LIBDEMANGLE=""
     16800        DEMANGLER=""
     16801fi
     16802
     16803
     16804
    1678216805# Checks for header files.
    1678316806for ac_header in libintl.h malloc.h unistd.h
  • configure.ac

    rcc4218f rb3976bf  
    133133        enable_gprofiler=$enableval, enable_gprofiler=yes)
    134134
     135AC_ARG_ENABLE(demangler,
     136        [  --enable-demangler     whether or not to build the demangler (executable and library)],
     137        enable_demangler=$enableval, enable_demangler=yes)
     138
    135139AC_SUBST(TARGET_HOSTS, ${target_hosts})
    136140
     
    205209AM_CONDITIONAL([WITH_LIBTCMALLOC], [test "x$enable_gprofiler" = "xyes" -a "$HAVE_LIBTCMALLOC" -eq 1])
    206210
     211# conditionnally build the demangler
     212if test "x$enable_demangler" == xyes; then
     213        LIBDEMANGLE="libdemangle.a"
     214        DEMANGLER="demangler"
     215else
     216        LIBDEMANGLE=""
     217        DEMANGLER=""
     218fi
     219AC_SUBST([LIBDEMANGLE])
     220AC_SUBST([DEMANGLER])
     221
    207222# Checks for header files.
    208223AC_CHECK_HEADERS([libintl.h malloc.h unistd.h], [], [echo "Error: Missing required header"; exit 1])
  • driver/Makefile.in

    rcc4218f rb3976bf  
    218218CYGPATH_W = @CYGPATH_W@
    219219DEFS = @DEFS@
     220DEMANGLER = @DEMANGLER@
    220221DEPDIR = @DEPDIR@
    221222DLLTOOL = @DLLTOOL@
     
    243244LIBCFA_TARGET_DIRS = @LIBCFA_TARGET_DIRS@
    244245LIBCFA_TARGET_MAKEFILES = @LIBCFA_TARGET_MAKEFILES@
     246LIBDEMANGLE = @LIBDEMANGLE@
    245247LIBOBJS = @LIBOBJS@
    246248LIBS = @LIBS@
  • driver/cfa.cc

    rcc4218f rb3976bf  
    1010// Created On       : Tue Aug 20 13:44:49 2002
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sun Feb 10 08:28:09 2019
    13 // Update Count     : 281
     12// Last Modified On : Sat Aug 10 08:44:15 2019
     13// Update Count     : 311
    1414//
    1515
     
    2020#include <string>                                                                               // STL version
    2121#include <string.h>                                                                             // strcmp
     22#include <algorithm>                                                                    // find
    2223
    2324#include <sys/types.h>
     
    2627#include "Common/SemanticError.h"
    2728#include "config.h"                                                                             // configure info
     29
    2830
    2931using std::cerr;
     
    4042} // prefix
    4143
    42 enum { NumSuffixes = 2 };
    43 const string suffixes[NumSuffixes] = { "cfa", "hfa", };
    44 
    45 bool suffix( string arg, const char * args[], int & nargs ) {
     44bool suffix( string arg ) {
     45        enum { NumSuffixes = 3 };
     46        static const string suffixes[NumSuffixes] = { "cfa", "hfa", "ifa" };
    4647        //std::cerr << arg << std::endl;
    4748        size_t dot = arg.find_last_of( "." );
    4849        //std::cerr << dot << " " << (dot != string::npos ? arg.substr( dot + 1 ) : "fred" ) << std::endl;
    4950        if ( dot == string::npos ) return false;
    50         string sx = arg.substr( dot + 1 );
    51         for ( int i = 0; i < NumSuffixes; i += 1 ) {
    52                 if ( sx == suffixes[i] ) {
    53                         args[nargs] = "-x";
    54                         nargs += 1;
    55                         args[nargs] = "c";
    56                         nargs += 1;
    57                         return true;
    58                 } // if
    59         } // for
    60         return false;
     51        const string * end = suffixes + NumSuffixes;
     52        return std::find( suffixes, end, arg.substr( dot + 1 ) ) != end;
    6153} // suffix
    6254
    6355
    64 void shuffle( const char *args[], int S, int E, int N ) {
     56void shuffle( const char * args[], int S, int E, int N ) {
    6557        // S & E index 1 passed the end so adjust with -1
    6658        #ifdef __DEBUG_H__
     
    7567} // shuffle
    7668
    77 static inline bool dirExists(const string & path) {
     69static inline bool dirExists( const string & path ) {
    7870    struct stat info;
    7971    if(stat( path.c_str(), &info ) != 0)
     
    8880#define str(s) #s
    8981
    90 int main( int argc, char *argv[] ) {
     82int main( int argc, char * argv[] ) {
    9183        string Version( CFA_VERSION_LONG );                                     // current version number from CONFIG
    9284        string Major( str( CFA_VERSION_MAJOR ) ), Minor( str( CFA_VERSION_MINOR ) ), Patch( str( CFA_VERSION_PATCH ) );
     
    10496        string compiler_name;                                                           // name of C compiler
    10597
     98        bool x_flag = false;                                                            // -x flag
    10699        bool nonoptarg = false;                                                         // indicates non-option argument specified
    107100        bool link = true;                                                                       // linking as well as compiling
    108101        bool verbose = false;                                                           // -v flag
    109         bool quiet = false;                                                             // -quiet flag
    110         bool debug = true;                                                              // -debug flag
    111         bool nolib = false;                                                             // -nolib flag
    112         bool help = false;                                                              // -help flag
     102        bool quiet = false;                                                                     // -quiet flag
     103        bool debug = true;                                                                      // -debug flag
     104        bool nolib = false;                                                                     // -nolib flag
     105        bool help = false;                                                                      // -help flag
    113106        bool CFA_flag = false;                                                          // -CFA flag
    114107        bool cpp_flag = false;                                                          // -E or -M flag, preprocessor only
     
    116109        bool noincstd_flag = false;                                                     // -no-include-stdhdr= flag
    117110        bool debugging __attribute(( unused )) = false;         // -g flag
    118         bool m32 = false;                                    // -m32 flag
    119         bool m64 = false;                                    // -m64 flag
     111        bool m32 = false;                                                                       // -m32 flag
     112        bool m64 = false;                                                                       // -m64 flag
    120113        bool intree = false;
    121114
     
    198191                                args[nargs] = argv[i];                                  // pass the argument along
    199192                                nargs += 1;
     193                        } else if ( prefix( arg, "-x" ) ) {                     // file suffix ?
     194                                string lang;
     195                                args[nargs] = argv[i];                                  // pass the argument along
     196                                nargs += 1;
     197                                if ( arg.length() == 2 ) {                              // separate argument ?
     198                                        i += 1;
     199                                        if ( i == argc ) continue;                      // next argument available ?
     200                                        lang = argv[i];
     201                                        args[nargs] = argv[i];                          // pass the argument along
     202                                        nargs += 1;
     203                                } else {
     204                                        lang = arg.substr( 2 );
     205                                } // if
     206                                x_flag = lang != "none";
    200207                        } else if ( prefix( arg, "-std=" ) || prefix( arg, "--std=" ) ) {
    201208                                std_flag = true;                                                // -std=XX provided
     
    283290                        } // if
    284291                } else {
    285                         bool cfa = suffix( arg, args, nargs );          // check suffix
     292                        bool cfa = suffix( arg );                                       // check suffix
     293                        if ( ! x_flag && cfa ) {                                        // no explicit suffix and cfa suffix ?
     294                                args[nargs] = "-x";
     295                                nargs += 1;
     296                                args[nargs] = "c";
     297                                nargs += 1;
     298                        } // if
    286299                        args[nargs] = argv[i];                                          // concatenate file
    287300                        nargs += 1;
    288                         if ( cfa ) {
     301                        if ( ! x_flag && cfa ) {                                        // no explicit suffix and cfa suffix ?
    289302                                args[nargs] = "-x";
    290303                                nargs += 1;
     
    295308                } // if
    296309        } // for
    297 
    298     args[nargs] = "-x";                                                                 // turn off language
    299     nargs += 1;
    300     args[nargs] = "none";
    301     nargs += 1;
    302310
    303311        #ifdef __x86_64__
  • longrun_tests/Makefile.in

    rcc4218f rb3976bf  
    365365CYGPATH_W = @CYGPATH_W@
    366366DEFS = @DEFS@
     367DEMANGLER = @DEMANGLER@
    367368DEPDIR = @DEPDIR@
    368369DLLTOOL = @DLLTOOL@
     
    390391LIBCFA_TARGET_DIRS = @LIBCFA_TARGET_DIRS@
    391392LIBCFA_TARGET_MAKEFILES = @LIBCFA_TARGET_MAKEFILES@
     393LIBDEMANGLE = @LIBDEMANGLE@
    392394LIBOBJS = @LIBOBJS@
    393395LIBS = @LIBS@
  • src/BasicTypes-gen.cc

    rcc4218f rb3976bf  
    295295        // cout << code.str();
    296296
    297        
     297
     298        // TEMPORARY DURING CHANGE OVER
     299        #define TypeAST TOP_SRCDIR "src/AST/Type.hpp"
     300        resetInput( file, TypeAST, buffer, code, str );
     301
     302        if ( (start = str.find( STARTMK )) == string::npos ) Abort( "start", TypeAST );
     303        start += sizeof( STARTMK );                                                     // includes newline
     304        code << str.substr( 0, start );
     305
     306        code << "\t" << BYMK << endl;
     307        code << "\tenum Kind {" << endl;
     308        for ( int r = 0; r < NUMBER_OF_BASIC_TYPES; r += 1 ) {
     309                code << "\t\t" << graph[r].name << "," << endl;
     310        } // for       
     311        code << "\t\tNUMBER_OF_BASIC_TYPES" << endl;
     312        code << "\t} kind;" << endl;
     313        code << "\t";                                                                           // indentation for end marker
     314
     315        if ( (start = str.find( ENDMK, start + 1 )) == string::npos ) Abort( "end", TypeAST );
     316        code << str.substr( start );
     317
     318        output( file, TypeAST, code );
     319        // cout << code.str();
     320
     321
    298322        #define ConversionCost TOP_SRCDIR "src/ResolvExpr/ConversionCost.cc"
    299323        resetInput( file, ConversionCost, buffer, code, str );
     
    310334                        code << right << setw(30) << graph[c].type << left;
    311335                } else if ( graph[c].rank != graph[c + 2].rank ) {
    312                         code << string( 10, ' ' ) << setw(25) << graph[c].type << setw(25) << graph[c + 1].type;
     336                        code << string( 10, ' ' ) << setw(25) << graph[c].type << graph[c + 1].type;
    313337                        c += 1;
    314338                } else {
    315                         code << setw(20) << graph[c].type << setw(20) << graph[c + 1].type << setw(20) << graph[c + 2].type;
     339                        code << setw(20) << graph[c].type << setw(20) << graph[c + 1].type << graph[c + 2].type;
    316340                        c += 2;
    317341                } // if
     
    328352        code << "\t" << BYMK << endl;
    329353        code << "\tstatic const int costMatrix[BasicType::NUMBER_OF_BASIC_TYPES][BasicType::NUMBER_OF_BASIC_TYPES] = { // path length from root to node" << endl
    330                  << "\t\t/*         ";
     354                 << "\t\t/*           ";
    331355        for ( int r = 0; r < NUMBER_OF_BASIC_TYPES; r += 1 ) { // titles
    332356                code << setw(5) << graph[r].abbrev;
     
    334358        code << " */" << endl;
    335359        for ( int r = 0; r < NUMBER_OF_BASIC_TYPES; r += 1 ) { // costs
    336                 code << "\t\t/*" << setw(6) << graph[r].abbrev << "*/ {";
     360                code << "\t\t/* " << setw(6) << graph[r].abbrev << " */ {";
    337361                for ( int c = 0; c < NUMBER_OF_BASIC_TYPES; c += 1 ) {
    338362                        code << setw(4) << costMatrix[r][c] << ",";
     
    353377        code << "\t" << BYMK << endl;
    354378        code << "\tstatic const int signMatrix[BasicType::NUMBER_OF_BASIC_TYPES][BasicType::NUMBER_OF_BASIC_TYPES] = { // number of sign changes in safe conversion" << endl
    355                  << "\t\t/*         ";
     379                 << "\t\t/*           ";
    356380        for ( int r = 0; r < NUMBER_OF_BASIC_TYPES; r += 1 ) { // titles
    357381                code << setw(5) << graph[r].abbrev;
     
    359383        code << " */" << endl;
    360384        for ( int r = 0; r < NUMBER_OF_BASIC_TYPES; r += 1 ) { // costs
    361                 code << "\t\t/*" << setw(6) << graph[r].abbrev << "*/ {";
     385                code << "\t\t/* " << setw(6) << graph[r].abbrev << " */ {";
    362386                for ( int c = 0; c < NUMBER_OF_BASIC_TYPES; c += 1 ) {
    363387                        code << setw(4) << signMatrix[r][c] << ",";
     
    395419        code << "*/" << endl;
    396420        for ( int r = 0; r < NUMBER_OF_BASIC_TYPES; r += 1 ) { // costs
    397                 code << "\t\t\t\t  {\n\t\t/*" << setw(6) << graph[r].abbrev << "*/";
     421                code << "\t\t\t\t  {\n\t\t/* " << setw(6) << graph[r].abbrev << " */";
    398422                for ( int c = 0; c < NUMBER_OF_BASIC_TYPES; c += 1 ) {
    399423                        string s = string{"BT "} + graph[commonTypeMatrix[r][c]].name;
  • src/GenPoly/Box.cc

    rcc4218f rb3976bf  
    725725                        if ( ! needsBoxing( param, arg->result, exprTyVars, env ) ) return;
    726726
    727                         if ( arg->result->get_lvalue() ) {
     727                        if ( arg->get_lvalue() ) {
    728728                                // argument expression may be CFA lvalue, but not C lvalue -- apply generalizedLvalue transformations.
    729729                                // if ( VariableExpr * varExpr = dynamic_cast< VariableExpr * >( arg ) ) {
  • src/GenPoly/Lvalue.cc

    rcc4218f rb3976bf  
    363363                        int diff = depth1 - depth2;
    364364
    365                         if ( diff > 0 && ! srcType->get_lvalue() ) {
     365                        if ( diff > 0 && ! castExpr->arg->get_lvalue() ) {
    366366                                // rvalue to reference conversion -- introduce temporary
    367367                                // know that reference depth of cast argument is 0, need to introduce n temporaries for reference depth of n, e.g.
     
    407407                                        ret = new AddressExpr( ret );
    408408                                }
    409                                 if ( srcType->get_lvalue() && ! ResolvExpr::typesCompatible( srcType, strict_dynamic_cast<ReferenceType *>( destType )->base, SymTab::Indexer() ) ) {
     409                                if ( castExpr->arg->get_lvalue() && ! ResolvExpr::typesCompatible( srcType, strict_dynamic_cast<ReferenceType *>( destType )->base, SymTab::Indexer() ) ) {
    410410                                        // must keep cast if cast-to type is different from the actual type
    411411                                        castExpr->arg = ret;
  • src/Makefile.am

    rcc4218f rb3976bf  
    1111## Created On       : Sun May 31 08:51:46 2015
    1212## Last Modified By : Peter A. Buhr
    13 ## Last Modified On : Fri Feb 15 09:44:09 2019
    14 ## Update Count     : 97
     13## Last Modified On : Mon Aug  5 12:57:46 2019
     14## Update Count     : 98
    1515###############################################################################
    1616
     
    5555$(addprefix $(srcdir)/, ResolvExpr/ConversionCost.cc ResolvExpr/CommonType.cc SymTab/ManglerCommon.cc) : $(srcdir)/SynTree/Type.h
    5656
    57 $(srcdir)/SynTree/Type.h : BasicTypes-gen.cc
     57$(srcdir)/AST/Type.hpp : BasicTypes-gen.cc
    5858        ${AM_V_GEN}${CXXCOMPILE} $< -o BasicTypes-gen -Wall -Wextra
    5959        @./BasicTypes-gen
     
    6262# put into lib for now
    6363cfa_cpplibdir = $(CFA_LIBDIR)
    64 cfa_cpplib_PROGRAMS = ../driver/cfa-cpp demangler
     64cfa_cpplib_PROGRAMS = ../driver/cfa-cpp $(DEMANGLER)
     65EXTRA_PROGRAMS = demangler
    6566___driver_cfa_cpp_SOURCES = $(SRC)
    6667___driver_cfa_cpp_LDADD = -ldl $(LIBPROFILER) $(LIBTCMALLOC)
     
    7475demangler_LDADD = libdemangle.a -ldl                    # yywrap
    7576
    76 noinst_LIBRARIES = libdemangle.a
     77noinst_LIBRARIES = $(LIBDEMANGLE)
     78EXTRA_LIBRARIES = libdemangle.a
    7779libdemangle_a_SOURCES = $(SRCDEMANGLE)
    7880
  • src/Makefile.in

    rcc4218f rb3976bf  
    141141build_triplet = @build@
    142142host_triplet = @host@
    143 cfa_cpplib_PROGRAMS = ../driver/cfa-cpp$(EXEEXT) demangler$(EXEEXT)
     143cfa_cpplib_PROGRAMS = ../driver/cfa-cpp$(EXEEXT) $(DEMANGLER)
     144EXTRA_PROGRAMS = demangler$(EXEEXT)
    144145subdir = src
    145146ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
     
    230231        SynTree/Initializer.$(OBJEXT) \
    231232        SynTree/TypeSubstitution.$(OBJEXT) SynTree/Attribute.$(OBJEXT) \
    232         SynTree/DeclReplacer.$(OBJEXT)
     233        SynTree/DeclReplacer.$(OBJEXT) SynTree/TopLvalue.$(OBJEXT)
    233234am__objects_8 = CompilationState.$(OBJEXT) $(am__objects_1) \
    234235        $(am__objects_2) Concurrency/Keywords.$(OBJEXT) \
     
    427428CYGPATH_W = @CYGPATH_W@
    428429DEFS = @DEFS@
     430DEMANGLER = @DEMANGLER@
    429431DEPDIR = @DEPDIR@
    430432DLLTOOL = @DLLTOOL@
     
    452454LIBCFA_TARGET_DIRS = @LIBCFA_TARGET_DIRS@
    453455LIBCFA_TARGET_MAKEFILES = @LIBCFA_TARGET_MAKEFILES@
     456LIBDEMANGLE = @LIBDEMANGLE@
    454457LIBOBJS = @LIBOBJS@
    455458LIBS = @LIBS@
     
    691694      SynTree/TypeSubstitution.cc \
    692695      SynTree/Attribute.cc \
    693       SynTree/DeclReplacer.cc
     696      SynTree/DeclReplacer.cc \
     697      SynTree/TopLvalue.cc
    694698
    695699
     
    703707demangler_SOURCES = SymTab/demangler.cc # test driver for the demangler, also useful as a sanity check that libdemangle.a is complete
    704708demangler_LDADD = libdemangle.a -ldl                    # yywrap
    705 noinst_LIBRARIES = libdemangle.a
     709noinst_LIBRARIES = $(LIBDEMANGLE)
     710EXTRA_LIBRARIES = libdemangle.a
    706711libdemangle_a_SOURCES = $(SRCDEMANGLE)
    707712all: $(BUILT_SOURCES)
     
    10191024SynTree/DeclReplacer.$(OBJEXT): SynTree/$(am__dirstamp) \
    10201025        SynTree/$(DEPDIR)/$(am__dirstamp)
     1026SynTree/TopLvalue.$(OBJEXT): SynTree/$(am__dirstamp) \
     1027        SynTree/$(DEPDIR)/$(am__dirstamp)
    10211028Tuples/$(am__dirstamp):
    10221029        @$(MKDIR_P) Tuples
     
    13291336@AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/ReferenceType.Po@am__quote@
    13301337@AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/Statement.Po@am__quote@
     1338@AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/TopLvalue.Po@am__quote@
    13311339@AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/TupleExpr.Po@am__quote@
    13321340@AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/TupleType.Po@am__quote@
     
    16621670$(addprefix $(srcdir)/, ResolvExpr/ConversionCost.cc ResolvExpr/CommonType.cc SymTab/ManglerCommon.cc) : $(srcdir)/SynTree/Type.h
    16631671
    1664 $(srcdir)/SynTree/Type.h : BasicTypes-gen.cc
     1672$(srcdir)/AST/Type.hpp : BasicTypes-gen.cc
    16651673        ${AM_V_GEN}${CXXCOMPILE} $< -o BasicTypes-gen -Wall -Wextra
    16661674        @./BasicTypes-gen
  • src/Parser/ExpressionNode.cc

    rcc4218f rb3976bf  
    1010// Created On       : Sat May 16 13:17:07 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sun Mar 10 16:10:32 2019
    13 // Update Count     : 976
     12// Last Modified On : Sun Aug  4 20:57:55 2019
     13// Update Count     : 978
    1414//
    1515
     
    109109
    110110Expression * build_constantInteger( string & str ) {
    111         static const BasicType::Kind kind[2][7] = {
     111        static const BasicType::Kind kind[2][6] = {
    112112                // short (h) must be before char (hh) because shorter type has the longer suffix
    113113                { BasicType::ShortSignedInt, BasicType::SignedChar, BasicType::SignedInt, BasicType::LongSignedInt, BasicType::LongLongSignedInt, BasicType::SignedInt128, },
  • src/Parser/lex.ll

    rcc4218f rb3976bf  
    1010 * Created On       : Sat Sep 22 08:58:10 2001
    1111 * Last Modified By : Peter A. Buhr
    12  * Last Modified On : Thu Jul 25 22:08:32 2019
    13  * Update Count     : 716
     12 * Last Modified On : Sun Aug  4 20:53:47 2019
     13 * Update Count     : 719
    1414 */
    1515
     
    273273__inline__              { KEYWORD_RETURN(INLINE); }                             // GCC
    274274int                             { KEYWORD_RETURN(INT); }
     275int128                  { KEYWORD_RETURN(INT128); }                             // CFA
    275276__int128                { KEYWORD_RETURN(INT128); }                             // GCC
    276 int128                  { KEYWORD_RETURN(INT128); }                             // GCC
     277__int128_t              { KEYWORD_RETURN(INT128); }                             // GCC
    277278__label__               { KEYWORD_RETURN(LABEL); }                              // GCC
    278279long                    { KEYWORD_RETURN(LONG); }
     
    313314__typeof__              { KEYWORD_RETURN(TYPEOF); }                             // GCC
    314315union                   { KEYWORD_RETURN(UNION); }
     316__uint128_t             { KEYWORD_RETURN(UINT128); }                    // GCC
    315317unsigned                { KEYWORD_RETURN(UNSIGNED); }
    316318__builtin_va_list { KEYWORD_RETURN(VALIST); }                   // GCC
  • src/Parser/parser.yy

    rcc4218f rb3976bf  
    1010// Created On       : Sat Sep  1 20:22:55 2001
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Jul 25 22:31:38 2019
    13 // Update Count     : 4359
     12// Last Modified On : Sun Aug  4 21:48:23 2019
     13// Update Count     : 4364
    1414//
    1515
     
    268268%token VOID CHAR SHORT INT LONG FLOAT DOUBLE SIGNED UNSIGNED
    269269%token BOOL COMPLEX IMAGINARY                                                   // C99
    270 %token INT128 uuFLOAT80 uuFLOAT128                                              // GCC
     270%token INT128 UINT128 uuFLOAT80 uuFLOAT128                              // GCC
    271271%token uFLOAT16 uFLOAT32 uFLOAT32X uFLOAT64 uFLOAT64X uFLOAT128 // GCC
    272272%token ZERO_T ONE_T                                                                             // CFA
     
    18261826        | INT128
    18271827                { $$ = DeclarationNode::newBasicType( DeclarationNode::Int128 ); }
     1828        | UINT128
     1829                { $$ = DeclarationNode::newBasicType( DeclarationNode::Int128 )->addType( DeclarationNode::newSignedNess( DeclarationNode::Unsigned ) ); }
    18281830        | FLOAT
    18291831                { $$ = DeclarationNode::newBasicType( DeclarationNode::Float ); }
  • src/ResolvExpr/AlternativeFinder.cc

    rcc4218f rb3976bf  
    11351135        bool isLvalue( Expression *expr ) {
    11361136                // xxx - recurse into tuples?
    1137                 return expr->result && ( expr->result->get_lvalue() || dynamic_cast< ReferenceType * >( expr->result ) );
     1137                return expr->result && ( expr->get_lvalue() || dynamic_cast< ReferenceType * >( expr->result ) );
    11381138        }
    11391139
  • src/ResolvExpr/CommonType.cc

    rcc4218f rb3976bf  
    190190                                 */
    191191                                  {
    192                 /*     B */                BT Bool,                BT Char,          BT SignedChar,        BT UnsignedChar,      BT ShortSignedInt,    BT ShortUnsignedInt,
     192                /*      B */                BT Bool,                BT Char,          BT SignedChar,        BT UnsignedChar,      BT ShortSignedInt,    BT ShortUnsignedInt,
    193193                                             BT SignedInt,         BT UnsignedInt,       BT LongSignedInt,     BT LongUnsignedInt,   BT LongLongSignedInt, BT LongLongUnsignedInt,
    194194                                          BT SignedInt128,      BT UnsignedInt128,            BT uFloat16,     BT uFloat16Complex,            BT uFloat32,     BT uFloat32Complex,
     
    198198                                  },
    199199                                  {
    200                 /*     C */                BT Char,                BT Char,          BT SignedChar,        BT UnsignedChar,      BT ShortSignedInt,    BT ShortUnsignedInt,
     200                /*      C */                BT Char,                BT Char,          BT SignedChar,        BT UnsignedChar,      BT ShortSignedInt,    BT ShortUnsignedInt,
    201201                                             BT SignedInt,         BT UnsignedInt,       BT LongSignedInt,     BT LongUnsignedInt,   BT LongLongSignedInt, BT LongLongUnsignedInt,
    202202                                          BT SignedInt128,      BT UnsignedInt128,            BT uFloat16,     BT uFloat16Complex,            BT uFloat32,     BT uFloat32Complex,
     
    206206                                  },
    207207                                  {
    208                 /*    SC */          BT SignedChar,          BT SignedChar,          BT SignedChar,        BT UnsignedChar,      BT ShortSignedInt,    BT ShortUnsignedInt,
     208                /*     SC */          BT SignedChar,          BT SignedChar,          BT SignedChar,        BT UnsignedChar,      BT ShortSignedInt,    BT ShortUnsignedInt,
    209209                                             BT SignedInt,         BT UnsignedInt,       BT LongSignedInt,     BT LongUnsignedInt,   BT LongLongSignedInt, BT LongLongUnsignedInt,
    210210                                          BT SignedInt128,      BT UnsignedInt128,            BT uFloat16,     BT uFloat16Complex,            BT uFloat32,     BT uFloat32Complex,
     
    214214                                  },
    215215                                  {
    216                 /*    UC */        BT UnsignedChar,        BT UnsignedChar,        BT UnsignedChar,        BT UnsignedChar,      BT ShortSignedInt,    BT ShortUnsignedInt,
     216                /*     UC */        BT UnsignedChar,        BT UnsignedChar,        BT UnsignedChar,        BT UnsignedChar,      BT ShortSignedInt,    BT ShortUnsignedInt,
    217217                                             BT SignedInt,         BT UnsignedInt,       BT LongSignedInt,     BT LongUnsignedInt,   BT LongLongSignedInt, BT LongLongUnsignedInt,
    218218                                          BT SignedInt128,      BT UnsignedInt128,            BT uFloat16,     BT uFloat16Complex,            BT uFloat32,     BT uFloat32Complex,
     
    222222                                  },
    223223                                  {
    224                 /*    SI */      BT ShortSignedInt,      BT ShortSignedInt,      BT ShortSignedInt,      BT ShortSignedInt,      BT ShortSignedInt,    BT ShortUnsignedInt,
     224                /*     SI */      BT ShortSignedInt,      BT ShortSignedInt,      BT ShortSignedInt,      BT ShortSignedInt,      BT ShortSignedInt,    BT ShortUnsignedInt,
    225225                                             BT SignedInt,         BT UnsignedInt,       BT LongSignedInt,     BT LongUnsignedInt,   BT LongLongSignedInt, BT LongLongUnsignedInt,
    226226                                          BT SignedInt128,      BT UnsignedInt128,            BT uFloat16,     BT uFloat16Complex,            BT uFloat32,     BT uFloat32Complex,
     
    230230                                  },
    231231                                  {
    232                 /*   SUI */    BT ShortUnsignedInt,    BT ShortUnsignedInt,    BT ShortUnsignedInt,    BT ShortUnsignedInt,    BT ShortUnsignedInt,    BT ShortUnsignedInt,
     232                /*    SUI */    BT ShortUnsignedInt,    BT ShortUnsignedInt,    BT ShortUnsignedInt,    BT ShortUnsignedInt,    BT ShortUnsignedInt,    BT ShortUnsignedInt,
    233233                                             BT SignedInt,         BT UnsignedInt,       BT LongSignedInt,     BT LongUnsignedInt,   BT LongLongSignedInt, BT LongLongUnsignedInt,
    234234                                          BT SignedInt128,      BT UnsignedInt128,            BT uFloat16,     BT uFloat16Complex,            BT uFloat32,     BT uFloat32Complex,
     
    238238                                  },
    239239                                  {
    240                 /*     I */           BT SignedInt,           BT SignedInt,           BT SignedInt,           BT SignedInt,           BT SignedInt,           BT SignedInt,
     240                /*      I */           BT SignedInt,           BT SignedInt,           BT SignedInt,           BT SignedInt,           BT SignedInt,           BT SignedInt,
    241241                                             BT SignedInt,         BT UnsignedInt,       BT LongSignedInt,     BT LongUnsignedInt,   BT LongLongSignedInt, BT LongLongUnsignedInt,
    242242                                          BT SignedInt128,      BT UnsignedInt128,            BT uFloat16,     BT uFloat16Complex,            BT uFloat32,     BT uFloat32Complex,
     
    246246                                  },
    247247                                  {
    248                 /*    UI */         BT UnsignedInt,         BT UnsignedInt,         BT UnsignedInt,         BT UnsignedInt,         BT UnsignedInt,         BT UnsignedInt,
     248                /*     UI */         BT UnsignedInt,         BT UnsignedInt,         BT UnsignedInt,         BT UnsignedInt,         BT UnsignedInt,         BT UnsignedInt,
    249249                                           BT UnsignedInt,         BT UnsignedInt,       BT LongSignedInt,     BT LongUnsignedInt,   BT LongLongSignedInt, BT LongLongUnsignedInt,
    250250                                          BT SignedInt128,      BT UnsignedInt128,            BT uFloat16,     BT uFloat16Complex,            BT uFloat32,     BT uFloat32Complex,
     
    254254                                  },
    255255                                  {
    256                 /*    LI */       BT LongSignedInt,       BT LongSignedInt,       BT LongSignedInt,       BT LongSignedInt,       BT LongSignedInt,       BT LongSignedInt,
     256                /*     LI */       BT LongSignedInt,       BT LongSignedInt,       BT LongSignedInt,       BT LongSignedInt,       BT LongSignedInt,       BT LongSignedInt,
    257257                                         BT LongSignedInt,       BT LongSignedInt,       BT LongSignedInt,     BT LongUnsignedInt,   BT LongLongSignedInt, BT LongLongUnsignedInt,
    258258                                          BT SignedInt128,      BT UnsignedInt128,            BT uFloat16,     BT uFloat16Complex,            BT uFloat32,     BT uFloat32Complex,
     
    262262                                  },
    263263                                  {
    264                 /*   LUI */     BT LongUnsignedInt,     BT LongUnsignedInt,     BT LongUnsignedInt,     BT LongUnsignedInt,     BT LongUnsignedInt,     BT LongUnsignedInt,
     264                /*    LUI */     BT LongUnsignedInt,     BT LongUnsignedInt,     BT LongUnsignedInt,     BT LongUnsignedInt,     BT LongUnsignedInt,     BT LongUnsignedInt,
    265265                                       BT LongUnsignedInt,     BT LongUnsignedInt,     BT LongUnsignedInt,     BT LongUnsignedInt,   BT LongLongSignedInt, BT LongLongUnsignedInt,
    266266                                          BT SignedInt128,      BT UnsignedInt128,            BT uFloat16,     BT uFloat16Complex,            BT uFloat32,     BT uFloat32Complex,
     
    270270                                  },
    271271                                  {
    272                 /*   LLI */   BT LongLongSignedInt,   BT LongLongSignedInt,   BT LongLongSignedInt,   BT LongLongSignedInt,   BT LongLongSignedInt,   BT LongLongSignedInt,
     272                /*    LLI */   BT LongLongSignedInt,   BT LongLongSignedInt,   BT LongLongSignedInt,   BT LongLongSignedInt,   BT LongLongSignedInt,   BT LongLongSignedInt,
    273273                                     BT LongLongSignedInt,   BT LongLongSignedInt,   BT LongLongSignedInt,   BT LongLongSignedInt,   BT LongLongSignedInt, BT LongLongUnsignedInt,
    274274                                          BT SignedInt128,      BT UnsignedInt128,            BT uFloat16,     BT uFloat16Complex,            BT uFloat32,     BT uFloat32Complex,
     
    278278                                  },
    279279                                  {
    280                 /*  LLUI */ BT LongLongUnsignedInt, BT LongLongUnsignedInt, BT LongLongUnsignedInt, BT LongLongUnsignedInt, BT LongLongUnsignedInt, BT LongLongUnsignedInt,
     280                /*   LLUI */ BT LongLongUnsignedInt, BT LongLongUnsignedInt, BT LongLongUnsignedInt, BT LongLongUnsignedInt, BT LongLongUnsignedInt, BT LongLongUnsignedInt,
    281281                                   BT LongLongUnsignedInt, BT LongLongUnsignedInt, BT LongLongUnsignedInt, BT LongLongUnsignedInt, BT LongLongUnsignedInt, BT LongLongUnsignedInt,
    282282                                          BT SignedInt128,      BT UnsignedInt128,            BT uFloat16,     BT uFloat16Complex,            BT uFloat32,     BT uFloat32Complex,
     
    286286                                  },
    287287                                  {
    288                 /*    IB */        BT SignedInt128,        BT SignedInt128,        BT SignedInt128,        BT SignedInt128,        BT SignedInt128,        BT SignedInt128,
     288                /*     IB */        BT SignedInt128,        BT SignedInt128,        BT SignedInt128,        BT SignedInt128,        BT SignedInt128,        BT SignedInt128,
    289289                                          BT SignedInt128,        BT SignedInt128,        BT SignedInt128,        BT SignedInt128,        BT SignedInt128,        BT SignedInt128,
    290290                                          BT SignedInt128,      BT UnsignedInt128,            BT uFloat16,     BT uFloat16Complex,            BT uFloat32,     BT uFloat32Complex,
     
    294294                                  },
    295295                                  {
    296                 /*   UIB */      BT UnsignedInt128,      BT UnsignedInt128,      BT UnsignedInt128,      BT UnsignedInt128,      BT UnsignedInt128,      BT UnsignedInt128,
     296                /*    UIB */      BT UnsignedInt128,      BT UnsignedInt128,      BT UnsignedInt128,      BT UnsignedInt128,      BT UnsignedInt128,      BT UnsignedInt128,
    297297                                        BT UnsignedInt128,      BT UnsignedInt128,      BT UnsignedInt128,      BT UnsignedInt128,      BT UnsignedInt128,      BT UnsignedInt128,
    298298                                        BT UnsignedInt128,      BT UnsignedInt128,            BT uFloat16,     BT uFloat16Complex,            BT uFloat32,     BT uFloat32Complex,
     
    302302                                  },
    303303                                  {
    304                 /*   _FH */            BT uFloat16,            BT uFloat16,            BT uFloat16,            BT uFloat16,            BT uFloat16,            BT uFloat16,
     304                /*    _FH */            BT uFloat16,            BT uFloat16,            BT uFloat16,            BT uFloat16,            BT uFloat16,            BT uFloat16,
    305305                                              BT uFloat16,            BT uFloat16,            BT uFloat16,            BT uFloat16,            BT uFloat16,            BT uFloat16,
    306306                                              BT uFloat16,            BT uFloat16,            BT uFloat16,     BT uFloat16Complex,            BT uFloat32,     BT uFloat32Complex,
     
    310310                                  },
    311311                                  {
    312                 /*   _FH */     BT uFloat16Complex,     BT uFloat16Complex,     BT uFloat16Complex,     BT uFloat16Complex,     BT uFloat16Complex,     BT uFloat16Complex,
     312                /*    _FH */     BT uFloat16Complex,     BT uFloat16Complex,     BT uFloat16Complex,     BT uFloat16Complex,     BT uFloat16Complex,     BT uFloat16Complex,
    313313                                       BT uFloat16Complex,     BT uFloat16Complex,     BT uFloat16Complex,     BT uFloat16Complex,     BT uFloat16Complex,     BT uFloat16Complex,
    314314                                       BT uFloat16Complex,     BT uFloat16Complex,     BT uFloat16Complex,     BT uFloat16Complex,     BT uFloat32Complex,     BT uFloat32Complex,
     
    318318                                  },
    319319                                  {
    320                 /*    _F */            BT uFloat32,            BT uFloat32,            BT uFloat32,            BT uFloat32,            BT uFloat32,            BT uFloat32,
     320                /*     _F */            BT uFloat32,            BT uFloat32,            BT uFloat32,            BT uFloat32,            BT uFloat32,            BT uFloat32,
    321321                                              BT uFloat32,            BT uFloat32,            BT uFloat32,            BT uFloat32,            BT uFloat32,            BT uFloat32,
    322322                                              BT uFloat32,            BT uFloat32,            BT uFloat32,     BT uFloat32Complex,            BT uFloat32,     BT uFloat32Complex,
     
    326326                                  },
    327327                                  {
    328                 /*   _FC */     BT uFloat32Complex,     BT uFloat32Complex,     BT uFloat32Complex,     BT uFloat32Complex,     BT uFloat32Complex,     BT uFloat32Complex,
     328                /*    _FC */     BT uFloat32Complex,     BT uFloat32Complex,     BT uFloat32Complex,     BT uFloat32Complex,     BT uFloat32Complex,     BT uFloat32Complex,
    329329                                       BT uFloat32Complex,     BT uFloat32Complex,     BT uFloat32Complex,     BT uFloat32Complex,     BT uFloat32Complex,     BT uFloat32Complex,
    330330                                       BT uFloat32Complex,     BT uFloat32Complex,     BT uFloat32Complex,     BT uFloat32Complex,     BT uFloat32Complex,     BT uFloat32Complex,
     
    334334                                  },
    335335                                  {
    336                 /*     F */               BT Float,               BT Float,               BT Float,               BT Float,               BT Float,               BT Float,
     336                /*      F */               BT Float,               BT Float,               BT Float,               BT Float,               BT Float,               BT Float,
    337337                                                 BT Float,               BT Float,               BT Float,               BT Float,               BT Float,               BT Float,
    338338                                                 BT Float,               BT Float,               BT Float,        BT FloatComplex,               BT Float,        BT FloatComplex,
     
    342342                                  },
    343343                                  {
    344                 /*    FC */        BT FloatComplex,        BT FloatComplex,        BT FloatComplex,        BT FloatComplex,        BT FloatComplex,        BT FloatComplex,
     344                /*     FC */        BT FloatComplex,        BT FloatComplex,        BT FloatComplex,        BT FloatComplex,        BT FloatComplex,        BT FloatComplex,
    345345                                          BT FloatComplex,        BT FloatComplex,        BT FloatComplex,        BT FloatComplex,        BT FloatComplex,        BT FloatComplex,
    346346                                          BT FloatComplex,        BT FloatComplex,        BT FloatComplex,        BT FloatComplex,        BT FloatComplex,        BT FloatComplex,
     
    350350                                  },
    351351                                  {
    352                 /*   _FX */           BT uFloat32x,           BT uFloat32x,           BT uFloat32x,           BT uFloat32x,           BT uFloat32x,           BT uFloat32x,
     352                /*    _FX */           BT uFloat32x,           BT uFloat32x,           BT uFloat32x,           BT uFloat32x,           BT uFloat32x,           BT uFloat32x,
    353353                                             BT uFloat32x,           BT uFloat32x,           BT uFloat32x,           BT uFloat32x,           BT uFloat32x,           BT uFloat32x,
    354354                                             BT uFloat32x,           BT uFloat32x,           BT uFloat32x,    BT uFloat32xComplex,           BT uFloat32x,    BT uFloat32xComplex,
     
    358358                                  },
    359359                                  {
    360                 /*  _FXC */    BT uFloat32xComplex,    BT uFloat32xComplex,    BT uFloat32xComplex,    BT uFloat32xComplex,    BT uFloat32xComplex,    BT uFloat32xComplex,
     360                /*   _FXC */    BT uFloat32xComplex,    BT uFloat32xComplex,    BT uFloat32xComplex,    BT uFloat32xComplex,    BT uFloat32xComplex,    BT uFloat32xComplex,
    361361                                      BT uFloat32xComplex,    BT uFloat32xComplex,    BT uFloat32xComplex,    BT uFloat32xComplex,    BT uFloat32xComplex,    BT uFloat32xComplex,
    362362                                      BT uFloat32xComplex,    BT uFloat32xComplex,    BT uFloat32xComplex,    BT uFloat32xComplex,    BT uFloat32xComplex,    BT uFloat32xComplex,
     
    366366                                  },
    367367                                  {
    368                 /*    FD */            BT uFloat64,            BT uFloat64,            BT uFloat64,            BT uFloat64,            BT uFloat64,            BT uFloat64,
     368                /*     FD */            BT uFloat64,            BT uFloat64,            BT uFloat64,            BT uFloat64,            BT uFloat64,            BT uFloat64,
    369369                                              BT uFloat64,            BT uFloat64,            BT uFloat64,            BT uFloat64,            BT uFloat64,            BT uFloat64,
    370370                                              BT uFloat64,            BT uFloat64,            BT uFloat64,     BT uFloat64Complex,            BT uFloat64,     BT uFloat64Complex,
     
    374374                                  },
    375375                                  {
    376                 /*  _FDC */     BT uFloat64Complex,     BT uFloat64Complex,     BT uFloat64Complex,     BT uFloat64Complex,     BT uFloat64Complex,     BT uFloat64Complex,
     376                /*   _FDC */     BT uFloat64Complex,     BT uFloat64Complex,     BT uFloat64Complex,     BT uFloat64Complex,     BT uFloat64Complex,     BT uFloat64Complex,
    377377                                       BT uFloat64Complex,     BT uFloat64Complex,     BT uFloat64Complex,     BT uFloat64Complex,     BT uFloat64Complex,     BT uFloat64Complex,
    378378                                       BT uFloat64Complex,     BT uFloat64Complex,     BT uFloat64Complex,     BT uFloat64Complex,     BT uFloat64Complex,     BT uFloat64Complex,
     
    382382                                  },
    383383                                  {
    384                 /*     D */              BT Double,              BT Double,              BT Double,              BT Double,              BT Double,              BT Double,
     384                /*      D */              BT Double,              BT Double,              BT Double,              BT Double,              BT Double,              BT Double,
    385385                                                BT Double,              BT Double,              BT Double,              BT Double,              BT Double,              BT Double,
    386386                                                BT Double,              BT Double,              BT Double,       BT DoubleComplex,              BT Double,       BT DoubleComplex,
     
    390390                                  },
    391391                                  {
    392                 /*    DC */       BT DoubleComplex,       BT DoubleComplex,       BT DoubleComplex,       BT DoubleComplex,       BT DoubleComplex,       BT DoubleComplex,
     392                /*     DC */       BT DoubleComplex,       BT DoubleComplex,       BT DoubleComplex,       BT DoubleComplex,       BT DoubleComplex,       BT DoubleComplex,
    393393                                         BT DoubleComplex,       BT DoubleComplex,       BT DoubleComplex,       BT DoubleComplex,       BT DoubleComplex,       BT DoubleComplex,
    394394                                         BT DoubleComplex,       BT DoubleComplex,       BT DoubleComplex,       BT DoubleComplex,       BT DoubleComplex,       BT DoubleComplex,
     
    398398                                  },
    399399                                  {
    400                 /*  F80X */           BT uFloat64x,           BT uFloat64x,           BT uFloat64x,           BT uFloat64x,           BT uFloat64x,           BT uFloat64x,
     400                /*   F80X */           BT uFloat64x,           BT uFloat64x,           BT uFloat64x,           BT uFloat64x,           BT uFloat64x,           BT uFloat64x,
    401401                                             BT uFloat64x,           BT uFloat64x,           BT uFloat64x,           BT uFloat64x,           BT uFloat64x,           BT uFloat64x,
    402402                                             BT uFloat64x,           BT uFloat64x,           BT uFloat64x,    BT uFloat64xComplex,           BT uFloat64x,    BT uFloat64xComplex,
     
    406406                                  },
    407407                                  {
    408                 /* _FDXC */    BT uFloat64xComplex,    BT uFloat64xComplex,    BT uFloat64xComplex,    BT uFloat64xComplex,    BT uFloat64xComplex,    BT uFloat64xComplex,
     408                /*  _FDXC */    BT uFloat64xComplex,    BT uFloat64xComplex,    BT uFloat64xComplex,    BT uFloat64xComplex,    BT uFloat64xComplex,    BT uFloat64xComplex,
    409409                                      BT uFloat64xComplex,    BT uFloat64xComplex,    BT uFloat64xComplex,    BT uFloat64xComplex,    BT uFloat64xComplex,    BT uFloat64xComplex,
    410410                                      BT uFloat64xComplex,    BT uFloat64xComplex,    BT uFloat64xComplex,    BT uFloat64xComplex,    BT uFloat64xComplex,    BT uFloat64xComplex,
     
    414414                                  },
    415415                                  {
    416                 /*   F80*/           BT uuFloat80,           BT uuFloat80,           BT uuFloat80,           BT uuFloat80,           BT uuFloat80,           BT uuFloat80,
     416                /*    F80 */           BT uuFloat80,           BT uuFloat80,           BT uuFloat80,           BT uuFloat80,           BT uuFloat80,           BT uuFloat80,
    417417                                             BT uuFloat80,           BT uuFloat80,           BT uuFloat80,           BT uuFloat80,           BT uuFloat80,           BT uuFloat80,
    418418                                             BT uuFloat80,           BT uuFloat80,           BT uuFloat80,    BT uFloat64xComplex,           BT uuFloat80,    BT uFloat64xComplex,
     
    422422                                  },
    423423                                  {
    424                 /*   _FB */           BT uFloat128,           BT uFloat128,           BT uFloat128,           BT uFloat128,           BT uFloat128,           BT uFloat128,
     424                /*    _FB */           BT uFloat128,           BT uFloat128,           BT uFloat128,           BT uFloat128,           BT uFloat128,           BT uFloat128,
    425425                                             BT uFloat128,           BT uFloat128,           BT uFloat128,           BT uFloat128,           BT uFloat128,           BT uFloat128,
    426426                                             BT uFloat128,           BT uFloat128,           BT uFloat128,    BT uFloat128Complex,           BT uFloat128,    BT uFloat128Complex,
     
    430430                                  },
    431431                                  {
    432                 /* _FLDC */    BT uFloat128Complex,    BT uFloat128Complex,    BT uFloat128Complex,    BT uFloat128Complex,    BT uFloat128Complex,    BT uFloat128Complex,
     432                /*  _FLDC */    BT uFloat128Complex,    BT uFloat128Complex,    BT uFloat128Complex,    BT uFloat128Complex,    BT uFloat128Complex,    BT uFloat128Complex,
    433433                                      BT uFloat128Complex,    BT uFloat128Complex,    BT uFloat128Complex,    BT uFloat128Complex,    BT uFloat128Complex,    BT uFloat128Complex,
    434434                                      BT uFloat128Complex,    BT uFloat128Complex,    BT uFloat128Complex,    BT uFloat128Complex,    BT uFloat128Complex,    BT uFloat128Complex,
     
    438438                                  },
    439439                                  {
    440                 /*    FB */          BT uuFloat128,          BT uuFloat128,          BT uuFloat128,          BT uuFloat128,          BT uuFloat128,          BT uuFloat128,
     440                /*     FB */          BT uuFloat128,          BT uuFloat128,          BT uuFloat128,          BT uuFloat128,          BT uuFloat128,          BT uuFloat128,
    441441                                            BT uuFloat128,          BT uuFloat128,          BT uuFloat128,          BT uuFloat128,          BT uuFloat128,          BT uuFloat128,
    442442                                            BT uuFloat128,          BT uuFloat128,          BT uuFloat128,    BT uFloat128Complex,          BT uuFloat128,    BT uFloat128Complex,
     
    446446                                  },
    447447                                  {
    448                 /*    LD */          BT LongDouble,          BT LongDouble,          BT LongDouble,          BT LongDouble,          BT LongDouble,          BT LongDouble,
     448                /*     LD */          BT LongDouble,          BT LongDouble,          BT LongDouble,          BT LongDouble,          BT LongDouble,          BT LongDouble,
    449449                                            BT LongDouble,          BT LongDouble,          BT LongDouble,          BT LongDouble,          BT LongDouble,          BT LongDouble,
    450450                                            BT LongDouble,          BT LongDouble,          BT LongDouble,   BT LongDoubleComplex,          BT LongDouble,   BT LongDoubleComplex,
     
    454454                                  },
    455455                                  {
    456                 /*   LDC */   BT LongDoubleComplex,   BT LongDoubleComplex,   BT LongDoubleComplex,   BT LongDoubleComplex,   BT LongDoubleComplex,   BT LongDoubleComplex,
     456                /*    LDC */   BT LongDoubleComplex,   BT LongDoubleComplex,   BT LongDoubleComplex,   BT LongDoubleComplex,   BT LongDoubleComplex,   BT LongDoubleComplex,
    457457                                     BT LongDoubleComplex,   BT LongDoubleComplex,   BT LongDoubleComplex,   BT LongDoubleComplex,   BT LongDoubleComplex,   BT LongDoubleComplex,
    458458                                     BT LongDoubleComplex,   BT LongDoubleComplex,   BT LongDoubleComplex,   BT LongDoubleComplex,   BT LongDoubleComplex,   BT LongDoubleComplex,
     
    462462                                  },
    463463                                  {
    464                 /*  _FBX */          BT uFloat128x,          BT uFloat128x,          BT uFloat128x,          BT uFloat128x,          BT uFloat128x,          BT uFloat128x,
     464                /*   _FBX */          BT uFloat128x,          BT uFloat128x,          BT uFloat128x,          BT uFloat128x,          BT uFloat128x,          BT uFloat128x,
    465465                                            BT uFloat128x,          BT uFloat128x,          BT uFloat128x,          BT uFloat128x,          BT uFloat128x,          BT uFloat128x,
    466466                                            BT uFloat128x,          BT uFloat128x,          BT uFloat128x,   BT uFloat128xComplex,          BT uFloat128x,   BT uFloat128xComplex,
  • src/ResolvExpr/ConversionCost.cc

    rcc4218f rb3976bf  
    9898        }
    9999
    100         Cost convertToReferenceCost( const Type * src, const Type * dest, int diff, const SymTab::Indexer & indexer, const TypeEnvironment & env, PtrsFunction func ) {
     100        static Cost convertToReferenceCost( const Type * src, const Type * dest, int diff, const SymTab::Indexer & indexer, const TypeEnvironment & env, PtrsFunction func ) {
    101101                PRINT( std::cerr << "convert to reference cost... diff " << diff << " " << src << " / " << dest << std::endl; )
    102102                if ( diff > 0 ) {
     
    217217        // GENERATED BY BasicTypes-gen.cc
    218218        static const int costMatrix[BasicType::NUMBER_OF_BASIC_TYPES][BasicType::NUMBER_OF_BASIC_TYPES] = { // path length from root to node
    219                 /*             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 */
    220                 /*     B */ {   0,   1,   1,   2,   2,   3,   3,   4,   4,   5,   5,   6,   6,   7,   7,   8,   8,   9,   9,  10,  10,  11,  11,  12,  12,  13,  13,  14,  14,  15,  15,  16,  17,  16,  18,  17, },
    221                 /*     C */ {  -1,   0,   1,   1,   1,   2,   2,   3,   3,   4,   4,   5,   5,   6,   6,   7,   7,   8,   8,   9,   9,  10,  10,  11,  11,  12,  12,  13,  13,  14,  14,  15,  16,  15,  17,  16, },
    222                 /*    SC */ {  -1,  -1,   0,   1,   1,   2,   2,   3,   3,   4,   4,   5,   5,   6,   6,   7,   7,   8,   8,   9,   9,  10,  10,  11,  11,  12,  12,  13,  13,  14,  14,  15,  16,  15,  17,  16, },
    223                 /*    UC */ {  -1,  -1,  -1,   0,   1,   1,   2,   2,   3,   3,   4,   4,   5,   5,   6,   7,   7,   8,   8,   9,   9,  10,  10,  11,  11,  12,  12,  13,  13,  14,  14,  15,  16,  15,  17,  16, },
    224                 /*    SI */ {  -1,  -1,  -1,  -1,   0,   1,   1,   2,   2,   3,   3,   4,   4,   5,   5,   6,   6,   7,   7,   8,   8,   9,   9,  10,  10,  11,  11,  12,  12,  13,  13,  14,  15,  14,  16,  15, },
    225                 /*   SUI */ {  -1,  -1,  -1,  -1,  -1,   0,   1,   1,   2,   2,   3,   3,   4,   4,   5,   6,   6,   7,   7,   8,   8,   9,   9,  10,  10,  11,  11,  12,  12,  13,  13,  14,  15,  14,  16,  15, },
    226                 /*     I */ {  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   1,   2,   2,   3,   3,   4,   4,   5,   5,   6,   6,   7,   7,   8,   8,   9,   9,  10,  10,  11,  11,  12,  12,  13,  14,  13,  15,  14, },
    227                 /*    UI */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   1,   2,   2,   3,   3,   4,   5,   5,   6,   6,   7,   7,   8,   8,   9,   9,  10,  10,  11,  11,  12,  12,  13,  14,  13,  15,  14, },
    228                 /*    LI */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   1,   2,   2,   3,   3,   4,   4,   5,   5,   6,   6,   7,   7,   8,   8,   9,   9,  10,  10,  11,  11,  12,  13,  12,  14,  13, },
    229                 /*   LUI */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   1,   2,   2,   3,   4,   4,   5,   5,   6,   6,   7,   7,   8,   8,   9,   9,  10,  10,  11,  11,  12,  13,  12,  14,  13, },
    230                 /*   LLI */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   1,   2,   2,   3,   3,   4,   4,   5,   5,   6,   6,   7,   7,   8,   8,   9,   9,  10,  10,  11,  12,  11,  13,  12, },
    231                 /*  LLUI */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   1,   2,   3,   3,   4,   4,   5,   5,   6,   6,   7,   7,   8,   8,   9,   9,  10,  10,  11,  12,  11,  13,  12, },
    232                 /*    IB */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   1,   2,   2,   3,   3,   4,   4,   5,   5,   6,   6,   7,   7,   8,   8,   9,   9,  10,  11,  10,  12,  11, },
    233                 /*   UIB */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   2,   2,   3,   3,   4,   4,   5,   5,   6,   6,   7,   7,   8,   8,   9,   9,  10,  11,  10,  12,  11, },
    234                 /*   _FH */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   1,   2,   2,   3,   3,   4,   4,   5,   5,   6,   6,   7,   7,   8,   8,   9,  10,   9,  11,  10, },
    235                 /*   _FH */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,  -1,   1,  -1,   2,  -1,   3,  -1,   4,  -1,   5,  -1,   6,  -1,  -1,   7,  -1,  -1,   8,  -1,   9, },
    236                 /*    _F */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   1,   2,   2,   3,   3,   4,   4,   5,   5,   6,   6,   7,   7,   8,   9,   8,  10,   9, },
    237                 /*   _FC */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,  -1,   1,  -1,   2,  -1,   3,  -1,   4,  -1,   5,  -1,  -1,   6,  -1,  -1,   7,  -1,   8, },
    238                 /*     F */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   1,   2,   2,   3,   3,   4,   4,   5,   5,   6,   6,   7,   8,   7,   9,   8, },
    239                 /*    FC */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,  -1,   1,  -1,   2,  -1,   3,  -1,   4,  -1,  -1,   5,  -1,  -1,   6,  -1,   7, },
    240                 /*   _FX */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   1,   2,   2,   3,   3,   4,   4,   5,   5,   6,   7,   6,   8,   7, },
    241                 /*  _FXC */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,  -1,   1,  -1,   2,  -1,   3,  -1,  -1,   4,  -1,  -1,   5,  -1,   6, },
    242                 /*    FD */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   1,   2,   2,   3,   3,   4,   4,   5,   6,   5,   7,   6, },
    243                 /*  _FDC */ {  -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,   1,  -1,   2,  -1,  -1,   3,  -1,  -1,   4,  -1,   5, },
    244                 /*     D */ {  -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,   1,   1,   2,   2,   3,   3,   4,   5,   4,   6,   5, },
    245                 /*    DC */ {  -1,  -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,  -1,   1,  -1,  -1,   2,  -1,  -1,   3,  -1,   4, },
    246                 /*  F80X */ {  -1,  -1,  -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,   1,   1,   2,   2,   3,   4,   3,   5,   4, },
    247                 /* _FDXC */ {  -1,  -1,  -1,  -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,  -1,  -1,   1,  -1,  -1,   2,  -1,   3, },
    248                 /*   F80*/ {  -1,  -1,  -1,  -1,  -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,   1,   2,   2,   3,   3,   4,   4, },
    249                 /*   _FB */ {  -1,  -1,  -1,  -1,  -1,  -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,   1,   1,   2,   2,   3,   3, },
    250                 /* _FLDC */ {  -1,  -1,  -1,  -1,  -1,  -1,  -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,  -1,  -1,   1,  -1,   2, },
    251                 /*    FB */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -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,   1,   2,   2,   3, },
    252                 /*    LD */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -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,   1,   1,   2, },
    253                 /*   LDC */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -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,  -1,   1, },
    254                 /*  _FBX */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -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,   1, },
     219                /*               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 */
     220                /*      B */ {   0,   1,   1,   2,   2,   3,   3,   4,   4,   5,   5,   6,   6,   7,   7,   8,   8,   9,   9,  10,  10,  11,  11,  12,  12,  13,  13,  14,  14,  15,  15,  16,  17,  16,  18,  17, },
     221                /*      C */ {  -1,   0,   1,   1,   1,   2,   2,   3,   3,   4,   4,   5,   5,   6,   6,   7,   7,   8,   8,   9,   9,  10,  10,  11,  11,  12,  12,  13,  13,  14,  14,  15,  16,  15,  17,  16, },
     222                /*     SC */ {  -1,  -1,   0,   1,   1,   2,   2,   3,   3,   4,   4,   5,   5,   6,   6,   7,   7,   8,   8,   9,   9,  10,  10,  11,  11,  12,  12,  13,  13,  14,  14,  15,  16,  15,  17,  16, },
     223                /*     UC */ {  -1,  -1,  -1,   0,   1,   1,   2,   2,   3,   3,   4,   4,   5,   5,   6,   7,   7,   8,   8,   9,   9,  10,  10,  11,  11,  12,  12,  13,  13,  14,  14,  15,  16,  15,  17,  16, },
     224                /*     SI */ {  -1,  -1,  -1,  -1,   0,   1,   1,   2,   2,   3,   3,   4,   4,   5,   5,   6,   6,   7,   7,   8,   8,   9,   9,  10,  10,  11,  11,  12,  12,  13,  13,  14,  15,  14,  16,  15, },
     225                /*    SUI */ {  -1,  -1,  -1,  -1,  -1,   0,   1,   1,   2,   2,   3,   3,   4,   4,   5,   6,   6,   7,   7,   8,   8,   9,   9,  10,  10,  11,  11,  12,  12,  13,  13,  14,  15,  14,  16,  15, },
     226                /*      I */ {  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   1,   2,   2,   3,   3,   4,   4,   5,   5,   6,   6,   7,   7,   8,   8,   9,   9,  10,  10,  11,  11,  12,  12,  13,  14,  13,  15,  14, },
     227                /*     UI */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   1,   2,   2,   3,   3,   4,   5,   5,   6,   6,   7,   7,   8,   8,   9,   9,  10,  10,  11,  11,  12,  12,  13,  14,  13,  15,  14, },
     228                /*     LI */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   1,   2,   2,   3,   3,   4,   4,   5,   5,   6,   6,   7,   7,   8,   8,   9,   9,  10,  10,  11,  11,  12,  13,  12,  14,  13, },
     229                /*    LUI */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   1,   2,   2,   3,   4,   4,   5,   5,   6,   6,   7,   7,   8,   8,   9,   9,  10,  10,  11,  11,  12,  13,  12,  14,  13, },
     230                /*    LLI */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   1,   2,   2,   3,   3,   4,   4,   5,   5,   6,   6,   7,   7,   8,   8,   9,   9,  10,  10,  11,  12,  11,  13,  12, },
     231                /*   LLUI */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   1,   2,   3,   3,   4,   4,   5,   5,   6,   6,   7,   7,   8,   8,   9,   9,  10,  10,  11,  12,  11,  13,  12, },
     232                /*     IB */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   1,   2,   2,   3,   3,   4,   4,   5,   5,   6,   6,   7,   7,   8,   8,   9,   9,  10,  11,  10,  12,  11, },
     233                /*    UIB */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   2,   2,   3,   3,   4,   4,   5,   5,   6,   6,   7,   7,   8,   8,   9,   9,  10,  11,  10,  12,  11, },
     234                /*    _FH */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   1,   2,   2,   3,   3,   4,   4,   5,   5,   6,   6,   7,   7,   8,   8,   9,  10,   9,  11,  10, },
     235                /*    _FH */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,  -1,   1,  -1,   2,  -1,   3,  -1,   4,  -1,   5,  -1,   6,  -1,  -1,   7,  -1,  -1,   8,  -1,   9, },
     236                /*     _F */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   1,   2,   2,   3,   3,   4,   4,   5,   5,   6,   6,   7,   7,   8,   9,   8,  10,   9, },
     237                /*    _FC */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,  -1,   1,  -1,   2,  -1,   3,  -1,   4,  -1,   5,  -1,  -1,   6,  -1,  -1,   7,  -1,   8, },
     238                /*      F */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   1,   2,   2,   3,   3,   4,   4,   5,   5,   6,   6,   7,   8,   7,   9,   8, },
     239                /*     FC */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,  -1,   1,  -1,   2,  -1,   3,  -1,   4,  -1,  -1,   5,  -1,  -1,   6,  -1,   7, },
     240                /*    _FX */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   1,   2,   2,   3,   3,   4,   4,   5,   5,   6,   7,   6,   8,   7, },
     241                /*   _FXC */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,  -1,   1,  -1,   2,  -1,   3,  -1,  -1,   4,  -1,  -1,   5,  -1,   6, },
     242                /*     FD */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   1,   2,   2,   3,   3,   4,   4,   5,   6,   5,   7,   6, },
     243                /*   _FDC */ {  -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,   1,  -1,   2,  -1,  -1,   3,  -1,  -1,   4,  -1,   5, },
     244                /*      D */ {  -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,   1,   1,   2,   2,   3,   3,   4,   5,   4,   6,   5, },
     245                /*     DC */ {  -1,  -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,  -1,   1,  -1,  -1,   2,  -1,  -1,   3,  -1,   4, },
     246                /*   F80X */ {  -1,  -1,  -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,   1,   1,   2,   2,   3,   4,   3,   5,   4, },
     247                /*  _FDXC */ {  -1,  -1,  -1,  -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,  -1,  -1,   1,  -1,  -1,   2,  -1,   3, },
     248                /*    F80 */ {  -1,  -1,  -1,  -1,  -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,   1,   2,   2,   3,   3,   4,   4, },
     249                /*    _FB */ {  -1,  -1,  -1,  -1,  -1,  -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,   1,   1,   2,   2,   3,   3, },
     250                /*  _FLDC */ {  -1,  -1,  -1,  -1,  -1,  -1,  -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,  -1,  -1,   1,  -1,   2, },
     251                /*     FB */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -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,   1,   2,   2,   3, },
     252                /*     LD */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -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,   1,   1,   2, },
     253                /*    LDC */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -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,  -1,   1, },
     254                /*   _FBX */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -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,   1, },
    255255                /* _FLDXC */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -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, },
    256256        }; // costMatrix
     
    265265        // GENERATED BY BasicTypes-gen.cc
    266266        static const int signMatrix[BasicType::NUMBER_OF_BASIC_TYPES][BasicType::NUMBER_OF_BASIC_TYPES] = { // number of sign changes in safe conversion
    267                 /*             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 */
    268                 /*     B */ {   0,   0,   0,   1,   0,   1,   0,   1,   0,   1,   0,   1,   0,   1,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0, },
    269                 /*     C */ {  -1,   0,   0,   1,   0,   1,   0,   1,   0,   1,   0,   1,   0,   1,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0, },
    270                 /*    SC */ {  -1,  -1,   0,   1,   0,   1,   0,   1,   0,   1,   0,   1,   0,   1,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0, },
    271                 /*    UC */ {  -1,  -1,  -1,   0,   1,   0,   1,   0,   1,   0,   1,   0,   1,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0, },
    272                 /*    SI */ {  -1,  -1,  -1,  -1,   0,   1,   0,   1,   0,   1,   0,   1,   0,   1,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0, },
    273                 /*   SUI */ {  -1,  -1,  -1,  -1,  -1,   0,   1,   0,   1,   0,   1,   0,   1,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0, },
    274                 /*     I */ {  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   0,   1,   0,   1,   0,   1,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0, },
    275                 /*    UI */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   0,   1,   0,   1,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0, },
    276                 /*    LI */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   0,   1,   0,   1,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0, },
    277                 /*   LUI */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   0,   1,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0, },
    278                 /*   LLI */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   0,   1,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0, },
    279                 /*  LLUI */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0, },
    280                 /*    IB */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0, },
    281                 /*   UIB */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0, },
    282                 /*   _FH */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0, },
    283                 /*   _FH */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,  -1,   0,  -1,   0,  -1,   0,  -1,   0,  -1,   0,  -1,   0,  -1,  -1,   0,  -1,  -1,   0,  -1,   0, },
    284                 /*    _F */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0, },
    285                 /*   _FC */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,  -1,   0,  -1,   0,  -1,   0,  -1,   0,  -1,   0,  -1,  -1,   0,  -1,  -1,   0,  -1,   0, },
    286                 /*     F */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0, },
    287                 /*    FC */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,  -1,   0,  -1,   0,  -1,   0,  -1,   0,  -1,  -1,   0,  -1,  -1,   0,  -1,   0, },
    288                 /*   _FX */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0, },
    289                 /*  _FXC */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,  -1,   0,  -1,   0,  -1,   0,  -1,  -1,   0,  -1,  -1,   0,  -1,   0, },
    290                 /*    FD */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0, },
    291                 /*  _FDC */ {  -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,   0,  -1,   0,  -1,  -1,   0,  -1,  -1,   0,  -1,   0, },
    292                 /*     D */ {  -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,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0, },
    293                 /*    DC */ {  -1,  -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,  -1,   0,  -1,  -1,   0,  -1,  -1,   0,  -1,   0, },
    294                 /*  F80X */ {  -1,  -1,  -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,   0,   0,   0,   0,   0,   0,   0,   0,   0, },
    295                 /* _FDXC */ {  -1,  -1,  -1,  -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,  -1,  -1,   0,  -1,  -1,   0,  -1,   0, },
    296                 /*   F80*/ {  -1,  -1,  -1,  -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,   0,   0,   0,   0,   0,   0,   0,   0, },
    297                 /*   _FB */ {  -1,  -1,  -1,  -1,  -1,  -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,   0,   0,   0,   0,   0,   0, },
    298                 /* _FLDC */ {  -1,  -1,  -1,  -1,  -1,  -1,  -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,  -1,  -1,   0,  -1,   0, },
    299                 /*    FB */ {  -1,  -1,  -1,  -1,  -1,  -1,  -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,   0,   0,   0,   0,   0, },
    300                 /*    LD */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -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,   0,   0,   0, },
    301                 /*   LDC */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -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,  -1,   0, },
    302                 /*  _FBX */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -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,   0, },
     267                /*               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 */
     268                /*      B */ {   0,   0,   0,   1,   0,   1,   0,   1,   0,   1,   0,   1,   0,   1,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0, },
     269                /*      C */ {  -1,   0,   0,   1,   0,   1,   0,   1,   0,   1,   0,   1,   0,   1,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0, },
     270                /*     SC */ {  -1,  -1,   0,   1,   0,   1,   0,   1,   0,   1,   0,   1,   0,   1,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0, },
     271                /*     UC */ {  -1,  -1,  -1,   0,   1,   0,   1,   0,   1,   0,   1,   0,   1,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0, },
     272                /*     SI */ {  -1,  -1,  -1,  -1,   0,   1,   0,   1,   0,   1,   0,   1,   0,   1,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0, },
     273                /*    SUI */ {  -1,  -1,  -1,  -1,  -1,   0,   1,   0,   1,   0,   1,   0,   1,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0, },
     274                /*      I */ {  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   0,   1,   0,   1,   0,   1,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0, },
     275                /*     UI */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   0,   1,   0,   1,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0, },
     276                /*     LI */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   0,   1,   0,   1,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0, },
     277                /*    LUI */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   0,   1,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0, },
     278                /*    LLI */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   0,   1,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0, },
     279                /*   LLUI */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0, },
     280                /*     IB */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0, },
     281                /*    UIB */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0, },
     282                /*    _FH */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0, },
     283                /*    _FH */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,  -1,   0,  -1,   0,  -1,   0,  -1,   0,  -1,   0,  -1,   0,  -1,  -1,   0,  -1,  -1,   0,  -1,   0, },
     284                /*     _F */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0, },
     285                /*    _FC */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,  -1,   0,  -1,   0,  -1,   0,  -1,   0,  -1,   0,  -1,  -1,   0,  -1,  -1,   0,  -1,   0, },
     286                /*      F */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0, },
     287                /*     FC */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,  -1,   0,  -1,   0,  -1,   0,  -1,   0,  -1,  -1,   0,  -1,  -1,   0,  -1,   0, },
     288                /*    _FX */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0, },
     289                /*   _FXC */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,  -1,   0,  -1,   0,  -1,   0,  -1,  -1,   0,  -1,  -1,   0,  -1,   0, },
     290                /*     FD */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0, },
     291                /*   _FDC */ {  -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,   0,  -1,   0,  -1,  -1,   0,  -1,  -1,   0,  -1,   0, },
     292                /*      D */ {  -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,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0, },
     293                /*     DC */ {  -1,  -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,  -1,   0,  -1,  -1,   0,  -1,  -1,   0,  -1,   0, },
     294                /*   F80X */ {  -1,  -1,  -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,   0,   0,   0,   0,   0,   0,   0,   0,   0, },
     295                /*  _FDXC */ {  -1,  -1,  -1,  -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,  -1,  -1,   0,  -1,  -1,   0,  -1,   0, },
     296                /*    F80 */ {  -1,  -1,  -1,  -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,   0,   0,   0,   0,   0,   0,   0,   0, },
     297                /*    _FB */ {  -1,  -1,  -1,  -1,  -1,  -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,   0,   0,   0,   0,   0,   0, },
     298                /*  _FLDC */ {  -1,  -1,  -1,  -1,  -1,  -1,  -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,  -1,  -1,   0,  -1,   0, },
     299                /*     FB */ {  -1,  -1,  -1,  -1,  -1,  -1,  -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,   0,   0,   0,   0,   0, },
     300                /*     LD */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -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,   0,   0,   0, },
     301                /*    LDC */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -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,  -1,   0, },
     302                /*   _FBX */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -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,   0, },
    303303                /* _FLDXC */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -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, },
    304304        }; // signMatrix
     
    534534}
    535535
    536 Cost convertToReferenceCost( const ast::Type * src, const ast::Type * dst, int diff,
    537                 const ast::SymbolTable & symtab, const ast::TypeEnvironment & env,
     536static Cost convertToReferenceCost( const ast::Type * src, const ast::Type * dst,
     537                int diff, const ast::SymbolTable & symtab, const ast::TypeEnvironment & env,
    538538                NumCostCalculation func ) {
    539539        if ( 0 < diff ) {
  • src/SymTab/Validate.cc

    rcc4218f rb3976bf  
    99// Author           : Richard C. Bilson
    1010// Created On       : Sun May 17 21:50:04 2015
    11 // Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon Aug 28 13:47:23 2017
    13 // Update Count     : 359
     11// Last Modified By : Andrew Beach
     12// Last Modified On : Wed Aug  7 6:42:00 2019
     13// Update Count     : 360
    1414//
    1515
     
    8181#include "SynTree/Label.h"             // for operator==, Label
    8282#include "SynTree/Mutator.h"           // for Mutator
     83#include "SynTree/TopLvalue.h"         // for assertTopLvalue, clearInnerLvalue
    8384#include "SynTree/Type.h"              // for Type, TypeInstType, EnumInstType
    8485#include "SynTree/TypeSubstitution.h"  // for TypeSubstitution
     
    308309                PassVisitor<FixQualifiedTypes> fixQual;
    309310
     311                assertTopLvalue( translationUnit );
    310312                {
    311313                        Stats::Heap::newPass("validate-A");
     
    316318                        acceptAll( translationUnit, epc ); // must happen before VerifyCtorDtorAssign, because void return objects should not exist; before LinkReferenceToTypes_old because it is an indexer and needs correct types for mangling
    317319                }
     320                assertTopLvalue( translationUnit );
    318321                {
    319322                        Stats::Heap::newPass("validate-B");
    320323                        Stats::Time::BlockGuard guard("validate-B");
     324                        assertTopLvalue( translationUnit );
    321325                        Stats::Time::TimeBlock("Link Reference To Types", [&]() {
    322326                                acceptAll( translationUnit, lrt ); // must happen before autogen, because sized flag needs to propagate to generated functions
    323327                        });
     328                        clearInnerLvalue( translationUnit );
     329                        assertTopLvalue( translationUnit );
    324330                        Stats::Time::TimeBlock("Fix Qualified Types", [&]() {
    325331                                mutateAll( translationUnit, fixQual ); // must happen after LinkReferenceToTypes_old, because aggregate members are accessed
    326332                        });
     333                        assertTopLvalue( translationUnit );
    327334                        Stats::Time::TimeBlock("Hoist Structs", [&]() {
    328335                                HoistStruct::hoistStruct( translationUnit ); // must happen after EliminateTypedef, so that aggregate typedefs occur in the correct order
    329336                        });
     337                        assertTopLvalue( translationUnit );
    330338                        Stats::Time::TimeBlock("Eliminate Typedefs", [&]() {
    331339                                EliminateTypedef::eliminateTypedef( translationUnit ); //
    332340                        });
    333341                }
     342                assertTopLvalue( translationUnit );
    334343                {
    335344                        Stats::Heap::newPass("validate-C");
     
    340349                        InitTweak::fixReturnStatements( translationUnit ); // must happen before autogen
    341350                }
     351                assertTopLvalue( translationUnit );
    342352                {
    343353                        Stats::Heap::newPass("validate-D");
    344354                        Stats::Time::BlockGuard guard("validate-D");
     355                        assertTopLvalue( translationUnit );
    345356                        Stats::Time::TimeBlock("Apply Concurrent Keywords", [&]() {
    346357                                Concurrency::applyKeywords( translationUnit );
    347358                        });
     359                        clearInnerLvalue( translationUnit );
     360                        assertTopLvalue( translationUnit );
    348361                        Stats::Time::TimeBlock("Forall Pointer Decay", [&]() {
    349362                                acceptAll( translationUnit, fpd ); // must happen before autogenerateRoutines, after Concurrency::applyKeywords because uniqueIds must be set on declaration before resolution
    350363                        });
     364                        assertTopLvalue( translationUnit );
    351365                        Stats::Time::TimeBlock("Hoist Control Declarations", [&]() {
    352366                                ControlStruct::hoistControlDecls( translationUnit );  // hoist initialization out of for statements; must happen before autogenerateRoutines
    353367                        });
     368                        assertTopLvalue( translationUnit );
    354369                        Stats::Time::TimeBlock("Generate Autogen routines", [&]() {
    355370                                autogenerateRoutines( translationUnit ); // moved up, used to be below compoundLiteral - currently needs EnumAndPointerDecay_old
    356371                        });
    357                 }
     372                        clearInnerLvalue( translationUnit );
     373                }
     374                assertTopLvalue( translationUnit );
    358375                {
    359376                        Stats::Heap::newPass("validate-E");
    360377                        Stats::Time::BlockGuard guard("validate-E");
     378                        assertTopLvalue( translationUnit );
    361379                        Stats::Time::TimeBlock("Implement Mutex Func", [&]() {
    362380                                Concurrency::implementMutexFuncs( translationUnit );
    363381                        });
     382                        clearInnerLvalue( translationUnit );
     383                        assertTopLvalue( translationUnit );
    364384                        Stats::Time::TimeBlock("Implement Thread Start", [&]() {
    365385                                Concurrency::implementThreadStarter( translationUnit );
    366386                        });
     387                        assertTopLvalue( translationUnit );
    367388                        Stats::Time::TimeBlock("Compound Literal", [&]() {
    368389                                mutateAll( translationUnit, compoundliteral );
    369390                        });
     391                        assertTopLvalue( translationUnit );
    370392                        Stats::Time::TimeBlock("Resolve With Expressions", [&]() {
    371393                                ResolvExpr::resolveWithExprs( translationUnit ); // must happen before FixObjectType because user-code is resolved and may contain with variables
    372394                        });
    373                 }
     395                        clearInnerLvalue( translationUnit );
     396                }
     397                assertTopLvalue( translationUnit );
    374398                {
    375399                        Stats::Heap::newPass("validate-F");
    376400                        Stats::Time::BlockGuard guard("validate-F");
     401                        assertTopLvalue( translationUnit );
    377402                        Stats::Time::TimeBlock("Fix Object Type", [&]() {
    378403                                FixObjectType::fix( translationUnit );
    379404                        });
     405                        assertTopLvalue( translationUnit );
    380406                        Stats::Time::TimeBlock("Array Length", [&]() {
    381407                                ArrayLength::computeLength( translationUnit );
    382408                        });
     409                        clearInnerLvalue( translationUnit );
     410                        assertTopLvalue( translationUnit );
    383411                        Stats::Time::TimeBlock("Find Special Declarations", [&]() {
    384412                                Validate::findSpecialDecls( translationUnit );
    385413                        });
     414                        assertTopLvalue( translationUnit );
    386415                        Stats::Time::TimeBlock("Fix Label Address", [&]() {
    387416                                mutateAll( translationUnit, labelAddrFixer );
    388417                        });
     418                        assertTopLvalue( translationUnit );
    389419                        Stats::Time::TimeBlock("Handle Attributes", [&]() {
    390420                                Validate::handleAttributes( translationUnit );
    391421                        });
    392422                }
     423                assertTopLvalue( translationUnit );
    393424        }
    394425
  • src/SynTree/AddressExpr.cc

    rcc4218f rb3976bf  
    4242AddressExpr::AddressExpr( Expression *arg ) : Expression(), arg( arg ) {
    4343        if ( arg->result ) {
    44                 if ( arg->result->get_lvalue() ) {
     44                if ( arg->get_lvalue() ) {
    4545                        // lvalue, retains all layers of reference and gains a pointer inside the references
    4646                        set_result( addrType( arg->result ) );
  • src/SynTree/BasicType.cc

    rcc4218f rb3976bf  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Jan 31 21:37:36 2019
    13 // Update Count     : 12
     12// Last Modified On : Sun Aug  4 21:07:44 2019
     13// Update Count     : 13
    1414//
    1515
     
    3131bool BasicType::isInteger() const {
    3232        return kind <= UnsignedInt128;
    33 #if 0
    34         switch ( kind ) {
    35           case Bool:
    36           case Char:
    37           case SignedChar:
    38           case UnsignedChar:
    39           case ShortSignedInt:
    40           case ShortUnsignedInt:
    41           case SignedInt:
    42           case UnsignedInt:
    43           case LongSignedInt:
    44           case LongUnsignedInt:
    45           case LongLongSignedInt:
    46           case LongLongUnsignedInt:
    47           case SignedInt128:
    48           case UnsignedInt128:
    49                 return true;
    50           case Float:
    51           case Double:
    52           case LongDouble:
    53           case FloatComplex:
    54           case DoubleComplex:
    55           case LongDoubleComplex:
    56           case FloatImaginary:
    57           case DoubleImaginary:
    58           case LongDoubleImaginary:
    59           case Float80:
    60           case Float128:
    61                 return false;
    62           case NUMBER_OF_BASIC_TYPES:
    63                 assert( false );
    64         } // switch
    65         assert( false );
    66         return false;
    67 #endif
    6833}
    6934
  • src/SynTree/Expression.cc

    rcc4218f rb3976bf  
    99// Author           : Richard C. Bilson
    1010// Created On       : Mon May 18 07:44:20 2015
    11 // Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Jul 25 22:21:48 2019
    13 // Update Count     : 61
     11// Last Modified By : Andrew Beach
     12// Last Modified On : Wed Aug  7 17:03:00 2019
     13// Update Count     : 62
    1414//
    1515
     
    6161        delete env;
    6262        delete result;
     63}
     64
     65bool Expression::get_lvalue() const {
     66        return result->get_lvalue();
    6367}
    6468
  • src/SynTree/Expression.h

    rcc4218f rb3976bf  
    99// Author           : Richard C. Bilson
    1010// Created On       : Mon May 18 07:44:20 2015
    11 // Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Jul 25 22:21:44 2019
    13 // Update Count     : 50
     11// Last Modified By : Andrew Beach
     12// Last Modified On : Wed Aug  7 16:56:00 2019
     13// Update Count     : 51
    1414//
    1515
     
    7171        const Type * get_result() const { return result; }
    7272        void set_result( Type * newValue ) { result = newValue; }
     73        bool get_lvalue() const;
    7374
    7475        TypeSubstitution * get_env() const { return env; }
  • src/SynTree/Type.cc

    rcc4218f rb3976bf  
    99// Author           : Richard C. Bilson
    1010// Created On       : Mon May 18 07:44:20 2015
    11 // Last Modified By : Andrew Beach
    12 // Last Modified On : Fri Jul 12 15:48:00 2019
    13 // Update Count     : 44
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Sun Aug  4 21:05:07 2019
     13// Update Count     : 45
    1414//
    1515#include "Type.h"
     
    2424using namespace std;
    2525
    26 const char *BasicType::typeNames[] = {
    27 #if 0
    28         "_Bool",
    29         "char",
    30         "signed char",
    31         "unsigned char",
    32         "signed short int",
    33         "unsigned short int",
    34         "signed int",
    35         "unsigned int",
    36         "signed long int",
    37         "unsigned long int",
    38         "signed long long int",
    39         "unsigned long long int",
    40         "float",
    41         "double",
    42         "long double",
    43         "float _Complex",
    44         "double _Complex",
    45         "long double _Complex",
    46         "float _Imaginary",
    47         "double _Imaginary",
    48         "long double _Imaginary",
    49         "__int128",
    50         "unsigned __int128",
    51         "__float80",
    52         "__float128",
    53         "_Float16",
    54         "_Float32",
    55         "_Float32x",
    56         "_Float64",
    57         "_Float64x",
    58         "_Float128",
    59         "_Float128x",
    60         "_Float16 _Complex",
    61         "_Float32 _Complex",
    62         "_Float32x _Complex",
    63         "_Float64 _Complex",
    64         "_Float64x _Complex",
    65         "_Float128 _Complex",
    66         "_Float128x _Complex",
    67 #endif
     26const char * BasicType::typeNames[] = {
    6827        "_Bool",
    6928        "char",
     
    10766};
    10867static_assert(
    109         sizeof(BasicType::typeNames)/sizeof(BasicType::typeNames[0]) == BasicType::NUMBER_OF_BASIC_TYPES,
     68        sizeof(BasicType::typeNames) / sizeof(BasicType::typeNames[0]) == BasicType::NUMBER_OF_BASIC_TYPES,
    11069        "Each basic type name should have a corresponding kind enum value"
    11170);
     
    152111TypeSubstitution Type::genericSubstitution() const { assertf( false, "Non-aggregate type: %s", toCString( this ) ); }
    153112
    154 void Type::print( std::ostream &os, Indenter indent ) const {
     113void Type::print( std::ostream & os, Indenter indent ) const {
    155114        if ( ! forall.empty() ) {
    156115                os << "forall" << std::endl;
  • src/SynTree/module.mk

    rcc4218f rb3976bf  
    4949      SynTree/TypeSubstitution.cc \
    5050      SynTree/Attribute.cc \
    51       SynTree/DeclReplacer.cc
     51      SynTree/DeclReplacer.cc \
     52      SynTree/TopLvalue.cc
    5253
    5354SRC += $(SRC_SYNTREE)
  • src/main.cc

    rcc4218f rb3976bf  
    5959#include "ResolvExpr/Resolver.h"            // for resolve
    6060#include "SymTab/Validate.h"                // for validate
     61#include "SynTree/TopLvalue.h"              // for assertTopLvalue, clearInn...
    6162#include "SynTree/Declaration.h"            // for Declaration
    6263#include "SynTree/Visitor.h"                // for acceptAll
    6364#include "Tuples/Tuples.h"                  // for expandMemberTuples, expan...
    6465#include "Virtual/ExpandCasts.h"            // for expandCasts
     66
    6567
    6668using namespace std;
     
    257259                Stats::Time::StopBlock();
    258260
     261                //std::cerr << "Post-Parse Check" << std::endl;
     262                clearInnerLvalue( translationUnit );
     263                assertTopLvalue( translationUnit );
     264
    259265                // add the assignment statement after the initialization of a type parameter
    260266                PASS( "Validate", SymTab::validate( translationUnit, symtabp ) );
     
    275281                } // if
    276282
     283                assertTopLvalue( translationUnit );
    277284                PASS( "Fix Labels", ControlStruct::fixLabels( translationUnit ) );
     285                assertTopLvalue( translationUnit );
    278286                PASS( "Fix Names", CodeGen::fixNames( translationUnit ) );
     287                assertTopLvalue( translationUnit );
    279288                PASS( "Gen Init", InitTweak::genInit( translationUnit ) );
     289                assertTopLvalue( translationUnit );
    280290                PASS( "Expand Member Tuples" , Tuples::expandMemberTuples( translationUnit ) );
     291                assertTopLvalue( translationUnit );
    281292                if ( libcfap ) {
    282293                        // generate the bodies of cfa library functions
     
    302313                } // if
    303314
     315                assertTopLvalue( translationUnit );
     316
    304317                PASS( "Resolve", ResolvExpr::resolve( translationUnit ) );
    305318                if ( exprp ) {
     
    308321                } // if
    309322
     323                clearInnerLvalue( translationUnit );
     324                assertTopLvalue( translationUnit );
     325
    310326                // fix ObjectDecl - replaces ConstructorInit nodes
    311327                PASS( "Fix Init", InitTweak::fix( translationUnit, buildingLibrary() ) );
     328                clearInnerLvalue( translationUnit );
     329                assertTopLvalue( translationUnit );
    312330                if ( ctorinitp ) {
    313331                        dump ( translationUnit );
     
    316334
    317335                PASS( "Expand Unique Expr", Tuples::expandUniqueExpr( translationUnit ) ); // xxx - is this the right place for this? want to expand ASAP so tha, sequent passes don't need to worry about double-visiting a unique expr - needs to go after InitTweak::fix so that copy constructed return declarations are reused
     336                assertTopLvalue( translationUnit );
    318337
    319338                PASS( "Translate EHM" , ControlStruct::translateEHM( translationUnit ) );
     339                assertTopLvalue( translationUnit );
    320340
    321341                PASS( "Gen Waitfor" , Concurrency::generateWaitFor( translationUnit ) );
     342                clearInnerLvalue( translationUnit );
     343                assertTopLvalue( translationUnit );
    322344
    323345                PASS( "Convert Specializations",  GenPoly::convertSpecializations( translationUnit ) ); // needs to happen before tuple types are expanded
     346                clearInnerLvalue( translationUnit );
     347                assertTopLvalue( translationUnit );
    324348
    325349                PASS( "Expand Tuples", Tuples::expandTuples( translationUnit ) ); // xxx - is this the right place for this?
     350                assertTopLvalue( translationUnit );
    326351
    327352                if ( tuplep ) {
     
    331356
    332357                PASS( "Virtual Expand Casts", Virtual::expandCasts( translationUnit ) ); // Must come after translateEHM
     358                assertTopLvalue( translationUnit );
    333359
    334360                PASS( "Instantiate Generics", GenPoly::instantiateGeneric( translationUnit ) );
     
    337363                        return EXIT_SUCCESS;
    338364                } // if
     365                clearInnerLvalue( translationUnit );
     366                assertTopLvalue( translationUnit );
    339367                PASS( "Convert L-Value", GenPoly::convertLvalue( translationUnit ) );
    340 
     368                clearInnerLvalue( translationUnit );
     369                assertTopLvalue( translationUnit );
    341370
    342371                if ( bboxp ) {
     
    345374                } // if
    346375                PASS( "Box", GenPoly::box( translationUnit ) );
     376                clearInnerLvalue( translationUnit );
     377                assertTopLvalue( translationUnit );
    347378
    348379                if ( bcodegenp ) {
     
    356387
    357388                CodeTools::fillLocations( translationUnit );
     389                assertTopLvalue( translationUnit );
    358390                PASS( "Code Gen", CodeGen::generate( translationUnit, *output, ! genproto, prettycodegenp, true, linemarks ) );
    359391
  • tests/.expect/gccExtensions.x64.txt

    rcc4218f rb3976bf  
    291291    signed int _X2m2A0A0i_2[((unsigned long int )10)][((unsigned long int )10)];
    292292    signed int _X2m3A0A0i_2[((unsigned long int )10)][((unsigned long int )10)];
    293     {
    294         ((void)(_X12_retval_maini_1=0) /* ?{} */);
    295     }
    296 
    297     return _X12_retval_maini_1;
     293    void _X4f128Fv_n__2(__int128 _X1in_2);
     294    void _X4f128Fv_o__2(unsigned __int128 __anonymous_object0);
     295    __int128 _X6i128_0n_2;
     296    {
     297        ((void)_X4f128Fv_n__2(_X6i128_0n_2));
     298    }
     299
     300    unsigned __int128 _X6i128_1o_2;
     301    {
     302        ((void)_X4f128Fv_o__2(_X6i128_1o_2));
     303    }
     304
     305    __int128 _X6i128_2n_2;
     306    {
     307        ((void)_X4f128Fv_n__2(_X6i128_2n_2));
     308    }
     309
     310    unsigned __int128 _X6i128_3o_2;
     311    {
     312        ((void)_X4f128Fv_o__2(_X6i128_3o_2));
     313    }
     314
    298315    {
    299316        ((void)(_X12_retval_maini_1=0) /* ?{} */);
  • tests/.expect/gccExtensions.x86.txt

    rcc4218f rb3976bf  
    296296
    297297    return _X12_retval_maini_1;
    298     {
    299         ((void)(_X12_retval_maini_1=0) /* ?{} */);
    300     }
    301 
    302     return _X12_retval_maini_1;
    303298}
    304299static inline int invoke_main(int argc, char* argv[], char* envp[]) { (void)argc; (void)argv; (void)envp; return _X4mainFi_iPPKc__1((signed int )argc, (const char **)argv); }
  • tests/Makefile.in

    rcc4218f rb3976bf  
    235235CYGPATH_W = @CYGPATH_W@
    236236DEFS = @DEFS@
     237DEMANGLER = @DEMANGLER@
    237238DEPDIR = @DEPDIR@
    238239DLLTOOL = @DLLTOOL@
     
    260261LIBCFA_TARGET_DIRS = @LIBCFA_TARGET_DIRS@
    261262LIBCFA_TARGET_MAKEFILES = @LIBCFA_TARGET_MAKEFILES@
     263LIBDEMANGLE = @LIBDEMANGLE@
    262264LIBOBJS = @LIBOBJS@
    263265LIBS = @LIBS@
  • tests/gccExtensions.cfa

    rcc4218f rb3976bf  
    1010// Created On       : Sun Aug 14 17:28:17 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Nov  6 17:54:20 2018
    13 // Update Count     : 11
     12// Last Modified On : Mon Aug  5 18:04:37 2019
     13// Update Count     : 28
    1414//
    1515
     
    5050
    5151  L1: L2:
    52         asm goto ( "frob %%r5, %1; jc %l[L1]; mov (%2), %%r5"
    53                            : /* No outputs. */
    54                            : "r"(src), "r"(&dst)
    55                            : "r5", "memory"
    56                            : L1, L2 );
     52        asm goto ( "frob %%r5, %1; jc %l[L1]; mov (%2), %%r5"
     53                           : /* No outputs. */
     54                           : "r"(src), "r"(&dst)
     55                           : "r5", "memory"
     56                           : L1, L2 );
    5757
    5858        // alternative type/qualifer names
     
    110110        struct __attribute(()) s4 { int i; } x2, y2 __attribute(());
    111111
    112         int m1 [10] __attribute(());
    113         int m2 [10][10] __attribute(());
     112        int m1[10] __attribute(());
     113        int m2[10][10] __attribute(());
    114114        int __attribute(()) m3 [10][10];
    115115//      int ( __attribute(()) m4 [10] )[10];
    116116
    117         return 0;
     117        // int128
     118
     119#if defined( __SIZEOF_INT128__ )
     120        void f128( __int128 i );
     121        void f128( __uint128_t );
     122
     123        __int128 i128_0;
     124        f128( i128_0 );
     125        unsigned __int128 i128_1;
     126        f128( i128_1 );
     127        __int128_t i128_2;
     128        f128( i128_2 );
     129        __uint128_t i128_3;
     130        f128( i128_3 );
     131#endif
    118132}
    119133
  • tests/pybin/settings.py

    rcc4218f rb3976bf  
    1919class Architecture:
    2020        KnownArchitectures = {
    21                 'x64'                   : 'x64',
    22                 'x86-64'                : 'x64',
    23                 'x86_64'                : 'x64',
    24                 'aarch64'               : 'x64',
    25                 'x86'                   : 'x86',
     21                'x64'           : 'x64',
     22                'x86-64'        : 'x64',
     23                'x86_64'        : 'x64',
     24                'x86'           : 'x86',
     25                'aarch64'       : 'arm',
    2626                'i386'          : 'x86',
    2727                'i486'          : 'x86',
    2828                'i686'          : 'x86',
    2929                'Intel 80386'   : 'x86',
    30                 'arm'                   : 'arm',
    31                 'ARM'                   : 'arm',
     30                'arm'           : 'arm',
     31                'ARM'           : 'arm',
    3232        }
    3333
  • tools/Makefile.in

    rcc4218f rb3976bf  
    225225CYGPATH_W = @CYGPATH_W@
    226226DEFS = @DEFS@
     227DEMANGLER = @DEMANGLER@
    227228DEPDIR = @DEPDIR@
    228229DLLTOOL = @DLLTOOL@
     
    250251LIBCFA_TARGET_DIRS = @LIBCFA_TARGET_DIRS@
    251252LIBCFA_TARGET_MAKEFILES = @LIBCFA_TARGET_MAKEFILES@
     253LIBDEMANGLE = @LIBDEMANGLE@
    252254LIBOBJS = @LIBOBJS@
    253255LIBS = @LIBS@
  • tools/prettyprinter/Makefile.in

    rcc4218f rb3976bf  
    254254CYGPATH_W = @CYGPATH_W@
    255255DEFS = @DEFS@
     256DEMANGLER = @DEMANGLER@
    256257DEPDIR = @DEPDIR@
    257258DLLTOOL = @DLLTOOL@
     
    279280LIBCFA_TARGET_DIRS = @LIBCFA_TARGET_DIRS@
    280281LIBCFA_TARGET_MAKEFILES = @LIBCFA_TARGET_MAKEFILES@
     282LIBDEMANGLE = @LIBDEMANGLE@
    281283LIBOBJS = @LIBOBJS@
    282284LIBS = @LIBS@
Note: See TracChangeset for help on using the changeset viewer.