Changes in src/Tuples/TupleExpansion.cc [62423350:d56e5bc]
- File:
-
- 1 edited
-
src/Tuples/TupleExpansion.cc (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Tuples/TupleExpansion.cc
r62423350 rd56e5bc 192 192 } 193 193 ObjectDecl * finished = new ObjectDecl( toString( "_unq", id, "_finished_" ), Type::StorageClasses(), LinkageSpec::Cforall, nullptr, new BasicType( Type::Qualifiers(), BasicType::Bool ), 194 new SingleInit( new ConstantExpr( Constant::from_int( 0 ) ) ) );194 new SingleInit( new ConstantExpr( Constant::from_int( 0 ) ), noDesignators ) ); 195 195 addDeclaration( finished ); 196 196 // (finished ? _unq_expr_N : (_unq_expr_N = <unqExpr->get_expr()>, finished = 1, _unq_expr_N)) … … 310 310 Type * makeTupleType( const std::list< Expression * > & exprs ) { 311 311 // produce the TupleType which aggregates the types of the exprs 312 std::list< Type * > types;313 Type::Qualifiers qualifiers( Type::Const | Type::Volatile | Type::Restrict | Type::Lvalue | Type::Atomic | Type::Mutex);312 TupleType *tupleType = new TupleType( Type::Qualifiers( Type::Const | Type::Volatile | Type::Restrict | Type::Lvalue | Type::Atomic | Type::Mutex ) ); 313 Type::Qualifiers &qualifiers = tupleType->get_qualifiers(); 314 314 for ( Expression * expr : exprs ) { 315 315 assert( expr->get_result() ); 316 316 if ( expr->get_result()->isVoid() ) { 317 317 // if the type of any expr is void, the type of the entire tuple is void 318 delete tupleType; 318 319 return new VoidType( Type::Qualifiers() ); 319 320 } 320 321 Type * type = expr->get_result()->clone(); 321 t ypes.push_back( type );322 tupleType->get_types().push_back( type ); 322 323 // the qualifiers on the tuple type are the qualifiers that exist on all component types 323 324 qualifiers &= type->get_qualifiers(); 324 325 } // for 325 326 if ( exprs.empty() ) qualifiers = Type::Qualifiers(); 326 return new TupleType( qualifiers, types );327 return tupleType; 327 328 } 328 329
Note:
See TracChangeset
for help on using the changeset viewer.