Changes in src/SynTree/Expression.cc [845cedc:630a82a]
- File:
-
- 1 edited
-
src/SynTree/Expression.cc (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/SynTree/Expression.cc
r845cedc r630a82a 9 9 // Author : Richard C. Bilson 10 10 // Created On : Mon May 18 07:44:20 2015 11 // Last Modified By : Rob Schluntz12 // Last Modified On : Fri Apr 22 16:20:43 201611 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Apr 8 17:16:23 2016 13 13 // Update Count : 40 14 14 // … … 79 79 80 80 VariableExpr::VariableExpr( DeclarationWithType *_var, Expression *_aname ) : Expression( _aname ), var( _var ) { 81 assert( var );82 assert( var->get_type() );83 81 add_result( var->get_type()->clone() ); 84 82 for ( std::list< Type* >::iterator i = get_results().begin(); i != get_results().end(); ++i ) { … … 214 212 215 213 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 ";237 214 238 215 if ( type ) { … … 456 433 } 457 434 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.copyCtors, copyCtors );466 cloneAll( other.tempDecls, tempDecls );467 cloneAll( other.returnDecls, returnDecls );468 cloneAll( other.dtors, dtors );469 }470 471 ImplicitCopyCtorExpr::~ImplicitCopyCtorExpr() {472 delete callExpr;473 deleteAll( copyCtors );474 deleteAll( tempDecls );475 deleteAll( returnDecls );476 deleteAll( dtors );477 }478 479 void ImplicitCopyCtorExpr::print( std::ostream &os, int indent ) const {480 os << std::string( indent, ' ' ) << "Implicit Copy Constructor Expression: " << std::endl;481 assert( callExpr );482 callExpr->print( os, indent + 2 );483 os << std::endl << std::string( indent, ' ' ) << "with temporaries:" << std::endl;484 printAll(tempDecls, os, indent+2);485 os << std::endl << std::string( indent, ' ' ) << "with copyCtors:" << std::endl;486 printAll(copyCtors, os, indent+2);487 os << std::endl << std::string( indent, ' ' ) << "with return temporaries:" << std::endl;488 printAll(returnDecls, os, indent+2);489 Expression::print( os, indent );490 }491 492 435 UntypedValofExpr::UntypedValofExpr( const UntypedValofExpr & other ) : Expression( other ), body ( maybeClone( other.body ) ) {} 493 436
Note:
See TracChangeset
for help on using the changeset viewer.