- File:
-
- 1 edited
-
src/ResolvExpr/ResolveAssertions.cc (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/ResolvExpr/ResolveAssertions.cc
r4d2d45f9 re1f7eef 20 20 #include <list> // for list 21 21 #include <memory> // for unique_ptr 22 #include <sstream> // for ostringstream 23 #include <string> // for string 22 #include <string> 24 23 #include <unordered_map> // for unordered_map, unordered_multimap 25 24 #include <utility> // for move … … 28 27 #include "Alternative.h" // for Alternative, AssertionItem, AssertionList 29 28 #include "Common/FilterCombos.h" // for filterCombos 30 #include "Common/Indenter.h" // for Indenter31 29 #include "Common/utility.h" // for sort_mins 32 30 #include "ResolvExpr/RenameVars.h" // for renameTyVars … … 99 97 return { item, item.matches[i] }; 100 98 } 101 102 const DeclarationWithType* get_decl() const { return cache->at(key).deferIds[0].decl; }103 99 104 100 // sortable by key … … 368 364 static const int recursionLimit = /* 10 */ 4; 369 365 370 void resolveAssertions( Alternative& alt, const SymTab::Indexer& indexer, AltList& out , std::list<std::string>& errors) {366 void resolveAssertions( Alternative& alt, const SymTab::Indexer& indexer, AltList& out ) { 371 367 // finish early if no assertions to resolve 372 368 if ( alt.need.empty() ) { … … 389 385 for ( auto& assn : resn.need ) { 390 386 // fail early if any assertion is not resolvable 391 if ( ! resolveAssertion( assn, resn, assnCache ) ) { 392 Indenter tabs{ Indenter::tabsize, 3 }; 393 std::ostringstream ss; 394 ss << tabs << "Unsatisfiable alternative:\n"; 395 resn.alt.print( ss, ++tabs ); 396 ss << --tabs << "Could not satisfy assertion:\n"; 397 assn.decl->print( ss, ++tabs ); 398 399 errors.emplace_back( ss.str() ); 400 goto nextResn; 401 } 387 if ( ! resolveAssertion( assn, resn, assnCache ) ) goto nextResn; 402 388 } 403 389 … … 418 404 resn.deferred, 419 405 CandidateEnvMerger{ resn.alt.env, resn.alt.openVars, resn.indexer } ); 420 // fail early if no mutually-compatible assertion satisfaction421 if ( compatible.empty() ) {422 Indenter tabs{ Indenter::tabsize, 3 };423 std::ostringstream ss;424 ss << tabs << "Unsatisfiable alternative:\n";425 resn.alt.print( ss, ++tabs );426 ss << --tabs << "No mutually-compatible satisfaction for assertions:\n";427 ++tabs;428 for ( const auto& d : resn.deferred ) {429 d.get_decl()->print( ss, tabs );430 }431 432 errors.emplace_back( ss.str() );433 goto nextResn;434 }435 406 // sort by cost 436 407 CandidateCost coster{ resn.indexer };
Note:
See TracChangeset
for help on using the changeset viewer.