| 572 | } |
| 573 | |
| 574 | bool KernelSignature::MatchesInputs(const std::vector<TypeHolder>& types) const { |
| 575 | if (is_varargs_) { |
| 576 | for (size_t i = 0; i < types.size(); ++i) { |
| 577 | if (!in_types_[std::min(i, in_types_.size() - 1)].Matches(*types[i])) { |
| 578 | return false; |
| 579 | } |
| 580 | } |
| 581 | } else { |
| 582 | if (types.size() != in_types_.size()) { |
| 583 | return false; |
| 584 | } |
| 585 | for (size_t i = 0; i < in_types_.size(); ++i) { |
| 586 | if (!in_types_[i].Matches(*types[i])) { |
| 587 | return false; |
| 588 | } |
| 589 | } |
| 590 | } |
| 591 | if (constraint_ && !constraint_->Matches(types)) { |
| 592 | return false; |
| 593 | } |
| 594 | return true; |
| 595 | } |
| 596 | |
| 597 | size_t KernelSignature::Hash() const { |
| 598 | if (hash_code_ != 0) { |