diff options
author | Alon Zakai <azakai@google.com> | 2024-06-12 11:05:28 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-12 11:05:28 -0700 |
commit | ac21c8cc9204e09fab070d2fd915e7ab583a5dac (patch) | |
tree | 190a13113804b3c6ea01dd71f44694e1b6111be0 /src/emscripten-optimizer/optimizer-shared.cpp | |
parent | 475841dd5f0c50d7072f6dfc26dffd66e02abc10 (diff) | |
download | binaryen-ac21c8cc9204e09fab070d2fd915e7ab583a5dac.tar.gz binaryen-ac21c8cc9204e09fab070d2fd915e7ab583a5dac.tar.bz2 binaryen-ac21c8cc9204e09fab070d2fd915e7ab583a5dac.zip |
[DebugInfo] Copy debug info in call-utils.h (#6652)
We automatically copy debuginfo in replaceCurrent(), but there are a few
places that do other operations than simple replacements. call-utils.h will
turn a call_ref with a select target into two direct calls, and we were missing
the logic to copy debuginfo from the call_ref to the calls.
To make this work, refactor out the copying logic from wasm-traversal, into
debuginfo.h, and use it in call-utils.h.
debuginfo.h itself is renamed from debug.h (as now this needs to be included
from wasm-traversal, which nearly everything does, and it turns out some files
have internal stuff like a debug() helper that ends up conflicing with the old
debug namespace).
Also rename the old copyDebugInfo function to copyDebugInfoBetweenFunctions
which is more explicit. That is also moved from the header to a cpp file because
it depends on wasm-traversal (so we'd end up with recursive headers otherwise).
That is fine, as that method is called after copying a function, which is not that
frequent. The new copyDebugInfoToReplacement (which was refactored out of
wasm-traversal) is in the header because it can be called very frequently (every
single instruction we optimize) and we want it to get inlined.
Diffstat (limited to 'src/emscripten-optimizer/optimizer-shared.cpp')
0 files changed, 0 insertions, 0 deletions