Changes in / [26ba208:64b6913]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Tuples/TupleExpansion.cc
r26ba208 r64b6913 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Mar 16 08:05:17201713 // Update Count : 1 512 // Last Modified On : Wed Mar 15 07:58:00 2017 13 // Update Count : 14 14 14 // 15 15 … … 187 187 } 188 188 BasicType * boolType = new BasicType( Type::Qualifiers(), BasicType::Bool ); 189 ObjectDecl * finished = new ObjectDecl( toString( "_unq_expr_finished_", id ), Type::StorageClasses(), LinkageSpec::Cforall, nullptr, new BasicType( Type::Qualifiers(), BasicType::Bool ), new SingleInit( new ConstantExpr( Constant( boolType->clone(), "0" ) ), noDesignators ) );189 ObjectDecl * finished = new ObjectDecl( toString( "_unq_expr_finished_", id ), DeclarationNode::StorageClasses(), LinkageSpec::Cforall, nullptr, new BasicType( Type::Qualifiers(), BasicType::Bool ), new SingleInit( new ConstantExpr( Constant( boolType->clone(), "0" ) ), noDesignators ) ); 190 190 addDeclaration( finished ); 191 191 // (finished ? _unq_expr_N : (_unq_expr_N = <unqExpr->get_expr()>, finished = 1, _unq_expr_N)) … … 221 221 decl->set_body( true ); 222 222 for ( size_t i = 0; i < tupleSize; ++i ) { 223 TypeDecl * tyParam = new TypeDecl( toString( "tuple_param_", i ), Type::StorageClasses(), nullptr, TypeDecl::Any );224 decl->get_members().push_back( new ObjectDecl( toString("field_", i ), Type::StorageClasses(), LinkageSpec::C, nullptr, new TypeInstType( Type::Qualifiers(), tyParam->get_name(), tyParam ), nullptr ) );223 TypeDecl * tyParam = new TypeDecl( toString( "tuple_param_", i ), DeclarationNode::StorageClasses(), nullptr, TypeDecl::Any ); 224 decl->get_members().push_back( new ObjectDecl( toString("field_", i ), DeclarationNode::StorageClasses(), LinkageSpec::C, nullptr, new TypeInstType( Type::Qualifiers(), tyParam->get_name(), tyParam ), nullptr ) ); 225 225 decl->get_parameters().push_back( tyParam ); 226 226 } 227 227 if ( tupleSize == 0 ) { 228 228 // empty structs are not standard C. Add a dummy field to empty tuples to silence warnings when a compound literal Tuple0 is created. 229 decl->get_members().push_back( new ObjectDecl( "dummy", Type::StorageClasses(), LinkageSpec::C, nullptr, new BasicType( Type::Qualifiers(), BasicType::SignedInt ), nullptr ) );229 decl->get_members().push_back( new ObjectDecl( "dummy", DeclarationNode::StorageClasses(), LinkageSpec::C, nullptr, new BasicType( Type::Qualifiers(), BasicType::SignedInt ), nullptr ) ); 230 230 } 231 231 typeMap[tupleSize] = decl;
Note: See TracChangeset
for help on using the changeset viewer.