Changeset 946bcca for src/InitTweak


Ignore:
Timestamp:
Mar 17, 2017, 1:14:44 PM (8 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:
14a33790, 7c70089, 89d129c
Parents:
b2f5082 (diff), 615a096 (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

Location:
src/InitTweak
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/InitTweak/FixInit.cc

    rb2f5082 r946bcca  
    1010// Created On       : Wed Jan 13 16:29:30 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Mar 16 08:08:04 2017
    13 // Update Count     : 67
     12// Last Modified On : Fri Mar 17 09:13:47 2017
     13// Update Count     : 71
    1414//
    1515
     
    434434                        env->apply( result );
    435435                        ObjectDecl * tmp = new ObjectDecl( tempNamer.newName(), Type::StorageClasses(), LinkageSpec::C, 0, result, 0 );
    436                         tmp->get_type()->set_isConst( false );
     436                        tmp->get_type()->set_const( false );
    437437
    438438                        // create and resolve copy constructor
     
    480480                                env->apply( result );
    481481                                ObjectDecl * ret = new ObjectDecl( retNamer.newName(), Type::StorageClasses(), LinkageSpec::C, 0, result, 0 );
    482                                 ret->get_type()->set_isConst( false );
     482                                ret->get_type()->set_const( false );
    483483                                impCpCtorExpr->get_returnDecls().push_back( ret );
    484484                                CP_CTOR_PRINT( std::cerr << "makeCtorDtor for a return" << std::endl; )
    485                                 if ( ! result->get_isLvalue() ) {
     485                                if ( ! result->get_lvalue() ) {
    486486                                        // destructing lvalue returns is bad because it can cause multiple destructor calls to the same object - the returned object is not a temporary
    487487                                        destructRet( ret, impCpCtorExpr );
     
    503503                                env->apply( result );
    504504                                ObjectDecl * ret = new ObjectDecl( retNamer.newName(), Type::StorageClasses(), LinkageSpec::C, 0, result, 0 );
    505                                 ret->get_type()->set_isConst( false );
     505                                ret->get_type()->set_const( false );
    506506                                stmtExpr->get_returnDecls().push_front( ret );
    507507
     
    584584
    585585                                Expression * retExpr = new CommaExpr( assign, new VariableExpr( returnDecl ) );
    586                                 if ( callExpr->get_result()->get_isLvalue() ) {
     586                                if ( callExpr->get_result()->get_lvalue() ) {
    587587                                        // lvalue returning functions are funny. Lvalue.cc inserts a *? in front of any lvalue returning
    588588                                        // non-intrinsic function. Add an AddressExpr to the call to negate the derefence and change the
  • src/InitTweak/GenInit.cc

    rb2f5082 r946bcca  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Mar 16 08:01:25 2017
    13 // Update Count     : 181
     12// Last Modified On : Fri Mar 17 09:12:36 2017
     13// Update Count     : 183
    1414//
    1515
     
    143143                // is being returned
    144144                // Note: under the assumption that assignments return *this, checking for ?=? here is an optimization, since it shouldn't be necessary to copy construct `this`. This is a temporary optimization until reference types are added, at which point this should be removed, along with the analogous optimization in copy constructor generation.
    145                 if ( returnStmt->get_expr() && returnVals.size() == 1 && funcName != "?=?" && ! returnVals.front()->get_type()->get_isLvalue() ) {
     145                if ( returnStmt->get_expr() && returnVals.size() == 1 && funcName != "?=?" && ! returnVals.front()->get_type()->get_lvalue() ) {
    146146                        // explicitly construct the return value using the return expression and the retVal object
    147147                        assertf( returnVals.front()->get_name() != "", "Function %s has unnamed return value\n", funcName.c_str() );
     
    195195
    196196                        ObjectDecl * arrayDimension = new ObjectDecl( dimensionName.newName(), storageClasses, LinkageSpec::C, 0, SymTab::SizeType->clone(), new SingleInit( arrayType->get_dimension() ) );
    197                         arrayDimension->get_type()->set_isConst( true );
     197                        arrayDimension->get_type()->set_const( true );
    198198
    199199                        arrayType->set_dimension( new VariableExpr( arrayDimension ) );
Note: See TracChangeset for help on using the changeset viewer.