Changeset 9191a8e for src/GenPoly
- Timestamp:
- Jul 21, 2017, 4:02:37 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:
- 6d267ca
- Parents:
- bff227f
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/GenPoly/Lvalue.cc
rbff227f r9191a8e 241 241 } else if ( ReferenceType * refType = dynamic_cast< ReferenceType * >( castExpr->get_arg()->get_result() ) ) { 242 242 // conversion from reference to rvalue 243 // should be easy, just need to move deref code up here?244 243 PRINT( std::cerr << "convert reference to rvalue -- *" << std::endl; ) 245 if ( isIntrinsicReference( castExpr->get_arg() ) ) {246 PRINT( std::cerr << "but arg is intrinsic reference -- nop" << std::endl; )247 return castExpr;248 }249 244 PRINT( std::cerr << "was = " << castExpr << std::endl; ) 250 251 Expression * deref = mkDeref( castExpr->get_arg() ); 252 deref->set_env( castExpr->get_env() ); 245 Expression * ret = castExpr->get_arg(); 246 if ( ! isIntrinsicReference( ret ) ) { 247 // dereference if not already dereferenced 248 ret = mkDeref( ret ); 249 } 250 ret->set_env( castExpr->get_env() ); 253 251 castExpr->set_arg( nullptr ); 254 252 castExpr->set_env( nullptr ); 255 253 delete castExpr; 256 PRINT( std::cerr << "now: " << deref<< std::endl; )257 return deref;254 PRINT( std::cerr << "now: " << ret << std::endl; ) 255 return ret; 258 256 } 259 257 return castExpr;
Note: See TracChangeset
for help on using the changeset viewer.