diff options
Diffstat (limited to 'src/binding-hash.cc')
-rw-r--r-- | src/binding-hash.cc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/binding-hash.cc b/src/binding-hash.cc index ec180603..d1297d92 100644 --- a/src/binding-hash.cc +++ b/src/binding-hash.cc @@ -19,6 +19,8 @@ #include <algorithm> #include <vector> +#include "ir.h" + namespace wabt { void BindingHash::FindDuplicates(DuplicateCallback callback) const { @@ -30,6 +32,12 @@ void BindingHash::FindDuplicates(DuplicateCallback callback) const { } } +Index BindingHash::FindIndex(const Var& var) const { + if (var.type == VarType::Name) + return FindIndex(var.name); + return var.index; +} + void BindingHash::CreateDuplicatesVector( ValueTypeVector* out_duplicates) const { // This relies on the fact that in an unordered_multimap, all values with the |