Ignore:
Timestamp:
Mar 21, 2017, 3:11:35 PM (7 years ago)
Author:
Thierry Delisle <tdelisle@…>
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:
a53e10a
Parents:
9c31349 (diff), 168c007 (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/InitTweak/FixInit.cc

    r9c31349 rda6d4566  
    534534                        } else {
    535535                                // expr isn't a call expr, so create a new temporary variable to use to hold the value of the unique expression
    536                                 unqExpr->set_object( new ObjectDecl( toString("_unq_expr_", unqExpr->get_id()), Type::StorageClasses(), LinkageSpec::C, nullptr, unqExpr->get_result()->clone(), nullptr ) );
     536                                unqExpr->set_object( new ObjectDecl( toString("_unq", unqExpr->get_id()), Type::StorageClasses(), LinkageSpec::C, nullptr, unqExpr->get_result()->clone(), nullptr ) );
    537537                                unqExpr->set_var( new VariableExpr( unqExpr->get_object() ) );
    538538                        }
     
    764764                                                }
    765765                                        } else {
    766                                                 stmtsToAddAfter.push_back( ctor );
     766                                                ImplicitCtorDtorStmt * implicit = safe_dynamic_cast< ImplicitCtorDtorStmt * > ( ctor );
     767                                                ExprStmt * ctorStmt = dynamic_cast< ExprStmt * >( implicit->get_callStmt() );
     768                                                ApplicationExpr * ctorCall = nullptr;
     769                                                if ( ctorStmt && (ctorCall = isIntrinsicCallExpr( ctorStmt->get_expr() )) && ctorCall->get_args().size() == 2 ) {
     770                                                        // clean up intrinsic copy constructor calls by making them into SingleInits
     771                                                        objDecl->set_init( new SingleInit( ctorCall->get_args().back() ) );
     772                                                        ctorCall->get_args().pop_back();
     773                                                } else {
     774                                                        stmtsToAddAfter.push_back( ctor );
     775                                                        objDecl->set_init( NULL );
     776                                                        ctorInit->set_ctor( NULL );
     777                                                }
    767778                                        } // if
    768                                         objDecl->set_init( NULL );
    769                                         ctorInit->set_ctor( NULL );
    770779                                } else if ( Initializer * init = ctorInit->get_init() ) {
    771780                                        objDecl->set_init( init );
Note: See TracChangeset for help on using the changeset viewer.