Changeset fb24492 for src/GenPoly/Box.cc
- Timestamp:
- May 12, 2016, 1:19:59 PM (8 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, with_gc
- Children:
- 03286aa, 7b3f66b
- Parents:
- ec79847 (diff), 228851d (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/GenPoly/Box.cc
rec79847 rfb24492 499 499 500 500 // place current size in the current offset index 501 addExpr( layoutDecl->get_statements(), makeOp( "?=?", makeOp( "?[?]", new VariableExpr( offsetParam ), new ConstantExpr( Constant::from ( n_members ) ) ),501 addExpr( layoutDecl->get_statements(), makeOp( "?=?", makeOp( "?[?]", new VariableExpr( offsetParam ), new ConstantExpr( Constant::from_ulong( n_members ) ) ), 502 502 derefVar( sizeParam ) ) ); 503 503 ++n_members; … … 2069 2069 if ( n_members == 0 ) { 2070 2070 // all empty structs have the same layout - size 1, align 1 2071 makeVar( sizeofName( typeName ), layoutType, new SingleInit( new ConstantExpr( Constant::from ( (unsigned long)1 ) ) ) );2072 makeVar( alignofName( typeName ), layoutType->clone(), new SingleInit( new ConstantExpr( Constant::from ( (unsigned long)1 ) ) ) );2071 makeVar( sizeofName( typeName ), layoutType, new SingleInit( new ConstantExpr( Constant::from_ulong( 1 ) ) ) ); 2072 makeVar( alignofName( typeName ), layoutType->clone(), new SingleInit( new ConstantExpr( Constant::from_ulong( 1 ) ) ) ); 2073 2073 // NOTE zero-length arrays are forbidden in C, so empty structs have no offsetof array 2074 2074 } else { 2075 2075 ObjectDecl *sizeVar = makeVar( sizeofName( typeName ), layoutType ); 2076 2076 ObjectDecl *alignVar = makeVar( alignofName( typeName ), layoutType->clone() ); 2077 ObjectDecl *offsetVar = makeVar( offsetofName( typeName ), new ArrayType( Type::Qualifiers(), layoutType->clone(), new ConstantExpr( Constant::from ( n_members ) ), false, false ) );2077 ObjectDecl *offsetVar = makeVar( offsetofName( typeName ), new ArrayType( Type::Qualifiers(), layoutType->clone(), new ConstantExpr( Constant::from_int( n_members ) ), false, false ) ); 2078 2078 2079 2079 // generate call to layout function … … 2194 2194 2195 2195 // build the offset array and replace the pack with a reference to it 2196 ObjectDecl *offsetArray = makeVar( offsetName, new ArrayType( Type::Qualifiers(), offsetType, new ConstantExpr( Constant::from ( baseMembers.size() ) ), false, false ),2196 ObjectDecl *offsetArray = makeVar( offsetName, new ArrayType( Type::Qualifiers(), offsetType, new ConstantExpr( Constant::from_ulong( baseMembers.size() ) ), false, false ), 2197 2197 new ListInit( inits ) ); 2198 2198 ret = new VariableExpr( offsetArray );
Note: See TracChangeset
for help on using the changeset viewer.