Changeset 18ca28e for src/InitTweak


Ignore:
Timestamp:
Oct 19, 2017, 11:15:19 AM (7 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:
d411426d
Parents:
0a267c1
git-author:
Rob Schluntz <rschlunt@…> (10/13/17 13:49:10)
git-committer:
Rob Schluntz <rschlunt@…> (10/19/17 11:15:19)
Message:

Refactor autogen for EnumDecl? [fixes #47]

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/InitTweak/GenInit.cc

    r0a267c1 r18ca28e  
    128128                if ( returnStmt->expr && returnVals.size() == 1 && isConstructable( returnVals.front()->get_type() ) ) {
    129129                        // explicitly construct the return value using the return expression and the retVal object
    130                         assertf( returnVals.front()->get_name() != "", "Function %s has unnamed return value\n", funcName.c_str() );
     130                        assertf( returnVals.front()->name != "", "Function %s has unnamed return value\n", funcName.c_str() );
    131131
    132132                        ObjectDecl * retVal = strict_dynamic_cast< ObjectDecl * >( returnVals.front() );
     
    138138
    139139                        // return the retVal object
    140                         returnStmt->set_expr( new VariableExpr( returnVals.front() ) );
     140                        returnStmt->expr = new VariableExpr( returnVals.front() );
    141141                } // if
    142142        }
Note: See TracChangeset for help on using the changeset viewer.