Changeset 62423350 for src/Tuples
- Timestamp:
- Jun 29, 2017, 5:06:24 PM (7 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- a12d5aa
- Parents:
- bb1cd95
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Tuples/TupleExpansion.cc
rbb1cd95 r62423350 310 310 Type * makeTupleType( const std::list< Expression * > & exprs ) { 311 311 // produce the TupleType which aggregates the types of the exprs 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();312 std::list< Type * > types; 313 Type::Qualifiers qualifiers( Type::Const | Type::Volatile | Type::Restrict | Type::Lvalue | Type::Atomic | Type::Mutex ); 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;319 318 return new VoidType( Type::Qualifiers() ); 320 319 } 321 320 Type * type = expr->get_result()->clone(); 322 t upleType->get_types().push_back( type );321 types.push_back( type ); 323 322 // the qualifiers on the tuple type are the qualifiers that exist on all component types 324 323 qualifiers &= type->get_qualifiers(); 325 324 } // for 326 325 if ( exprs.empty() ) qualifiers = Type::Qualifiers(); 327 return tupleType;326 return new TupleType( qualifiers, types ); 328 327 } 329 328
Note: See TracChangeset
for help on using the changeset viewer.