| 539 | } |
| 540 | |
| 541 | [[gnu::hot]] |
| 542 | task_t RGDAstParser::construct_task(const clause_t &clause) { |
| 543 | task_t task = std::make_shared<rgd::SearchTask>(); |
| 544 | for (auto const& node: clause) { |
| 545 | auto itr = constraint_cache.find(node->label()); |
| 546 | if (itr != constraint_cache.end()) { |
| 547 | task->add_constraint(itr->second, node->kind()); |
| 548 | continue; |
| 549 | } |
| 550 | // save the comparison op because we may have negated it |
| 551 | // during transformation |
| 552 | constraint_t constraint = parse_constraint(node->label()); |
| 553 | // to maximize the resuability of the AST, the relational operator |
| 554 | // is recorded elsewhere |
| 555 | if (likely(constraint != nullptr)) { |
| 556 | task->add_constraint(constraint, node->kind()); |
| 557 | constraint_cache.insert({node->label(), constraint}); |
| 558 | } |
| 559 | } |
| 560 | if (!task->empty()) { |
| 561 | task->finalize(); |
| 562 | return task; |
| 563 | } |
| 564 | return nullptr; |
| 565 | } |
| 566 | |
| 567 | // sometimes llvm will zext bool |
| 568 | dfsan_label RGDAstParser::strip_zext(dfsan_label label) { |