diff options
author | Alon Zakai <azakai@google.com> | 2023-01-30 17:17:32 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-31 01:17:32 +0000 |
commit | 0dbff752a5bb885c794211294bae5ca300f5bc59 (patch) | |
tree | faa5ba8686381f5a36efac1e026c2e12d807e173 /scripts/clang-format-diff.sh | |
parent | d19c31b371aab47dedd166c2d056f1c583c6a9a0 (diff) | |
download | binaryen-0dbff752a5bb885c794211294bae5ca300f5bc59.tar.gz binaryen-0dbff752a5bb885c794211294bae5ca300f5bc59.tar.bz2 binaryen-0dbff752a5bb885c794211294bae5ca300f5bc59.zip |
[NFC] Refactor RemoveUsedModuleElements to clarify references and uses (#5444)
This pass talked about reachability and uses and such, but it wasn't very clear
on those things. This refactors it to clarify that we look for references and uses,
and what that means. Specifically, a reference to something makes us keep it
alive, as we need to refer to it; a use makes us also keep it identical in its
contents so that when it is used no behavior changes. A function reference
without a call_ref that can call it is an example of a reference without a use,
which this pass already optimized.
To make that more clear in the code, this refactors out the reference-finding
logic into a new struct, ReferenceFinder.
This also replaces the normal walking logic with a more manual traversal
using ChildIterator. This is necessary to properly differentiate references from
uses, but is not immediately useful in this PR except for clarity. It will be
necessary in the next PR, which this prepares for, in which we'll optimize more
reference-but-not-use things.
Diffstat (limited to 'scripts/clang-format-diff.sh')
0 files changed, 0 insertions, 0 deletions