| 644 | |
| 645 | template <naming naming_type = naming::general> |
| 646 | void define_name(const id id, std::string name) |
| 647 | { |
| 648 | assert(!name.empty()); |
| 649 | if constexpr (naming_type != naming::expression) |
| 650 | if (name[0] == '_') |
| 651 | return; // Filter out names that may clash with automatic ones |
| 652 | if constexpr (naming_type != naming::reserved) |
| 653 | name = escape_name(std::move(name)); |
| 654 | if constexpr (naming_type == naming::general) |
| 655 | if (std::find_if(_names.begin(), _names.end(), |
| 656 | [&name](const auto &names_it) { return names_it.second == name; }) != _names.end()) |
| 657 | name += '_' + std::to_string(id); // Append a numbered suffix if the name already exists |
| 658 | _names[id] = std::move(name); |
| 659 | } |
| 660 | |
| 661 | uint32_t semantic_to_location(const std::string &semantic, uint32_t max_attributes = 1) |
| 662 | { |
nothing calls this directly
no test coverage detected