Changeset 4dc3b8c for src/Tuples
- Timestamp:
- Nov 30, 2023, 6:14:20 PM (2 years ago)
- Branches:
- master, stuck-waitfor-destruct
- Children:
- 2f8d351
- Parents:
- 7f2bfb7 (diff), c4570af3 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)links above to see all the changes relative to each parent. - Location:
- src/Tuples
- Files:
-
- 1 deleted
- 2 edited
- 1 moved
-
TupleAssignment.cc (modified) (3 diffs)
-
TupleExpansion.cc (deleted)
-
TupleExpansion.cpp (moved) (moved from src/Tuples/TupleExpansionNew.cpp ) (2 diffs)
-
module.mk (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
src/Tuples/TupleAssignment.cc
r7f2bfb7 r4dc3b8c 13 13 // Update Count : 10 14 14 // 15 16 #include "Tuples.h" 15 17 16 18 #include <algorithm> // for transform … … 224 226 // by the cast type as needed, and transfer the resulting environment. 225 227 ResolvExpr::CandidateFinder finder( spotter.crntFinder.context, env ); 226 finder.find( rhsCand->expr, ResolvExpr::Resolv Mode::withAdjustment() );228 finder.find( rhsCand->expr, ResolvExpr::ResolveMode::withAdjustment() ); 227 229 assert( 1 == finder.candidates.size() ); 228 230 env = std::move( finder.candidates.front()->env ); … … 345 347 346 348 try { 347 finder.find( expr, ResolvExpr::Resolv Mode::withAdjustment() );349 finder.find( expr, ResolvExpr::ResolveMode::withAdjustment() ); 348 350 } catch (...) { 349 351 // No match is not failure, just that this tuple assignment is invalid. -
src/Tuples/TupleExpansion.cpp
r7f2bfb7 r4dc3b8c 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // TupleExpansion New.cpp --7 // TupleExpansion.cpp -- 8 8 // 9 9 // Author : Henry Xue … … 294 294 } 295 295 296 const ast::Type * makeTupleType( const std::vector<ast::ptr<ast::Expr>> & exprs ) { 297 // If there are no expressions, the answer is set, otherwise go through a loop. 298 if ( exprs.empty() ) return new ast::TupleType( {} ); 299 300 std::vector<ast::ptr<ast::Type>> types; 301 ast::CV::Qualifiers quals( 302 ast::CV::Const | ast::CV::Volatile | ast::CV::Restrict | 303 ast::CV::Atomic | ast::CV::Mutex ); 304 305 for ( const ast::Expr * expr : exprs ) { 306 assert( expr->result ); 307 // If the type of any expr is void, the type of the entire tuple is void. 308 if ( expr->result->isVoid() ) return new ast::VoidType(); 309 310 // Qualifiers on the tuple type are the qualifiers that exist on all components. 311 quals &= expr->result->qualifiers; 312 313 types.emplace_back( expr->result ); 314 } 315 316 return new ast::TupleType( std::move( types ), quals ); 317 } 318 319 const ast::TypeInstType * isTtype( const ast::Type * type ) { 320 if ( const ast::TypeInstType * inst = dynamic_cast< const ast::TypeInstType * >( type ) ) { 321 if ( inst->base && inst->base->kind == ast::TypeDecl::Ttype ) { 322 return inst; 323 } 324 } 325 return nullptr; 326 } 327 296 328 } // namespace Tuples 329 -
src/Tuples/module.mk
r7f2bfb7 r4dc3b8c 19 19 Tuples/Explode.h \ 20 20 Tuples/TupleAssignment.cc \ 21 Tuples/TupleExpansion.cc \ 22 Tuples/TupleExpansionNew.cpp \ 21 Tuples/TupleExpansion.cpp \ 23 22 Tuples/Tuples.cc \ 24 23 Tuples/Tuples.h
Note:
See TracChangeset
for help on using the changeset viewer.