Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/Expression.cc

    rdc2e7e0 r630a82a  
    99// Author           : Richard C. Bilson
    1010// Created On       : Mon May 18 07:44:20 2015
    11 // Last Modified By : Rob Schluntz
    12 // Last Modified On : Mon Apr 18 17:25:06 2016
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Fri Apr  8 17:16:23 2016
    1313// Update Count     : 40
    1414//
     
    7979
    8080VariableExpr::VariableExpr( DeclarationWithType *_var, Expression *_aname ) : Expression( _aname ), var( _var ) {
    81         assert( var );
    82         assert( var->get_type() );
    8381        add_result( var->get_type()->clone() );
    8482        for ( std::list< Type* >::iterator i = get_results().begin(); i != get_results().end(); ++i ) {
     
    214212
    215213        os << " of ";
    216 
    217         if ( type ) {
    218                 type->print(os, indent + 2);
    219         } else {
    220                 os << "<NULL>";
    221         }
    222 
    223         os << std::endl;
    224         Expression::print( os, indent );
    225 }
    226 
    227 OffsetPackExpr::OffsetPackExpr( StructInstType *type_, Expression *aname_ ) : Expression( aname_ ), type( type_ ) {
    228         add_result( new ArrayType( Type::Qualifiers(), new BasicType( Type::Qualifiers(), BasicType::LongUnsignedInt ), 0, false, false ) );
    229 }
    230 
    231 OffsetPackExpr::OffsetPackExpr( const OffsetPackExpr &other ) : Expression( other ), type( maybeClone( other.type ) ) {}
    232 
    233 OffsetPackExpr::~OffsetPackExpr() { delete type; }
    234 
    235 void OffsetPackExpr::print( std::ostream &os, int indent ) const {
    236         os << std::string( indent, ' ' ) << "Offset pack expression on ";
    237214
    238215        if ( type ) {
     
    456433}
    457434
    458 
    459 ImplicitCopyCtorExpr::ImplicitCopyCtorExpr( ApplicationExpr * callExpr ) : callExpr( callExpr ) {
    460         assert( callExpr );
    461         cloneAll( callExpr->get_results(), results );
    462 }
    463 
    464 ImplicitCopyCtorExpr::ImplicitCopyCtorExpr( const ImplicitCopyCtorExpr & other ) : Expression( other ), callExpr( maybeClone( other.callExpr ) ) {
    465         cloneAll( other.results, results );
    466         cloneAll( other.copyCtors, copyCtors );
    467         cloneAll( other.tempDecls, tempDecls );
    468         cloneAll( other.returnDecls, returnDecls );
    469         cloneAll( other.dtors, dtors );
    470 }
    471 
    472 ImplicitCopyCtorExpr::~ImplicitCopyCtorExpr() {
    473         delete callExpr;
    474         deleteAll( copyCtors );
    475         deleteAll( tempDecls );
    476         deleteAll( returnDecls );
    477         deleteAll( dtors );
    478 }
    479 
    480 void ImplicitCopyCtorExpr::print( std::ostream &os, int indent ) const {
    481         os << std::string( indent, ' ' ) <<  "Implicit Copy Constructor Expression: " << std::endl;
    482         assert( callExpr );
    483         callExpr->print( os, indent + 2 );
    484         os << std::endl << std::string( indent, ' ' ) << "with temporaries:" << std::endl;
    485         printAll(tempDecls, os, indent+2);
    486         os << std::endl << std::string( indent, ' ' ) << "with copyCtors:" << std::endl;
    487         printAll(copyCtors, os, indent+2);
    488         os << std::endl << std::string( indent, ' ' ) << "with return temporaries:" << std::endl;
    489         printAll(returnDecls, os, indent+2);
    490         Expression::print( os, indent );
    491 }
    492 
    493435UntypedValofExpr::UntypedValofExpr( const UntypedValofExpr & other ) : Expression( other ), body ( maybeClone( other.body ) ) {}
    494436
Note: See TracChangeset for help on using the changeset viewer.