Changeset 01d433e


Ignore:
Timestamp:
Aug 18, 2021, 1:15:22 PM (3 years ago)
Author:
Henry Xue <y58xue@…>
Branches:
ADT, ast-experimental, enum, forall-pointer-decay, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
bb9924c
Parents:
6d63c14
Message:

Convert expandUniqueExpr pass to use new AST (NOT WORKING)

Currently not working due to unresolved issues with UniqueExpr?. See
page 5 of https://cforall.uwaterloo.ca/doc/Fangren_Yu_Report_S20.pdf
for more details.

Location:
src
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • src/Tuples/Tuples.h

    r6d63c14 r01d433e  
    4545        /// replaces UniqueExprs with a temporary variable and one call
    4646        void expandUniqueExpr( std::list< Declaration * > & translationUnit );
     47        void expandUniqueExpr( ast::TranslationUnit & translationUnit );
    4748
    4849        /// returns VoidType if any of the expressions have Voidtype, otherwise TupleType of the Expression result types
  • src/Tuples/module.mk

    r6d63c14 r01d433e  
    2020        Tuples/TupleAssignment.cc \
    2121        Tuples/TupleExpansion.cc \
     22        Tuples/TupleExpansionNew.cpp \
    2223        Tuples/Tuples.cc \
    2324        Tuples/Tuples.h
  • src/main.cc

    r6d63c14 r01d433e  
    374374
    375375                        PASS( "Fix Init", InitTweak::fix(transUnit, buildingLibrary()));
     376
     377                        // fix ObjectDecl - replaces ConstructorInit nodes
     378                        if ( ctorinitp ) {
     379                                dump( move( transUnit ) );
     380                                return EXIT_SUCCESS;
     381                        } // if
     382
     383                        // Currently not working due to unresolved issues with UniqueExpr
     384                        PASS( "Expand Unique Expr", Tuples::expandUniqueExpr( transUnit ) ); // 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
    376385                        translationUnit = convert( move( transUnit ) );
    377386                } else {
     
    383392
    384393                        PASS( "Fix Init", InitTweak::fix( translationUnit, buildingLibrary() ) );
     394
     395                        // fix ObjectDecl - replaces ConstructorInit nodes
     396                        if ( ctorinitp ) {
     397                                dump ( translationUnit );
     398                                return EXIT_SUCCESS;
     399                        } // if
     400
     401                        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
    385402                }
    386 
    387                 // fix ObjectDecl - replaces ConstructorInit nodes
    388                 if ( ctorinitp ) {
    389                         dump ( translationUnit );
    390                         return EXIT_SUCCESS;
    391                 } // if
    392 
    393                 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
    394403
    395404                PASS( "Translate Tries" , ControlStruct::translateTries( translationUnit ) );
Note: See TracChangeset for help on using the changeset viewer.