diff options
author | Thomas Lively <7121787+tlively@users.noreply.github.com> | 2020-12-15 00:12:42 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-14 21:12:42 -0800 |
commit | eff70e05b38e4e86ccbae169dbd400711f2fd561 (patch) | |
tree | 75216172ec8be03b9c75c89886692d5dcdca2936 /src/tools | |
parent | b4928af5e70c85d309f7a074ed80bbcd1ee414f9 (diff) | |
download | binaryen-eff70e05b38e4e86ccbae169dbd400711f2fd561.tar.gz binaryen-eff70e05b38e4e86ccbae169dbd400711f2fd561.tar.bz2 binaryen-eff70e05b38e4e86ccbae169dbd400711f2fd561.zip |
Use enums for mutability and nullability (#3443)
Previously we were using bools for both of these concepts, but using enums makes
the code clearer. In particular, the PR removes many instances of
`/*nullability=*/ true`.
Diffstat (limited to 'src/tools')
-rw-r--r-- | src/tools/fuzzing.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/tools/fuzzing.h b/src/tools/fuzzing.h index 621555ab1..7d9131767 100644 --- a/src/tools/fuzzing.h +++ b/src/tools/fuzzing.h @@ -1478,7 +1478,7 @@ private: for (const auto& type : target->sig.params) { args.push_back(make(type)); } - auto targetType = Type(HeapType(target->sig), /* nullable = */ true); + auto targetType = Type(HeapType(target->sig), Nullable); // TODO: half the time make a completely random item with that type. return builder.makeCallRef( builder.makeRefFunc(target->name, targetType), args, type, isReturn); @@ -2066,7 +2066,7 @@ private: if (!wasm.functions.empty() && !oneIn(wasm.functions.size())) { target = pick(wasm.functions).get(); } - auto type = Type(HeapType(target->sig), /* nullable = */ true); + auto type = Type(HeapType(target->sig), Nullable); return builder.makeRefFunc(target->name, type); } if (type == Type::i31ref) { @@ -2079,7 +2079,7 @@ private: for (auto& func : wasm.functions) { // FIXME: RefFunc type should be non-nullable, but we emit nullable // types for now. - if (type == Type(HeapType(func->sig), /* nullable = */ true)) { + if (type == Type(HeapType(func->sig), Nullable)) { return builder.makeRefFunc(func->name, type); } } |