diff options
author | Alon Zakai <azakai@google.com> | 2020-11-09 12:15:04 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-09 12:15:04 -0800 |
commit | ffdaad6adb8fa45f3c9021228b8e880ca02ff9b9 (patch) | |
tree | b306dfb66e6f5e320ebc1f6fa1048c55490665f1 /check.py | |
parent | 47607d445b62c98017ce4b9c6cc69b61fae85aa5 (diff) | |
download | binaryen-ffdaad6adb8fa45f3c9021228b8e880ca02ff9b9.tar.gz binaryen-ffdaad6adb8fa45f3c9021228b8e880ca02ff9b9.tar.bz2 binaryen-ffdaad6adb8fa45f3c9021228b8e880ca02ff9b9.zip |
Avoid boilerplate code with a big universal delegation header (#3294)
To get an idea, this is a sample from the header:
switch (DELEGATE_ID) {
[..]
case Expression::Id::BlockId: {
DELEGATE_START(Block);
DELEGATE_FIELD_CHILD_LIST(Block, list);
DELEGATE_FIELD_SCOPE_NAME(Block, name);
DELEGATE_END(Block);
break;
}
A switch is defined (on some DELEGATE_ID that is provided). There is then
a case for each expression type, calling a delegate for each field type. This allows
a user to define the delegates it wants, then include this header.
This uses the new header in the copying logic, where the rewrite also
avoids recursion.
This fixes a missing BrOnExn::sent scanning in the existing
hashing/comparing code (which is what I used as a basis). When this is
used there, it will fix that bug.
Diffstat (limited to 'check.py')
0 files changed, 0 insertions, 0 deletions