continue;
}
+ /* This may be a multi-token feature string. We need to match
+ all parts in one of the "|" separated sublists. */
bool enabled = true;
-
- /* This may be a multi-token feature string. We need
- to match all parts, which could be in any order. */
- std::set<std::string> tokens;
- split_words (val, tokens);
- std::set<std::string>::iterator it;
-
- /* Iterate till the first feature isn't found or all of them
- are found. */
- for (it = tokens.begin (); enabled && it != tokens.end (); ++it)
- enabled = enabled && features.count (*it);
+ size_t cur = 0;
+ while (cur < val.length ())
+ {
+ size_t end = val.find_first_of (" ", cur);
+ if (end == std::string::npos)
+ end = val.length ();
+ std::string word = val.substr (cur, end - cur);
+ cur = end + 1;
+
+ if (word == "|")
+ {
+ /* If we've matched everything in the current sublist, we
+ can stop now. */
+ if (enabled)
+ break;
+ /* Otherwise, start again with the next sublist. */
+ enabled = true;
+ continue;
+ }
+ enabled = enabled && features.count (word);
+ }
if (enabled)
extension_flags |= aarch64_extensions[i].flag;