Ignore:
Timestamp:
Sep 10, 2016, 11:08:47 AM (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:
5af62f1
Parents:
f5e81d1 (diff), 03e3117 (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' into tuples

Conflicts:

src/ResolvExpr/AlternativeFinder.cc
src/ResolvExpr/AlternativeFinder.h

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/Expression.cc

    rf5e81d1 radd7117  
    2828#include "TypeSubstitution.h"
    2929#include "Common/utility.h"
     30#include "InitTweak/InitTweak.h"
    3031
    3132
     
    496497
    497498void ImplicitCopyCtorExpr::print( std::ostream &os, int indent ) const {
    498         os << std::string( indent, ' ' ) << "Implicit Copy Constructor Expression: " << std::endl;
     499        os << "Implicit Copy Constructor Expression: " << std::endl;
    499500        assert( callExpr );
    500501        callExpr->print( os, indent + 2 );
     
    506507}
    507508
     509
     510ConstructorExpr::ConstructorExpr( Expression * callExpr ) : callExpr( callExpr ) {
     511        // allow resolver to type a constructor used as an expression as if it has the same type as its first argument
     512        assert( callExpr );
     513        Expression * arg = InitTweak::getCallArg( callExpr, 0 );
     514        assert( arg );
     515        cloneAll( arg->get_results(), results );
     516}
     517
     518ConstructorExpr::ConstructorExpr( const ConstructorExpr & other ) : Expression( other ), callExpr( maybeClone( other.callExpr ) ) {
     519}
     520
     521ConstructorExpr::~ConstructorExpr() {
     522        delete callExpr;
     523}
     524
     525void ConstructorExpr::print( std::ostream &os, int indent ) const {
     526        os <<  "Constructor Expression: " << std::endl;
     527        assert( callExpr );
     528        os << std::string( indent+2, ' ' );
     529        callExpr->print( os, indent + 2 );
     530        Expression::print( os, indent );
     531}
     532
     533
     534CompoundLiteralExpr::CompoundLiteralExpr( Type * type, Initializer * initializer ) : type( type ), initializer( initializer ) {
     535        add_result( type->clone() );
     536}
     537
     538CompoundLiteralExpr::CompoundLiteralExpr( const CompoundLiteralExpr &other ) : Expression( other ), type( maybeClone( other.type ) ), initializer( maybeClone( other.initializer ) ) {}
     539
     540CompoundLiteralExpr::~CompoundLiteralExpr() {
     541        delete initializer;
     542        delete type;
     543}
     544
     545void CompoundLiteralExpr::print( std::ostream &os, int indent ) const {
     546        os << "Compound Literal Expression: " << std::endl;
     547        if ( type ) type->print( os, indent + 2 );
     548        if ( initializer ) initializer->print( os, indent + 2 );
     549}
     550
    508551UntypedValofExpr::UntypedValofExpr( const UntypedValofExpr & other ) : Expression( other ), body ( maybeClone( other.body ) ) {}
    509552
     
    514557        if ( get_body() != 0 )
    515558                get_body()->print( os, indent + 2 );
    516 }
    517 
    518 
    519 CompoundLiteralExpr::CompoundLiteralExpr( Type * type, Initializer * initializer ) : type( type ), initializer( initializer ) {
    520         add_result( type->clone() );
    521 }
    522 
    523 CompoundLiteralExpr::CompoundLiteralExpr( const CompoundLiteralExpr &other ) : Expression( other ), type( maybeClone( other.type ) ), initializer( maybeClone( other.initializer ) ) {}
    524 
    525 CompoundLiteralExpr::~CompoundLiteralExpr() {
    526         delete initializer;
    527         delete type;
    528 }
    529 
    530 void CompoundLiteralExpr::print( std::ostream &os, int indent ) const {
    531         os << "Compound Literal Expression: " << std::endl;
    532         if ( type ) type->print( os, indent + 2 );
    533         if ( initializer ) initializer->print( os, indent + 2 );
    534559}
    535560
Note: See TracChangeset for help on using the changeset viewer.