Changeset 9b4f329 for src/Tuples
- Timestamp:
- May 16, 2019, 6:46:51 PM (6 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:
- 246c245
- Parents:
- f3cc5b6
- Location:
- src/Tuples
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Tuples/TupleExpansion.cc
rf3cc5b6 r9b4f329 17 17 #include <cassert> // for assert 18 18 #include <list> // for list 19 19 #include <vector> 20 21 #include "AST/CVQualifiers.hpp" 22 #include "AST/Expr.hpp" 23 #include "AST/Node.hpp" 24 #include "AST/Type.hpp" 20 25 #include "Common/PassVisitor.h" // for PassVisitor, WithDeclsToAdd, WithGu... 21 26 #include "Common/ScopedMap.h" // for ScopedMap … … 314 319 return new TupleType( qualifiers, types ); 315 320 } 321 const ast::Type * makeTupleType( const std::vector<ast::ptr<ast::Expr>> & exprs ) { 322 assert(!"implemented; needs Type.cpp in build"); 323 // // produce the TupleType which aggregates the types of the exprs 324 // std::vector<ast::ptr<ast::Type>> types; 325 // ast::CV::Qualifiers quals{ 326 // ast::CV::Const | ast::CV::Volatile | ast::CV::Restrict | ast::CV::Lvalue | 327 // ast::CV::Atomic | ast::CV::Mutex }; 328 329 // for ( const ast::Expr * expr : exprs ) { 330 // assert( expr->result ); 331 // // if the type of any expr is void, the type of the entire tuple is void 332 // if ( expr->result->isVoid() ) return new ast::VoidType{}; 333 334 // // qualifiers on the tuple type are the qualifiers that exist on all components 335 // quals &= expr->result->qualifiers; 336 337 // types.emplace_back( expr->result ); 338 // } 339 340 // if ( exprs.empty() ) { quals = ast::CV::Qualifiers{}; } 341 // return new ast::TupleType{ std::move(types), quals }; 342 } 316 343 317 344 TypeInstType * isTtype( Type * type ) { -
src/Tuples/Tuples.h
rf3cc5b6 r9b4f329 19 19 #include <vector> 20 20 21 #include "AST/Fwd.hpp" 22 #include "AST/Node.hpp" 21 23 #include "SynTree/Expression.h" 22 24 #include "SynTree/Declaration.h" … … 42 44 /// returns VoidType if any of the expressions have Voidtype, otherwise TupleType of the Expression result types 43 45 Type * makeTupleType( const std::list< Expression * > & exprs ); 46 const ast::Type * makeTupleType( const std::vector<ast::ptr<ast::Expr>> & exprs ); 44 47 45 48 /// returns a TypeInstType if `type` is a ttype, nullptr otherwise
Note: See TracChangeset
for help on using the changeset viewer.