Ignore:
Timestamp:
Jun 10, 2019, 1:51:24 PM (5 years ago)
Author:
Peter A. Buhr <pabuhr@…>
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:
2773ab8, 558d13b
Parents:
891b827 (diff), f9a7cf0 (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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/Resolver.cc

    r891b827 r6949c45  
    12271227                void previsit( const ast::WaitForStmt * );
    12281228
    1229                 const ast::SingleInit * previsit( const ast::SingleInit * );
    1230                 const ast::ListInit * previsit( const ast::ListInit * );
    1231                 void previsit( const ast::ConstructorInit * );
     1229                const ast::SingleInit *      previsit( const ast::SingleInit * );
     1230                const ast::ListInit *        previsit( const ast::ListInit * );
     1231                const ast::ConstructorInit * previsit( const ast::ConstructorInit * );
    12321232        };
    12331233
     
    15101510                        // iterate designations and initializers in pairs, moving the cursor to the current
    15111511                        // designated object and resolving the initializer against that object
    1512                         #warning unimplemented; Resolver port in progress
    1513                         assert(false);
    1514                 }
     1512                        listInit = ast::mutate_field_index(
     1513                                listInit, &ast::ListInit::designations, i,
     1514                                currentObject.findNext( listInit->designations[i] ) );
     1515                        listInit = ast::mutate_field_index(
     1516                                listInit, &ast::ListInit::initializers, i,
     1517                                listInit->initializers[i]->accept( *visitor ) );
     1518                }
     1519
     1520                // move cursor out of brace-enclosed initializer-list
     1521                currentObject.exitListInit();
    15151522
    15161523                visit_children = false;
     
    15181525        }
    15191526
    1520         void Resolver_new::previsit( const ast::ConstructorInit * ctorInit ) {
    1521                 #warning unimplemented; Resolver port in progress
    1522                 (void)ctorInit;
    1523                 assert(false);
     1527        const ast::ConstructorInit * Resolver_new::previsit( const ast::ConstructorInit * ctorInit ) {
     1528                visitor->maybe_accept( ctorInit, &ast::ConstructorInit::ctor );
     1529                visitor->maybe_accept( ctorInit, &ast::ConstructorInit::dtor );
     1530
     1531                // found a constructor - can get rid of C-style initializer
     1532                // xxx - Rob suggests this field is dead code
     1533                ctorInit = ast::mutate_field( ctorInit, &ast::ConstructorInit::init, nullptr );
     1534
     1535                // intrinsic single-parameter constructors and destructors do nothing. Since this was
     1536                // implicitly generated, there's no way for it to have side effects, so get rid of it to
     1537                // clean up generated code
     1538                if ( InitTweak::isIntrinsicSingleArgCallStmt( ctorInit->ctor ) ) {
     1539                        ctorInit = ast::mutate_field( ctorInit, &ast::ConstructorInit::ctor, nullptr );
     1540                }
     1541                if ( InitTweak::isIntrinsicSingleArgCallStmt( ctorInit->dtor ) ) {
     1542                        ctorInit = ast::mutate_field( ctorInit, &ast::ConstructorInit::dtor, nullptr );
     1543                }
     1544
     1545                return ctorInit;
    15241546        }
    15251547
Note: See TracChangeset for help on using the changeset viewer.