Changes in src/GenPoly/Box.cc [cb4c607:aa19ccf]
- File:
-
- 1 edited
-
src/GenPoly/Box.cc (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/GenPoly/Box.cc
rcb4c607 raa19ccf 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 _ulong( n_members ) ) ),501 addExpr( layoutDecl->get_statements(), makeOp( "?=?", makeOp( "?[?]", new VariableExpr( offsetParam ), new ConstantExpr( Constant::from( n_members ) ) ), 502 502 derefVar( sizeParam ) ) ); 503 503 ++n_members; … … 2066 2066 if ( n_members == 0 ) { 2067 2067 // all empty structs have the same layout - size 1, align 1 2068 makeVar( sizeofName( typeName ), layoutType, new SingleInit( new ConstantExpr( Constant::from _ulong(1 ) ) ) );2069 makeVar( alignofName( typeName ), layoutType->clone(), new SingleInit( new ConstantExpr( Constant::from _ulong(1 ) ) ) );2068 makeVar( sizeofName( typeName ), layoutType, new SingleInit( new ConstantExpr( Constant::from( (unsigned long)1 ) ) ) ); 2069 makeVar( alignofName( typeName ), layoutType->clone(), new SingleInit( new ConstantExpr( Constant::from( (unsigned long)1 ) ) ) ); 2070 2070 // NOTE zero-length arrays are forbidden in C, so empty structs have no offsetof array 2071 2071 } else { 2072 2072 ObjectDecl *sizeVar = makeVar( sizeofName( typeName ), layoutType ); 2073 2073 ObjectDecl *alignVar = makeVar( alignofName( typeName ), layoutType->clone() ); 2074 ObjectDecl *offsetVar = makeVar( offsetofName( typeName ), new ArrayType( Type::Qualifiers(), layoutType->clone(), new ConstantExpr( Constant::from _int( n_members ) ), false, false ) );2074 ObjectDecl *offsetVar = makeVar( offsetofName( typeName ), new ArrayType( Type::Qualifiers(), layoutType->clone(), new ConstantExpr( Constant::from( n_members ) ), false, false ) ); 2075 2075 2076 2076 // generate call to layout function … … 2191 2191 2192 2192 // build the offset array and replace the pack with a reference to it 2193 ObjectDecl *offsetArray = makeVar( offsetName, new ArrayType( Type::Qualifiers(), offsetType, new ConstantExpr( Constant::from _ulong( baseMembers.size() ) ), false, false ),2193 ObjectDecl *offsetArray = makeVar( offsetName, new ArrayType( Type::Qualifiers(), offsetType, new ConstantExpr( Constant::from( baseMembers.size() ) ), false, false ), 2194 2194 new ListInit( inits ) ); 2195 2195 ret = new VariableExpr( offsetArray );
Note:
See TracChangeset
for help on using the changeset viewer.