Changeset c018b85


Ignore:
Timestamp:
Jan 18, 2019, 4:30:07 PM (6 years ago)
Author:
Aaron Moss <a3moss@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, no_list, persistent-indexer, pthread-emulation, qualifiedEnum
Children:
0c13238
Parents:
e1f7eef (diff), bead1cf (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' into deferred_resn

Files:
1 added
19 edited
1 moved

Legend:

Unmodified
Added
Removed
  • doc/theses/aaron_moss_PhD/phd/background.tex

    re1f7eef rc018b85  
    213213The ability of types to begin or cease to satisfy traits when declarations go into or out of scope makes caching of trait satisfaction judgements difficult, and the ability of traits to take multiple type parameters can lead to a combinatorial explosion of work in any attempt to pre-compute trait satisfaction relationships.
    214214
    215 \subsection{Implicit Conversions}
     215\subsection{Implicit Conversions} \label{implicit-conv-sec}
    216216
    217217In addition to the multiple interpretations of an expression produced by name overloading and polymorphic functions, for backward compatibility \CFA{} must support all of the implicit conversions present in C, producing further candidate interpretations for expressions.
  • doc/theses/aaron_moss_PhD/phd/resolution-heuristics.tex

    re1f7eef rc018b85  
    22\label{resolution-chap}
    33
    4 Talk about the resolution heuristics. This is the bulk of the thesis.
     4The main task of the \CFACC{} type-checker is \emph{expression resolution}, determining which declarations the identifiers in each expression correspond to.
     5Resolution is a straightforward task in C, as each declaration has a unique identifier, but in \CFA{} the name overloading features discussed in Section~\ref{overloading-sec} generate multiple candidate declarations for each identifier.
     6I refer to a given matching between identifiers and declarations in an expression as an \emph{interpretation}; an interpretation also includes information about polymorphic type bindings and implicit casts to support the \CFA{} features discussed in Sections~\ref{poly-func-sec} and~\ref{implicit-conv-sec}, each of which increase the proportion of feasible candidate interpretations.
     7To choose between feasible interpretations, \CFA{} defines a \emph{conversion cost} to rank interpretations; the expression resolution problem is thus to find the unique minimal-cost interpretation for an expression, reporting an error if no such interpretation exists.
     8
     9\section{Conversion Cost}
     10
     11
    512
    613% Discuss changes to cost model, as promised in Ch. 2
     14
     15% Mention relevance of work to C++20 concepts
  • doc/working/exception/impl/exception.c

    re1f7eef rc018b85  
    243243
    244244                                        // Get a function pointer from the relative offset and call it
    245                                         // _Unwind_Reason_Code (*matcher)() = (_Unwind_Reason_Code (*)())lsd_info.LPStart + imatcher;                                   
     245                                        // _Unwind_Reason_Code (*matcher)() = (_Unwind_Reason_Code (*)())lsd_info.LPStart + imatcher;
    246246
    247247                                        _Unwind_Reason_Code (*matcher)() =
     
    320320        // on how the assembly works.
    321321        // Setup the personality routine
     322        #if defined(__PIC__)
     323        asm volatile (".cfi_personality 0x9b,CFA.ref.__gcfa_personality_v0");
     324        // Setup the exception table
     325        asm volatile (".cfi_lsda 0x1b, .LLSDACFA2");
     326        #else
    322327        asm volatile (".cfi_personality 0x3,__gcfa_personality_v0");
    323328        // Setup the exception table
    324329        asm volatile (".cfi_lsda 0x3, .LLSDACFA2");
     330        #endif
    325331
    326332        // Label which defines the start of the area for which the handler is setup
     
    356362// Some more works need to be done if we want to have a single
    357363// call to the try routine
     364#if defined(__PIC__)
     365asm (
     366        //HEADER
     367        ".LFECFA1:\n"
     368        "       .globl  __gcfa_personality_v0\n"
     369        "       .section        .gcc_except_table,\"a\",@progbits\n"
     370        ".LLSDACFA2:\n"                                                 //TABLE header
     371        "       .byte   0xff\n"
     372        "       .byte   0xff\n"
     373        "       .byte   0x1\n"
     374        "       .uleb128 .LLSDACSECFA2-.LLSDACSBCFA2\n"         // BODY length
     375        // Body uses language specific data and therefore could be modified arbitrarily
     376        ".LLSDACSBCFA2:\n"                                              // BODY start
     377        "       .uleb128 .TRYSTART-__try_terminate\n"           // Handled area start  (relative to start of function)
     378        "       .uleb128 .TRYEND-.TRYSTART\n"                           // Handled area length
     379        "       .uleb128 .CATCH-__try_terminate\n"                      // Handler landing pad adress  (relative to start of function)
     380        "       .uleb128 1\n"                                           // Action code, gcc seems to use always 0
     381        ".LLSDACSECFA2:\n"                                              // BODY end
     382        "       .text\n"                                                        // TABLE footer
     383        "       .size   __try_terminate, .-__try_terminate\n"
     384);
     385
     386// Somehow this piece of helps with the resolution of debug symbols.
     387__attribute__((unused)) static const int dummy = 0;
     388asm (
     389        "       .hidden CFA.ref.__gcfa_personality_v0\n"        // Declare an new hidden symbol
     390        "       .weak   CFA.ref.__gcfa_personality_v0\n"
     391        "       .section        .data.rel.local.CFA.ref.__gcfa_personality_v0,\"awG\",@progbits,CFA.ref.__gcfa_personality_v0,comdat\n" // No clue what this does specifically
     392        "       .align 8\n"
     393        "       .type CFA.ref.__gcfa_personality_v0, @object\n" // Type of our hidden symbol (it's not actually the function itself)
     394        "       .size CFA.ref.__gcfa_personality_v0, 8\n"               // Size of our hidden symbol
     395        "CFA.ref.__gcfa_personality_v0:\n"
     396        "       .quad __gcfa_personality_v0\n"
     397);
     398#else
    358399asm (
    359400        //HEADER
     
    375416        "       .text\n"                                                        // TABLE footer
    376417        "       .size   __try_terminate, .-__try_terminate\n"
    377         "       .ident  \"GCC: (Ubuntu 6.2.0-3ubuntu11~16.04) 6.2.0 20160901\"\n"
    378 //      "       .section        .note.GNU-stack,\"x\",@progbits\n"
    379418);
     419#endif
  • doc/working/exception/impl/pdc.s

    re1f7eef rc018b85  
    101101        .text
    102102        .size   foo, .-foo
    103         .ident  "GCC: (Ubuntu 7.3.0-21ubuntu1~16.04) 7.3.0"
     103        .ident  "GCC: (Ubuntu 7.4.0-1ubuntu1~16.04~ppa1) 7.4.0"
    104104        .section        .note.GNU-stack,"",@progbits
  • doc/working/exception/impl/pic.s

    re1f7eef rc018b85  
    11        .file   "test.c"
    22        .text
     3.Ltext0:
    34        .globl  clean
    45        .type   clean, @function
    56clean:
    67.LFB0:
     8        .file 1 "test.c"
     9        .loc 1 1 0
    710        .cfi_startproc
    811        pushq   %rbp
     
    1215        .cfi_def_cfa_register 6
    1316        movq    %rdi, -8(%rbp)
     17        .loc 1 1 0
    1418        nop
    1519        popq    %rbp
     
    2327foo:
    2428.LFB1:
     29        .loc 1 4 0
    2530        .cfi_startproc
    2631        .cfi_personality 0x9b,DW.ref.__gcc_personality_v0
     
    3944        .cfi_offset 3, -40
    4045        movl    %edi, -52(%rbp)
     46        .loc 1 4 0
    4147        movq    %fs:40, %rax
    4248        movq    %rax, -40(%rbp)
    4349        xorl    %eax, %eax
     50        .loc 1 6 0
    4451        movl    -52(%rbp), %eax
    4552        movl    %eax, %edi
     
    5057        movl    $0, %r12d
    5158.L7:
     59        .loc 1 5 0
    5260        leaq    -44(%rbp), %rax
    5361        movq    %rax, %rdi
     
    5664        cmpl    $1, %r12d
    5765        je      .L4
     66        .loc 1 6 0
    5867        movl    %r13d, %eax
     68        .loc 1 7 0
    5969        movq    -40(%rbp), %rdx
    6070        xorq    %fs:40, %rdx
     
    6474        movq    %rax, %rbx
    6575        movl    $1, %r12d
     76        .loc 1 5 0
    6677        jmp     .L7
    6778.L4:
     
    7182.LEHE1:
    7283.L10:
     84        .loc 1 7 0
    7385        call    __stack_chk_fail@PLT
    7486.L8:
     
    101113        .text
    102114        .size   foo, .-foo
     115.Letext0:
     116        .section        .debug_info,"",@progbits
     117.Ldebug_info0:
     118        .long   0x9c
     119        .value  0x4
     120        .long   .Ldebug_abbrev0
     121        .byte   0x8
     122        .uleb128 0x1
     123        .long   .LASF0
     124        .byte   0xc
     125        .long   .LASF1
     126        .long   .LASF2
     127        .quad   .Ltext0
     128        .quad   .Letext0-.Ltext0
     129        .long   .Ldebug_line0
     130        .uleb128 0x2
     131        .string "foo"
     132        .byte   0x1
     133        .byte   0x4
     134        .long   0x68
     135        .quad   .LFB1
     136        .quad   .LFE1-.LFB1
     137        .uleb128 0x1
     138        .byte   0x9c
     139        .long   0x68
     140        .uleb128 0x3
     141        .string "x"
     142        .byte   0x1
     143        .byte   0x4
     144        .long   0x68
     145        .uleb128 0x3
     146        .byte   0x91
     147        .sleb128 -68
     148        .uleb128 0x4
     149        .string "i"
     150        .byte   0x1
     151        .byte   0x5
     152        .long   0x68
     153        .uleb128 0x2
     154        .byte   0x91
     155        .sleb128 -60
     156        .byte   0
     157        .uleb128 0x5
     158        .byte   0x4
     159        .byte   0x5
     160        .string "int"
     161        .uleb128 0x6
     162        .long   .LASF3
     163        .byte   0x1
     164        .byte   0x1
     165        .quad   .LFB0
     166        .quad   .LFE0-.LFB0
     167        .uleb128 0x1
     168        .byte   0x9c
     169        .long   0x99
     170        .uleb128 0x3
     171        .string "p"
     172        .byte   0x1
     173        .byte   0x1
     174        .long   0x99
     175        .uleb128 0x2
     176        .byte   0x91
     177        .sleb128 -24
     178        .byte   0
     179        .uleb128 0x7
     180        .byte   0x8
     181        .long   0x68
     182        .byte   0
     183        .section        .debug_abbrev,"",@progbits
     184.Ldebug_abbrev0:
     185        .uleb128 0x1
     186        .uleb128 0x11
     187        .byte   0x1
     188        .uleb128 0x25
     189        .uleb128 0xe
     190        .uleb128 0x13
     191        .uleb128 0xb
     192        .uleb128 0x3
     193        .uleb128 0xe
     194        .uleb128 0x1b
     195        .uleb128 0xe
     196        .uleb128 0x11
     197        .uleb128 0x1
     198        .uleb128 0x12
     199        .uleb128 0x7
     200        .uleb128 0x10
     201        .uleb128 0x17
     202        .byte   0
     203        .byte   0
     204        .uleb128 0x2
     205        .uleb128 0x2e
     206        .byte   0x1
     207        .uleb128 0x3f
     208        .uleb128 0x19
     209        .uleb128 0x3
     210        .uleb128 0x8
     211        .uleb128 0x3a
     212        .uleb128 0xb
     213        .uleb128 0x3b
     214        .uleb128 0xb
     215        .uleb128 0x27
     216        .uleb128 0x19
     217        .uleb128 0x49
     218        .uleb128 0x13
     219        .uleb128 0x11
     220        .uleb128 0x1
     221        .uleb128 0x12
     222        .uleb128 0x7
     223        .uleb128 0x40
     224        .uleb128 0x18
     225        .uleb128 0x2116
     226        .uleb128 0x19
     227        .uleb128 0x1
     228        .uleb128 0x13
     229        .byte   0
     230        .byte   0
     231        .uleb128 0x3
     232        .uleb128 0x5
     233        .byte   0
     234        .uleb128 0x3
     235        .uleb128 0x8
     236        .uleb128 0x3a
     237        .uleb128 0xb
     238        .uleb128 0x3b
     239        .uleb128 0xb
     240        .uleb128 0x49
     241        .uleb128 0x13
     242        .uleb128 0x2
     243        .uleb128 0x18
     244        .byte   0
     245        .byte   0
     246        .uleb128 0x4
     247        .uleb128 0x34
     248        .byte   0
     249        .uleb128 0x3
     250        .uleb128 0x8
     251        .uleb128 0x3a
     252        .uleb128 0xb
     253        .uleb128 0x3b
     254        .uleb128 0xb
     255        .uleb128 0x49
     256        .uleb128 0x13
     257        .uleb128 0x2
     258        .uleb128 0x18
     259        .byte   0
     260        .byte   0
     261        .uleb128 0x5
     262        .uleb128 0x24
     263        .byte   0
     264        .uleb128 0xb
     265        .uleb128 0xb
     266        .uleb128 0x3e
     267        .uleb128 0xb
     268        .uleb128 0x3
     269        .uleb128 0x8
     270        .byte   0
     271        .byte   0
     272        .uleb128 0x6
     273        .uleb128 0x2e
     274        .byte   0x1
     275        .uleb128 0x3f
     276        .uleb128 0x19
     277        .uleb128 0x3
     278        .uleb128 0xe
     279        .uleb128 0x3a
     280        .uleb128 0xb
     281        .uleb128 0x3b
     282        .uleb128 0xb
     283        .uleb128 0x27
     284        .uleb128 0x19
     285        .uleb128 0x11
     286        .uleb128 0x1
     287        .uleb128 0x12
     288        .uleb128 0x7
     289        .uleb128 0x40
     290        .uleb128 0x18
     291        .uleb128 0x2117
     292        .uleb128 0x19
     293        .uleb128 0x1
     294        .uleb128 0x13
     295        .byte   0
     296        .byte   0
     297        .uleb128 0x7
     298        .uleb128 0xf
     299        .byte   0
     300        .uleb128 0xb
     301        .uleb128 0xb
     302        .uleb128 0x49
     303        .uleb128 0x13
     304        .byte   0
     305        .byte   0
     306        .byte   0
     307        .section        .debug_aranges,"",@progbits
     308        .long   0x2c
     309        .value  0x2
     310        .long   .Ldebug_info0
     311        .byte   0x8
     312        .byte   0
     313        .value  0
     314        .value  0
     315        .quad   .Ltext0
     316        .quad   .Letext0-.Ltext0
     317        .quad   0
     318        .quad   0
     319        .section        .debug_line,"",@progbits
     320.Ldebug_line0:
     321        .section        .debug_str,"MS",@progbits,1
     322.LASF0:
     323        .string "GNU C11 7.4.0 -mtune=generic -march=x86-64 -g -fexceptions -fPIC -fstack-protector-strong"
     324.LASF2:
     325        .string "/home/tdelisle/workspace/cforall/main/doc/working/exception/impl"
     326.LASF1:
     327        .string "test.c"
     328.LASF3:
     329        .string "clean"
    103330        .hidden DW.ref.__gcc_personality_v0
    104331        .weak   DW.ref.__gcc_personality_v0
    105         .section        .data.DW.ref.__gcc_personality_v0,"awG",@progbits,DW.ref.__gcc_personality_v0,comdat
     332        .section        .data.rel.local.DW.ref.__gcc_personality_v0,"awG",@progbits,DW.ref.__gcc_personality_v0,comdat
    106333        .align 8
    107334        .type   DW.ref.__gcc_personality_v0, @object
     
    109336DW.ref.__gcc_personality_v0:
    110337        .quad   __gcc_personality_v0
    111         .ident  "GCC: (Ubuntu 7.3.0-21ubuntu1~16.04) 7.3.0"
     338        .ident  "GCC: (Ubuntu 7.4.0-1ubuntu1~16.04~ppa1) 7.4.0"
    112339        .section        .note.GNU-stack,"",@progbits
  • driver/cfa.cc

    re1f7eef rc018b85  
    1010// Created On       : Tue Aug 20 13:44:49 2002
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Sep 14 23:02:59 2018
    13 // Update Count     : 277
     12// Last Modified On : Tue Jan 15 20:56:03 2019
     13// Update Count     : 280
    1414//
    1515
     
    384384        nargs += 1;
    385385
     386        for ( int i = 0; i < nlibs; i += 1 ) {                          // copy non-user libraries after all user libraries
     387                args[nargs] = libs[i];
     388                nargs += 1;
     389        } // for
     390
    386391        if ( link ) {
    387392                args[nargs] = "-Xlinker";
     
    414419                nargs += 1;
    415420                args[nargs] = "-lrt";
     421                nargs += 1;
     422                args[nargs] = "-lm";
    416423                nargs += 1;
    417424        } // if
     
    498505                args[nargs] = ( *new string( string("-B") + Bprefix ) ).c_str();
    499506                nargs += 1;
    500                 args[nargs] = "-lm";
    501                 nargs += 1;
    502507        } else {
    503508                cerr << argv[0] << " error, compiler \"" << compiler_name << "\" unsupported." << endl;
    504509                exit( EXIT_FAILURE );
    505510        } // if
    506 
    507         for ( int i = 0; i < nlibs; i += 1 ) {                          // copy non-user libraries after all user libraries
    508                 args[nargs] = libs[i];
    509                 nargs += 1;
    510         } // for
    511511
    512512        args[nargs] = NULL;                                                                     // terminate with NULL
  • libcfa/src/concurrency/coroutine.cfa

    re1f7eef rc018b85  
    8383
    8484void ^?{}(coroutine_desc& this) {
    85       if(this.state != Halted) {
     85      if(this.state != Halted && this.state != Start) {
    8686            coroutine_desc * src = TL_GET( this_coroutine );
    8787            coroutine_desc * dst = &this;
  • src/Concurrency/Keywords.cc

    re1f7eef rc018b85  
    575575
    576576                //in reverse order :
    577                 // monitor_guard_t __guard = { __monitors, #, func };
     577                // monitor_dtor_guard_t __guard = { __monitors, func };
    578578                body->push_front(
    579579                        new DeclStmt( new ObjectDecl(
     
    634634                assert(generic_func);
    635635
    636                 //in reverse order :
     636                // in reverse order :
    637637                // monitor_guard_t __guard = { __monitors, #, func };
    638638                body->push_front(
  • src/Concurrency/Waitfor.cc

    re1f7eef rc018b85  
    6666void foo() {
    6767        while( true ) {
    68 
    69                 acceptable_t acceptables[3];
    70                 if( a < 1 ) {
    71                         acceptables[0].func = f;
    72                         acceptables[0].mon = a;
    73                 }
    74                 acceptables[1].func = g;
    75                 acceptables[1].mon = a;
    76 
    77                 acceptables[2].func = f;
    78                 acceptables[2].mon = a;
    79                 acceptables[2].is_dtor = true;
    80 
    81                 int ret = waitfor_internal( acceptables, swagl() );
    82 
    83                 switch( ret ) {
    84                         case 0:
    85                         {
    86                                 bar();
     68                {
     69                        acceptable_t acceptables[3];
     70                        if( a < 1 ) {
     71                                acceptables[0].func = f;
     72                                acceptables[0].mon = a;
    8773                        }
    88                         case 1:
    89                         {
    90                                 baz();
     74                        acceptables[1].func = g;
     75                        acceptables[1].mon = a;
     76
     77                        acceptables[2].func = f;
     78                        acceptables[2].mon = a;
     79                        acceptables[2].is_dtor = true;
     80
     81                        int ret = waitfor_internal( acceptables, swagl() );
     82
     83                        switch( ret ) {
     84                                case 0:
     85                                {
     86                                        bar();
     87                                }
     88                                case 1:
     89                                {
     90                                        baz();
     91                                }
     92                                case 2:
     93                                        signal(a);
     94                                        {
     95                                                break;
     96                                        }
    9197                        }
    92                         case 2:
    93                                 signal(a);
    94                                 {
    95                                         break;
    96                                 }
    9798                }
    9899        }
     
    555556                                        new ConstantExpr( Constant::from_ulong( i++ ) ),
    556557                                        {
    557                                                 clause.statement,
    558                                                 new BranchStmt(
    559                                                         "",
    560                                                         BranchStmt::Break
    561                                                 )
     558                                                new CompoundStmt({
     559                                                        clause.statement,
     560                                                        new BranchStmt(
     561                                                                "",
     562                                                                BranchStmt::Break
     563                                                        )
     564                                                })
    562565                                        }
    563566                                )
     
    570573                                        new ConstantExpr( Constant::from_int( -2 ) ),
    571574                                        {
    572                                                 waitfor->timeout.statement,
    573                                                 new BranchStmt(
    574                                                         "",
    575                                                         BranchStmt::Break
    576                                                 )
     575                                                new CompoundStmt({
     576                                                        waitfor->timeout.statement,
     577                                                        new BranchStmt(
     578                                                                "",
     579                                                                BranchStmt::Break
     580                                                        )
     581                                                })
    577582                                        }
    578583                                )
     
    585590                                        new ConstantExpr( Constant::from_int( -1 ) ),
    586591                                        {
    587                                                 waitfor->orelse.statement,
    588                                                 new BranchStmt(
    589                                                         "",
    590                                                         BranchStmt::Break
    591                                                 )
     592                                                new CompoundStmt({
     593                                                        waitfor->orelse.statement,
     594                                                        new BranchStmt(
     595                                                                "",
     596                                                                BranchStmt::Break
     597                                                        )
     598                                                })
    592599                                        }
    593600                                )
  • src/Parser/TypeData.cc

    re1f7eef rc018b85  
    322322                        function.params->printList( os, indent + 4 );
    323323                } else {
    324                         os << string( indent + 2, ' ' ) << "with no parameters " << endl;
     324                        os << string( indent + 2, ' ' ) << "with no parameters" << endl;
    325325                } // if
    326326                if ( function.idList ) {
     
    347347                os << DeclarationNode::aggregateNames[ aggregate.kind ] << ' ' << *aggregate.name << endl;
    348348                if ( aggregate.params ) {
    349                         os << string( indent + 2, ' ' ) << "with type parameters " << endl;
     349                        os << string( indent + 2, ' ' ) << "with type parameters" << endl;
    350350                        aggregate.params->printList( os, indent + 4 );
    351351                } // if
    352352                if ( aggregate.actuals ) {
    353                         os << string( indent + 2, ' ' ) << "instantiated with actual parameters " << endl;
     353                        os << string( indent + 2, ' ' ) << "instantiated with actual parameters" << endl;
    354354                        aggregate.actuals->printList( os, indent + 4 );
    355355                } // if
    356356                if ( aggregate.fields ) {
    357                         os << string( indent + 2, ' ' ) << "with members " << endl;
     357                        os << string( indent + 2, ' ' ) << "with members" << endl;
    358358                        aggregate.fields->printList( os, indent + 4 );
    359359                } // if
    360360                if ( aggregate.body ) {
    361                         os << string( indent + 2, ' ' ) << " with body " << endl;
     361                        os << string( indent + 2, ' ' ) << " with body" << endl;
    362362                } // if
    363363                break;
     
    370370                } // if
    371371                if ( aggInst.params ) {
    372                         os << string( indent + 2, ' ' ) << "with parameters " << endl;
     372                        os << string( indent + 2, ' ' ) << "with parameters" << endl;
    373373                        aggInst.params->printList( os, indent + 2 );
    374374                } // if
     
    381381                } // if
    382382                if ( enumeration.body ) {
    383                         os << string( indent + 2, ' ' ) << " with body " << endl;
     383                        os << string( indent + 2, ' ' ) << " with body" << endl;
    384384                } // if
    385385                break;
     
    418418                os << "tuple ";
    419419                if ( tuple ) {
    420                         os << "with members " << endl;
     420                        os << "with members" << endl;
    421421                        tuple->printList( os, indent + 2 );
    422422                } // if
     
    942942        assert( td->typeexpr );
    943943        // assert( td->typeexpr->expr );
    944         return new TypeofType{ 
     944        return new TypeofType{
    945945                buildQualifiers( td ), td->typeexpr->build(), td->kind == TypeData::Basetypeof };
    946946} // buildTypeof
  • src/ResolvExpr/AlternativeFinder.cc

    re1f7eef rc018b85  
    474474                }
    475475
    476                 // mark specialization cost of return types
    477                 for ( DeclarationWithType* returnVal : function->returnVals ) {
    478                         convCost.decSpec( specCost( returnVal->get_type() ) );
    479                 }
     476                // specialization cost of return types can't be accounted for directly, it disables
     477                // otherwise-identical calls, like this example based on auto-newline in the I/O lib:
     478                //
     479                //   forall(otype OS) {
     480                //     void ?|?(OS&, int);  // with newline
     481                //     OS&  ?|?(OS&, int);  // no newline, always chosen due to more specialization
     482                //   }
    480483
    481484                // mark type variable and specialization cost of forall clause
     
    483486                for ( TypeDecl* td : function->forall ) {
    484487                        convCost.decSpec( td->assertions.size() );
    485                 }
    486 
    487                 // xxx -- replace with new costs in resolver
    488                 for ( InferredParams::const_iterator assert = appExpr->inferParams.begin(); assert != appExpr->inferParams.end(); ++assert ) {
    489                         convCost += computeConversionCost( assert->second.actualType, assert->second.formalType, indexer, alt.env );
    490488                }
    491489
     
    12291227                                Alternative newAlt{
    12301228                                        restructureCast( alt.expr->clone(), toType, castExpr->isGenerated ),
    1231                                         alt.env, openVars, needAssertions, alt.cost + thisCost, thisCost };
     1229                                        alt.env, openVars, needAssertions, alt.cost, alt.cost + thisCost };
    12321230                                inferParameters( newAlt, back_inserter( candidates ) );
    12331231                        } // if
  • src/SynTree/Expression.cc

    re1f7eef rc018b85  
    456456
    457457void UntypedExpr::print( std::ostream &os, Indenter indent ) const {
    458         os << "Applying untyped: " << std::endl;
     458        os << "Applying untyped:" << std::endl;
    459459        os << indent+1;
    460460        function->print(os, indent+1);
    461         os << std::endl << indent << "...to: " << std::endl;
     461        os << std::endl << indent << "...to:" << std::endl;
    462462        printAll(args, os, indent+1);
    463463        Expression::print( os, indent );
  • src/SynTree/ReferenceToType.cc

    re1f7eef rc018b85  
    205205
    206206        Type::print( os, indent );
    207         os << "instance of " << typeString() << " " << get_name() << " (" << ( isFtype ? "" : "not" ) << " function type) ";
     207        os << "instance of " << typeString() << " " << get_name() << " (" << ( isFtype ? "" : "not" ) << " function type)";
    208208        if ( ! parameters.empty() ) {
    209209                os << endl << indent << "... with parameters" << endl;
  • src/SynTree/Type.cc

    re1f7eef rc018b85  
    118118
    119119void QualifiedType::print( std::ostream & os, Indenter indent ) const {
    120         os << "Qualified Type: " << endl;
     120        os << "Qualified Type:" << endl;
    121121        os << indent+1;
    122122        parent->print( os, indent+1 );
  • src/main.cc

    re1f7eef rc018b85  
    1010// Created On       : Fri May 15 23:12:02 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Jun  6 15:51:47 2018
    13 // Update Count     : 498
     12// Last Modified On : Wed Dec 26 08:11:19 2018
     13// Update Count     : 499
    1414//
    1515
     
    371371                        }
    372372                } catch(const std::exception& e) {
    373                         std::cerr << "Unaught Exception \"" << e.what() << "\"\n";
     373                        std::cerr << "Uncaught Exception \"" << e.what() << "\"\n";
    374374                }
    375375                return 1;
  • tests/.expect/alloc-ERROR.txt

    re1f7eef rc018b85  
    1 alloc.cfa:265:1 error: No reasonable alternatives for expression Applying untyped: 
     1alloc.cfa:265:1 error: No reasonable alternatives for expression Applying untyped:
    22  Name: ?=?
    3 ...to: 
     3...to:
    44  Name: p
    5   Applying untyped: 
     5  Applying untyped:
    66    Name: realloc
    7   ...to: 
     7  ...to:
    88    Name: stp
    9     Applying untyped: 
     9    Applying untyped:
    1010      Name: ?*?
    11     ...to: 
     11    ...to:
    1212      Name: dim
    13       Sizeof Expression on: Applying untyped: 
     13      Sizeof Expression on: Applying untyped:
    1414          Name: *?
    15         ...to: 
     15        ...to:
    1616          Name: stp
    1717
     
    1919
    2020
    21 alloc.cfa:266:1 error: No reasonable alternatives for expression Applying untyped: 
     21alloc.cfa:266:1 error: No reasonable alternatives for expression Applying untyped:
    2222  Name: ?=?
    23 ...to: 
     23...to:
    2424  Name: p
    25   Applying untyped: 
     25  Applying untyped:
    2626    Name: alloc
    27   ...to: 
     27  ...to:
    2828    Name: stp
    29     Applying untyped: 
     29    Applying untyped:
    3030      Name: ?*?
    31     ...to: 
     31    ...to:
    3232      Name: dim
    33       Sizeof Expression on: Applying untyped: 
     33      Sizeof Expression on: Applying untyped:
    3434          Name: *?
    35         ...to: 
     35        ...to:
    3636          Name: stp
    3737
     
    3939
    4040
    41 alloc.cfa:267:1 error: No reasonable alternatives for expression Applying untyped: 
     41alloc.cfa:267:1 error: No reasonable alternatives for expression Applying untyped:
    4242  Name: ?=?
    43 ...to: 
     43...to:
    4444  Name: p
    45   Applying untyped: 
     45  Applying untyped:
    4646    Name: memset
    47   ...to: 
     47  ...to:
    4848    Name: stp
    4949    constant expression (10 10: signed int)
    5050
    5151
    52 alloc.cfa:268:1 error: No reasonable alternatives for expression Applying untyped: 
     52alloc.cfa:268:1 error: No reasonable alternatives for expression Applying untyped:
    5353  Name: ?=?
    54 ...to: 
     54...to:
    5555  Name: p
    56   Applying untyped: 
     56  Applying untyped:
    5757    Name: memcpy
    58   ...to: 
     58  ...to:
    5959    Address of:
    6060      Name: st1
  • tests/.expect/completeTypeError.txt

    re1f7eef rc018b85  
    1 completeTypeError.cfa:33:1 error: No reasonable alternatives for expression Applying untyped: 
     1completeTypeError.cfa:33:1 error: No reasonable alternatives for expression Applying untyped:
    22  Name: *?
    3 ...to: 
     3...to:
    44  Name: v
    55
    6 completeTypeError.cfa:34:1 error: No reasonable alternatives for expression Applying untyped: 
     6completeTypeError.cfa:34:1 error: No reasonable alternatives for expression Applying untyped:
    77  Name: *?
    8 ...to: 
     8...to:
    99  Name: y
    1010
    11 completeTypeError.cfa:35:1 error: No reasonable alternatives for expression Applying untyped: 
     11completeTypeError.cfa:35:1 error: No reasonable alternatives for expression Applying untyped:
    1212  Name: foo
    13 ...to: 
     13...to:
    1414  Name: v
    1515
    16 completeTypeError.cfa:36:1 error: No reasonable alternatives for expression Applying untyped: 
     16completeTypeError.cfa:36:1 error: No reasonable alternatives for expression Applying untyped:
    1717  Name: baz
    18 ...to: 
     18...to:
    1919  Name: v
    2020
    21 completeTypeError.cfa:37:1 error: No reasonable alternatives for expression Applying untyped: 
     21completeTypeError.cfa:37:1 error: No reasonable alternatives for expression Applying untyped:
    2222  Name: quux
    23 ...to: 
     23...to:
    2424  Name: v
    2525
    26 completeTypeError.cfa:58:1 error: No reasonable alternatives for expression Applying untyped: 
     26completeTypeError.cfa:58:1 error: No reasonable alternatives for expression Applying untyped:
    2727  Name: baz
    28 ...to: 
     28...to:
    2929  Name: y
    3030
    31 completeTypeError.cfa:59:1 error: No reasonable alternatives for expression Applying untyped: 
     31completeTypeError.cfa:59:1 error: No reasonable alternatives for expression Applying untyped:
    3232  Name: quux
    33 ...to: 
     33...to:
    3434  Name: y
    3535
    36 completeTypeError.cfa:60:1 error: No reasonable alternatives for expression Applying untyped: 
     36completeTypeError.cfa:60:1 error: No reasonable alternatives for expression Applying untyped:
    3737  Name: *?
    38 ...to: 
     38...to:
    3939  Name: y
    4040
    41 completeTypeError.cfa:72:1 error: No resolvable alternatives for expression Applying untyped: 
     41completeTypeError.cfa:72:1 error: No resolvable alternatives for expression Applying untyped:
    4242  Name: baz
    43 ...to: 
     43...to:
    4444  Name: z
    4545
     
    5151         ?=?: pointer to function
    5252         ... with parameters
    53            reference to instance of type T (not function type) 
    54            instance of type T (not function type) 
     53           reference to instance of type T (not function type)
     54           instance of type T (not function type)
    5555         ... returning
    56            _retval__operator_assign: instance of type T (not function type) 
     56           _retval__operator_assign: instance of type T (not function type)
    5757           ... with attributes:
    5858             Attribute with name: unused
     
    6161         ?{}: pointer to function
    6262         ... with parameters
    63            reference to instance of type T (not function type) 
     63           reference to instance of type T (not function type)
    6464         ... returning nothing
    6565
    6666         ?{}: pointer to function
    6767         ... with parameters
    68            reference to instance of type T (not function type) 
    69            instance of type T (not function type) 
     68           reference to instance of type T (not function type)
     69           instance of type T (not function type)
    7070         ... returning nothing
    7171
    7272         ^?{}: pointer to function
    7373         ... with parameters
    74            reference to instance of type T (not function type) 
     74           reference to instance of type T (not function type)
    7575         ... returning nothing
    7676
     
    7878       function
    7979     ... with parameters
    80        pointer to instance of type T (not function type) 
     80       pointer to instance of type T (not function type)
    8181     ... returning nothing
    8282
    8383   ... to arguments
    84      Variable Expression: z: pointer to instance of type T (not function type) 
     84     Variable Expression: z: pointer to instance of type T (not function type)
    8585
    8686 (types:
    8787   void
    8888 )
    89  Environment:( _73_0_T ) -> instance of type T (not function type)  (no widening)
     89 Environment:( _73_0_T ) -> instance of type T (not function type) (no widening)
    9090
    9191
  • tests/.expect/declarationErrors.txt

    re1f7eef rc018b85  
    66
    77declarationErrors.cfa:19:1 error: duplicate static in declaration of x4: static const volatile instance of const volatile struct __anonymous0
    8   with members 
     8  with members
    99    i: int
    10    with body 
     10   with body
    1111
    1212
    1313declarationErrors.cfa:20:1 error: duplicate const, duplicate static, duplicate volatile in declaration of x5: static const volatile instance of const volatile struct __anonymous1
    14   with members 
     14  with members
    1515    i: int
    16    with body 
     16   with body
    1717
    1818
     
    2020
    2121declarationErrors.cfa:24:1 error: duplicate const in declaration of f01: static inline function
    22   with no parameters 
     22  with no parameters
    2323  returning const volatile int
    2424
    2525
    2626declarationErrors.cfa:25:1 error: duplicate volatile in declaration of f02: static inline function
    27   with no parameters 
     27  with no parameters
    2828  returning const volatile int
    2929
    3030
    3131declarationErrors.cfa:26:1 error: duplicate const in declaration of f03: static inline function
    32   with no parameters 
     32  with no parameters
    3333  returning const volatile int
    3434
    3535
    3636declarationErrors.cfa:27:1 error: duplicate volatile in declaration of f04: static inline function
    37   with no parameters 
     37  with no parameters
    3838  returning const volatile int
    3939
    4040
    4141declarationErrors.cfa:28:1 error: duplicate const in declaration of f05: static inline function
    42   with no parameters 
     42  with no parameters
    4343  returning const volatile int
    4444
    4545
    4646declarationErrors.cfa:29:1 error: duplicate volatile in declaration of f06: static inline function
    47   with no parameters 
     47  with no parameters
    4848  returning const volatile int
    4949
    5050
    5151declarationErrors.cfa:30:1 error: duplicate const in declaration of f07: static inline function
    52   with no parameters 
     52  with no parameters
    5353  returning const volatile int
    5454
    5555
    5656declarationErrors.cfa:31:1 error: duplicate const, duplicate volatile in declaration of f08: static inline function
    57   with no parameters 
     57  with no parameters
    5858  returning const volatile int
    5959
    6060
    6161declarationErrors.cfa:33:1 error: duplicate const, duplicate volatile in declaration of f09: static inline function
    62   with no parameters 
     62  with no parameters
    6363  returning const volatile int
    6464
    6565
    6666declarationErrors.cfa:34:1 error: duplicate const, duplicate _Atomic, duplicate _Atomic, duplicate const, duplicate restrict, duplicate volatile in declaration of f09: static inline function
    67   with no parameters 
     67  with no parameters
    6868  returning const restrict volatile _Atomic int
    6969
  • tests/.expect/nested-types-ERR2.txt

    re1f7eef rc018b85  
    11nested-types.cfa:73:1 error: Use of undefined global type Z
    22nested-types.cfa:74:1 error: Qualified type requires an aggregate on the left, but has: signed int
    3 nested-types.cfa:75:1 error: Undefined type in qualified type: Qualified Type: 
     3nested-types.cfa:75:1 error: Undefined type in qualified type: Qualified Type:
    44  instance of struct S with body 1
    5   instance of type Z (not function type) 
     5  instance of type Z (not function type)
    66
  • tests/concurrent/examples/datingService.cfa

    re1f7eef rc018b85  
    3333                signal_block( Boys[ccode] );                                    // restart boy to set phone number
    3434        } // if
     35        sout | "Girl:" | PhoneNo | "is dating Boy at" | BoyPhoneNo | "with ccode" | ccode;
    3536        return BoyPhoneNo;
    3637} // DatingService girl
     
    4445                signal_block( Girls[ccode] );                                   // restart girl to set phone number
    4546        } // if
     47        sout | " Boy:" | PhoneNo | "is dating Girl" | GirlPhoneNo | "with ccode" | ccode;
    4648        return GirlPhoneNo;
    4749} // DatingService boy
     
    5860        yield( random( 100 ) );                                                         // don't all start at the same time
    5961        unsigned int partner = girl( TheExchange, id, ccode );
    60         sout | "Girl:" | id | "is dating Boy at" | partner | "with ccode" | ccode;
    6162        girlck[id] = partner;
    6263} // Girl main
     
    7677        yield( random( 100 ) );                                                         // don't all start at the same time
    7778        unsigned int partner = boy( TheExchange, id, ccode );
    78         sout | " Boy:" | id | "is dating Girl" | partner | "with ccode" | ccode;
    7979        boyck[id] = partner;
    8080} // Boy main
Note: See TracChangeset for help on using the changeset viewer.