Changeset 4318107 for src/GenPoly
- Timestamp:
- Feb 18, 2016, 3:09:40 PM (9 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, gc_noraii, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, string, with_gc
- Children:
- 6ce67ce, dc12481
- Parents:
- 30aeb27
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/GenPoly/Box.cc
r30aeb27 r4318107 1407 1407 if ( ! objectType ) return memberExpr; 1408 1408 1409 Expression *newMemberExpr = 0; 1409 1410 if ( StructInstType *structType = dynamic_cast< StructInstType* >( objectType ) ) { 1410 1411 // look up offset index … … 1416 1417 fieldLoc->get_args().push_back( makeDerefdVar( varExpr->clone(), varDepth ) ); 1417 1418 fieldLoc->get_args().push_back( makeOffsetIndex( objectType, i ) ); 1418 1419 delete memberExpr; 1420 return fieldLoc; 1419 newMemberExpr = fieldLoc; 1421 1420 } else if ( dynamic_cast< UnionInstType* >( objectType ) ) { 1422 1421 // union members are all at offset zero, so build appropriately-dereferenced variable 1423 Expression *derefdVar = makeDerefdVar( varExpr->clone(), varDepth ); 1424 delete memberExpr; 1425 return derefdVar; 1422 newMemberExpr = makeDerefdVar( varExpr->clone(), varDepth ); 1426 1423 } else return memberExpr; 1424 assert( newMemberExpr ); 1425 1426 // wrap pointer members in appropriate cast 1427 if ( dynamic_cast< PointerType* >( memberExpr->get_member()->get_type() ) ) { 1428 CastExpr *ptrCastExpr = new CastExpr( newMemberExpr, new PointerType( Type::Qualifiers(), new PointerType( Type::Qualifiers(), new VoidType( Type::Qualifiers() ) ) ) ); 1429 UntypedExpr *derefExpr = new UntypedExpr( new NameExpr( "*?" ) ); 1430 derefExpr->get_args().push_back( ptrCastExpr ); 1431 newMemberExpr = derefExpr; 1432 } 1433 1434 delete memberExpr; 1435 return newMemberExpr; 1427 1436 } 1428 1437
Note: See TracChangeset
for help on using the changeset viewer.