diff options
author | Alon Zakai <azakai@google.com> | 2020-01-16 09:37:26 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-16 09:37:26 -0800 |
commit | 5d2c760fa086b9964ec22156a4cdf3847b019b76 (patch) | |
tree | 8521ca3c1d4207c48a8111947b83ab80b90387d9 /third_party/llvm-project/include/llvm/BinaryFormat | |
parent | 719b4d7d7897e25e5868989f0c708565e12d3295 (diff) | |
download | binaryen-5d2c760fa086b9964ec22156a4cdf3847b019b76.tar.gz binaryen-5d2c760fa086b9964ec22156a4cdf3847b019b76.tar.bz2 binaryen-5d2c760fa086b9964ec22156a4cdf3847b019b76.zip |
DWARF: Function location tracking (#2592)
Track the beginning and end of each function, both when reading
and writing.
We track expressions and functions separately, instead of having a single
big map of (oldAddr) => (newAddr) because of the potentially ambiguous case
of the final expression in a function: it's end might be identical in offset
to the end of the function. So we have two different things that map to the
same offset. However, if the context is "the end of the function" then the
updated address is the new end of the function, even if the function ends
with a different instruction now, as the old last instruction might have
moved or been optimized out. Concretely, we have getNewExprAddr
and getNewFuncAddr, so we can ask to update the location of either
an expression or a function, and use that contextual information.
This checks for the DIE tag in order to know what we are looking for.
To be safe, if we hit an unknown tag, we halt, so that we don't silently
miss things.
As the test updates show, the new things we can do thanks to this
PR are to update compile unit and subprogram low_pc locations.
Note btw that in the first test (dwarfdump_roundtrip_dwarfdump.bin.txt)
we change 5 to 0: that is correct since that test does not write out
DWARF (it intentionally has no -g), so we do not track binary
locations while writing, and so we have nothing to update to (the
other tests show actual updating).
Also fix the order in the python test runner code to show a diff
of expected to encountered, and not the reverse, which confused
me.
Diffstat (limited to 'third_party/llvm-project/include/llvm/BinaryFormat')
0 files changed, 0 insertions, 0 deletions