Changeset 3ca912a
- Timestamp:
- May 23, 2019, 11:01:23 AM (5 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, cleanup-dtors, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 342146e1, 68c9165, f685679
- Parents:
- 4139e3d
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Tuples/TupleExpansion.cc
r4139e3d r3ca912a 320 320 } 321 321 const ast::Type * makeTupleType( const std::vector<ast::ptr<ast::Expr>> & exprs ) { 322 (void) exprs; 323 #warning Not implemented; needs Type.cpp in build 324 assertf(false, "Not implemented; needs Type.cpp in build"); 325 // // produce the TupleType which aggregates the types of the exprs 326 // std::vector<ast::ptr<ast::Type>> types; 327 // ast::CV::Qualifiers quals{ 328 // ast::CV::Const | ast::CV::Volatile | ast::CV::Restrict | ast::CV::Lvalue | 329 // ast::CV::Atomic | ast::CV::Mutex }; 330 331 // for ( const ast::Expr * expr : exprs ) { 332 // assert( expr->result ); 333 // // if the type of any expr is void, the type of the entire tuple is void 334 // if ( expr->result->isVoid() ) return new ast::VoidType{}; 335 336 // // qualifiers on the tuple type are the qualifiers that exist on all components 337 // quals &= expr->result->qualifiers; 338 339 // types.emplace_back( expr->result ); 340 // } 341 342 // if ( exprs.empty() ) { quals = ast::CV::Qualifiers{}; } 343 // return new ast::TupleType{ std::move(types), quals }; 322 // produce the TupleType which aggregates the types of the exprs 323 std::vector<ast::ptr<ast::Type>> types; 324 ast::CV::Qualifiers quals{ 325 ast::CV::Const | ast::CV::Volatile | ast::CV::Restrict | ast::CV::Lvalue | 326 ast::CV::Atomic | ast::CV::Mutex }; 327 328 for ( const ast::Expr * expr : exprs ) { 329 assert( expr->result ); 330 // if the type of any expr is void, the type of the entire tuple is void 331 if ( expr->result->isVoid() ) return new ast::VoidType{}; 332 333 // qualifiers on the tuple type are the qualifiers that exist on all components 334 quals &= expr->result->qualifiers; 335 336 types.emplace_back( expr->result ); 337 } 338 339 if ( exprs.empty() ) { quals = ast::CV::Qualifiers{}; } 340 return new ast::TupleType{ std::move(types), quals }; 344 341 } 345 342 … … 354 351 355 352 const ast::TypeInstType * isTtype( const ast::Type * type ) { 356 #warning unimplemented 353 if ( const ast::TypeInstType * inst = dynamic_cast< const ast::TypeInstType * >( type ) ) { 354 if ( inst->base && inst->base->kind == ast::TypeVar::Ttype ) { 355 return inst; 356 } 357 } 357 358 return nullptr; 358 359 }
Note: See TracChangeset
for help on using the changeset viewer.