Ignore:
Timestamp:
Nov 22, 2017, 3:43:50 PM (6 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
5fe35d6
Parents:
7e4c4f4 (diff), c2c6177 (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:/u/cforall/software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/parser.yy

    r7e4c4f4 r452747a  
    1010// Created On       : Sat Sep  1 20:22:55 2001
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Nov 17 11:38:57 2017
    13 // Update Count     : 2914
     12// Last Modified On : Mon Nov 20 09:45:36 2017
     13// Update Count     : 2945
    1414//
    1515
     
    114114        } // for
    115115} // distExt
     116
     117// There is an ambiguity for inline generic-routine return-types and generic routines.
     118//   forall( otype T ) struct S { int i; } bar( T ) {}
     119// Does the forall bind to the struct or the routine, and how would it be possible to explicitly specify the binding.
     120//   forall( otype T ) struct S { int T; } forall( otype W ) bar( W ) {}
     121
     122void rebindForall( DeclarationNode * declSpec, DeclarationNode * funcDecl ) {
     123        if ( declSpec->type->kind == TypeData::Aggregate ) { // return is aggregate definition
     124                funcDecl->type->forall = declSpec->type->aggregate.params; // move forall from aggregate to function type
     125                declSpec->type->aggregate.params = nullptr;
     126        } // if
     127} // rebindForall
    116128
    117129bool forall = false;                                                                    // aggregate have one or more forall qualifiers ?
     
    24012413        | declaration_specifier function_declarator with_clause_opt compound_statement
    24022414                {
     2415                        rebindForall( $1, $2 );
    24032416                        typedefTable.addToEnclosingScope( TypedefTable::ID );
    24042417                        typedefTable.leaveScope();
     
    24272440        | declaration_specifier KR_function_declarator KR_declaration_list_opt with_clause_opt compound_statement
    24282441                {
     2442                        rebindForall( $1, $2 );
    24292443                        typedefTable.addToEnclosingScope( TypedefTable::ID );
    24302444                        typedefTable.leaveScope();
Note: See TracChangeset for help on using the changeset viewer.