Changeset ba54f7d for src/SymTab/Autogen.cc
- Timestamp:
- Sep 13, 2017, 3:11:24 PM (7 years ago)
- 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:
- c57ded70, db70fe4
- Parents:
- d130fe8 (diff), 982832e (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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/SymTab/Autogen.cc
rd130fe8 rba54f7d 18 18 #include <cstddef> // for NULL 19 19 #include <algorithm> // for count_if 20 #include <cassert> // for s afe_dynamic_cast, assert, assertf20 #include <cassert> // for strict_dynamic_cast, assert, assertf 21 21 #include <iterator> // for back_insert_iterator, back_inserter 22 22 #include <list> // for list, _List_iterator, list<>::iter... … … 248 248 // parameters) are using in the variable exprs 249 249 assert( ftype->get_parameters().size() == 2 ); 250 ObjectDecl * dstParam = s afe_dynamic_cast< ObjectDecl * >( ftype->get_parameters().front() );251 ObjectDecl * srcParam = s afe_dynamic_cast< ObjectDecl * >( ftype->get_parameters().back() );250 ObjectDecl * dstParam = strict_dynamic_cast< ObjectDecl * >( ftype->get_parameters().front() ); 251 ObjectDecl * srcParam = strict_dynamic_cast< ObjectDecl * >( ftype->get_parameters().back() ); 252 252 253 253 VariableExpr * assignVarExpr = new VariableExpr( assignDecl ); … … 305 305 306 306 // assign to destination 307 Expression *dstselect = new MemberExpr( field, new CastExpr( new VariableExpr( dstParam ), s afe_dynamic_cast< ReferenceType* >( dstParam->get_type() )->get_base()->clone() ) );307 Expression *dstselect = new MemberExpr( field, new CastExpr( new VariableExpr( dstParam ), strict_dynamic_cast< ReferenceType* >( dstParam->get_type() )->get_base()->clone() ) ); 308 308 genImplicitCall( srcParam, dstselect, func->get_name(), back_inserter( func->get_statements()->get_kids() ), field, forward ); 309 309 } … … 442 442 FunctionType * assignType = dcl->get_functionType(); 443 443 assert( assignType->get_parameters().size() == 2 ); 444 ObjectDecl * srcParam = s afe_dynamic_cast< ObjectDecl * >( assignType->get_parameters().back() );444 ObjectDecl * srcParam = strict_dynamic_cast< ObjectDecl * >( assignType->get_parameters().back() ); 445 445 dcl->get_statements()->get_kids().push_back( new ReturnStmt( noLabels, new VariableExpr( srcParam ) ) ); 446 446 } … … 493 493 FunctionType * ftype = funcDecl->get_functionType(); 494 494 assert( ftype->get_parameters().size() == 2 ); 495 ObjectDecl * dstParam = s afe_dynamic_cast< ObjectDecl * >( ftype->get_parameters().front() );496 ObjectDecl * srcParam = s afe_dynamic_cast< ObjectDecl * >( ftype->get_parameters().back() );495 ObjectDecl * dstParam = strict_dynamic_cast< ObjectDecl * >( ftype->get_parameters().front() ); 496 ObjectDecl * srcParam = strict_dynamic_cast< ObjectDecl * >( ftype->get_parameters().back() ); 497 497 498 498 makeUnionFieldsAssignment( srcParam, dstParam, back_inserter( funcDecl->get_statements()->get_kids() ) ); … … 657 657 FunctionType * assignType = dcl->type; 658 658 assert( assignType->parameters.size() == 2 ); 659 ObjectDecl * srcParam = s afe_dynamic_cast< ObjectDecl * >( assignType->parameters.back() );659 ObjectDecl * srcParam = strict_dynamic_cast< ObjectDecl * >( assignType->parameters.back() ); 660 660 dcl->statements->kids.push_back( new ReturnStmt( noLabels, new VariableExpr( srcParam ) ) ); 661 661 } … … 735 735 736 736 Type * AutogenTupleRoutines::mutate( TupleType * tupleType ) { 737 tupleType = s afe_dynamic_cast< TupleType * >( Parent::mutate( tupleType ) );737 tupleType = strict_dynamic_cast< TupleType * >( Parent::mutate( tupleType ) ); 738 738 std::string mangleName = SymTab::Mangler::mangleType( tupleType ); 739 739 if ( seenTuples.find( mangleName ) != seenTuples.end() ) return tupleType; … … 803 803 CompoundStmt * AutogenTupleRoutines::mutate( CompoundStmt *compoundStmt ) { 804 804 seenTuples.beginScope(); 805 compoundStmt = s afe_dynamic_cast< CompoundStmt * >( Parent::mutate( compoundStmt ) );805 compoundStmt = strict_dynamic_cast< CompoundStmt * >( Parent::mutate( compoundStmt ) ); 806 806 seenTuples.endScope(); 807 807 return compoundStmt;
Note: See TracChangeset
for help on using the changeset viewer.