Changes in src/SynTree/Expression.cc [630a82a:dc2e7e0]
- File:
-
- 1 edited
-
src/SynTree/Expression.cc (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/SynTree/Expression.cc
r630a82a rdc2e7e0 9 9 // Author : Richard C. Bilson 10 10 // Created On : Mon May 18 07:44:20 2015 11 // Last Modified By : Peter A. Buhr12 // Last Modified On : Fri Apr 8 17:16:23201611 // Last Modified By : Rob Schluntz 12 // Last Modified On : Mon Apr 18 17:25:06 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() ); 81 83 add_result( var->get_type()->clone() ); 82 84 for ( std::list< Type* >::iterator i = get_results().begin(); i != get_results().end(); ++i ) { … … 212 214 213 215 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 "; 214 237 215 238 if ( type ) { … … 433 456 } 434 457 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 435 493 UntypedValofExpr::UntypedValofExpr( const UntypedValofExpr & other ) : Expression( other ), body ( maybeClone( other.body ) ) {} 436 494
Note:
See TracChangeset
for help on using the changeset viewer.