diff options
Diffstat (limited to 'src/ir')
-rw-r--r-- | src/ir/names.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/ir/names.h b/src/ir/names.h index b2165c2c2..b908ad0e7 100644 --- a/src/ir/names.h +++ b/src/ir/names.h @@ -92,6 +92,12 @@ inline Name getValidLocalName(Function& func, Name root) { [&](Name test) { return !func.hasLocalIndex(test); }); } +template<typename T> +inline Name getValidNameGivenExisting(Name root, const T& existingNames) { + return getValidName(root, + [&](Name test) { return !existingNames.count(test); }); +} + class MinifiedNameGenerator { size_t state = 0; |