| 556 | } |
| 557 | |
| 558 | bool KernelSignature::MatchesInputs(const std::vector<TypeHolder>& types) const { |
| 559 | if (is_varargs_) { |
| 560 | for (size_t i = 0; i < types.size(); ++i) { |
| 561 | if (!in_types_[std::min(i, in_types_.size() - 1)].Matches(*types[i])) { |
| 562 | return false; |
| 563 | } |
| 564 | } |
| 565 | } else { |
| 566 | if (types.size() != in_types_.size()) { |
| 567 | return false; |
| 568 | } |
| 569 | for (size_t i = 0; i < in_types_.size(); ++i) { |
| 570 | if (!in_types_[i].Matches(*types[i])) { |
| 571 | return false; |
| 572 | } |
| 573 | } |
| 574 | } |
| 575 | if (constraint_ && !constraint_->Matches(types)) { |
| 576 | return false; |
| 577 | } |
| 578 | return true; |
| 579 | } |
| 580 | |
| 581 | size_t KernelSignature::Hash() const { |
| 582 | if (hash_code_ != 0) { |