Changeset 07d867b for src/ResolvExpr
- Timestamp:
- Aug 10, 2020, 7:45:18 PM (4 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 22f94a4
- Parents:
- ba662b9
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/ResolvExpr/SatisfyAssertions.cpp
rba662b9 r07d867b 188 188 189 189 matches.emplace_back( 190 cdata, adjType, std::move( newEnv ), std::move( newNeed ), std::move( have ),190 cdata, adjType, std::move( newEnv ), std::move( have ), std::move( newNeed ), 191 191 std::move( newOpen ), crntResnSlot ); 192 192 } … … 231 231 const ast::Expr * postvisit( const ast::Expr * expr ) { 232 232 // Skip if no slots to find 233 if ( expr->inferred.mode != ast::Expr::InferUnion::Slots ) return expr; 234 233 if ( !expr->inferred.hasSlots() ) return expr; 234 // if ( expr->inferred.mode != ast::Expr::InferUnion::Slots ) return expr; 235 std::vector<UniqueId> missingSlots; 235 236 // find inferred parameters for resolution slots 236 ast::InferredParams newInferred;237 ast::InferredParams * newInferred = new ast::InferredParams(); 237 238 for ( UniqueId slot : expr->inferred.resnSlots() ) { 238 239 // fail if no matching assertions found … … 240 241 if ( it == inferred.end() ) { 241 242 std::cerr << "missing assertion " << slot << std::endl; 243 missingSlots.push_back(slot); 242 244 continue; 243 245 } … … 247 249 // recurse on inferParams of resolved expressions 248 250 entry.second.expr = postvisit( entry.second.expr ); 249 auto res = newInferred .emplace( entry );251 auto res = newInferred->emplace( entry ); 250 252 assert( res.second && "all assertions newly placed" ); 251 253 } … … 253 255 254 256 ast::Expr * ret = mutate( expr ); 255 ret->inferred.set_inferParams( std::move( newInferred ) ); 257 ret->inferred.set_inferParams( newInferred ); 258 if (!missingSlots.empty()) ret->inferred.resnSlots() = missingSlots; 256 259 return ret; 257 260 }
Note: See TracChangeset
for help on using the changeset viewer.