nir: check NIR_SKIP to skip passes by name
Passes' function names, separated by comma, listed in NIR_SKIP environment variable will be skipped in debug mode. The mechanism is hooked into the _PASS macro, like NIR_PRINT. The extra macro NIR_SKIP is available as a developer convenience, to skip at pointer other than the passes entry points. v2: Fix typo in NIR_SKIP macro. (Bas) Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com> Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
This commit is contained in:
@@ -53,6 +53,20 @@ parse_debug_string(const char *debug,
|
||||
return flag;
|
||||
}
|
||||
|
||||
bool
|
||||
comma_separated_list_contains(const char *list, const char *s)
|
||||
{
|
||||
assert(list);
|
||||
const size_t len = strlen(s);
|
||||
|
||||
for (unsigned n; n = strcspn(list, ","), *list; list += MAX2(1, n)) {
|
||||
if (n == len && !strncmp(list, s, n))
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reads an environment variable and interprets its value as a boolean.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user