Changeset 4a79e3c9 for src/GenPoly
- Timestamp:
- Jan 22, 2016, 11:42:32 AM (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:
- 32805db
- Parents:
- 4ef7506
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/GenPoly/Box.cc
r4ef7506 r4a79e3c9 370 370 371 371 Expression *Pass1::makeOffsetArray( StructInstType *ty ) { 372 std::list< Declaration* > &baseMembers = ty->get_baseStruct()->get_members(); 373 372 374 // make a new temporary array 373 375 Type *offsetType = new BasicType( Type::Qualifiers(), BasicType::LongUnsignedInt ); 374 ObjectDecl *arrayTemp = makeTemporary( new PointerType( Type::Qualifiers(), offsetType ) ); 376 std::stringstream lenGen; 377 lenGen << baseMembers.size(); 378 ConstantExpr *lenExpr = new ConstantExpr( Constant( offsetType->clone(), lenGen.str() ) ); 379 ObjectDecl *arrayTemp = makeTemporary( new ArrayType( Type::Qualifiers(), offsetType, lenExpr, false, false ) ); 375 380 376 381 // build initializer list for temporary 377 382 std::list< Initializer* > inits; 378 StructDecl *tyBase = ty->get_baseStruct(); 379 for ( std::list< Declaration* >::const_iterator member = tyBase->get_members().begin(); member != tyBase->get_members().end(); ++member ) { 383 for ( std::list< Declaration* >::const_iterator member = baseMembers.begin(); member != baseMembers.end(); ++member ) { 380 384 DeclarationWithType *memberDecl; 381 385 if ( DeclarationWithType *origMember = dynamic_cast< DeclarationWithType* >( *member ) ) {
Note: See TracChangeset
for help on using the changeset viewer.