Changeset 0a81c3f for src/CodeGen
- Timestamp:
- Jul 13, 2017, 1:44:58 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:
- 2463d0e
- Parents:
- c6976ba
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/CodeGen/CodeGenerator.cc
rc6976ba r0a81c3f 338 338 if ( varExpr->get_var()->get_linkage() == LinkageSpec::Intrinsic && operatorLookup( varExpr->get_var()->get_name(), opInfo ) ) { 339 339 std::list< Expression* >::iterator arg = applicationExpr->get_args().begin(); 340 switch ( opInfo.type ) {341 case OT_PREFIXASSIGN:342 case OT_POSTFIXASSIGN:343 case OT_INFIXASSIGN:344 case OT_CTOR:345 case OT_DTOR:346 {347 assert( arg != applicationExpr->get_args().end() );348 if ( AddressExpr * addrExpr = dynamic_cast< AddressExpr * >( *arg ) ) {349 // remove & from first assignment/ctor argument350 *arg = addrExpr->get_arg();351 } else {352 // no address-of operator, so must be a pointer - add dereference353 // NOTE: if the assertion starts to trigger, check that the application expr isn't being shared.354 // Since its arguments are modified here, this assertion most commonly triggers when the application355 // is visited multiple times.356 UntypedExpr * newExpr = new UntypedExpr( new NameExpr( "*?" ) );357 newExpr->get_args().push_back( *arg );358 Type * type = InitTweak::getPointerBase( (*arg)->get_result() );359 assertf( type, "First argument to a derefence must be a pointer. Ensure that expressions are not being shared." );360 newExpr->set_result( type->clone() );361 *arg = newExpr;362 } // if363 break;364 }365 366 default:367 // do nothing368 ;369 } // switch370 371 340 switch ( opInfo.type ) { 372 341 case OT_INDEX:
Note: See TracChangeset
for help on using the changeset viewer.