diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/ir/names.h | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/src/ir/names.h b/src/ir/names.h index 94efd91d4..cefeb5b42 100644 --- a/src/ir/names.h +++ b/src/ir/names.h @@ -48,8 +48,7 @@ inline void ensureNames(Function* func) { // Given a root of a name, finds a valid name with perhaps a number appended // to it, by calling a function to check if a name is valid. -inline Name -getValidName(Module& module, Name root, std::function<bool(Name)> check) { +inline Name getValidName(Name root, std::function<bool(Name)> check) { if (check(root)) { return root; } @@ -65,29 +64,28 @@ getValidName(Module& module, Name root, std::function<bool(Name)> check) { } inline Name getValidExportName(Module& module, Name root) { - return getValidName( - module, root, [&](Name test) { return !module.getExportOrNull(test); }); + return getValidName(root, + [&](Name test) { return !module.getExportOrNull(test); }); } inline Name getValidGlobalName(Module& module, Name root) { - return getValidName( - module, root, [&](Name test) { return !module.getGlobalOrNull(test); }); + return getValidName(root, + [&](Name test) { return !module.getGlobalOrNull(test); }); } inline Name getValidFunctionName(Module& module, Name root) { return getValidName( - module, root, [&](Name test) { return !module.getFunctionOrNull(test); }); + root, [&](Name test) { return !module.getFunctionOrNull(test); }); } inline Name getValidTableName(Module& module, Name root) { - return getValidName( - module, root, [&](Name test) { return !module.getTableOrNull(test); }); + return getValidName(root, + [&](Name test) { return !module.getTableOrNull(test); }); } inline Name getValidEventName(Module& module, Name root) { - return getValidName( - module, root, [&](Name test) { return !module.getEventOrNull(test); }); + return getValidName(root, + [&](Name test) { return !module.getEventOrNull(test); }); } inline Name getValidElementSegmentName(Module& module, Name root) { - return getValidName(module, root, [&](Name test) { - return !module.getElementSegmentOrNull(test); - }); + return getValidName( + root, [&](Name test) { return !module.getElementSegmentOrNull(test); }); } } // namespace Names |