summaryrefslogtreecommitdiff
path: root/src/asm2wasm.h
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2020-06-25 16:58:04 -0700
committerGitHub <noreply@github.com>2020-06-25 16:58:04 -0700
commit0d5eca6cf4f61798d0854226d2c78d2655e07c30 (patch)
treee25cad47d636a4b301983a5edb34addda582f719 /src/asm2wasm.h
parenteae2ee3dff0c68cfa783f45ee3ced06f4b5aa47c (diff)
downloadbinaryen-0d5eca6cf4f61798d0854226d2c78d2655e07c30.tar.gz
binaryen-0d5eca6cf4f61798d0854226d2c78d2655e07c30.tar.bz2
binaryen-0d5eca6cf4f61798d0854226d2c78d2655e07c30.zip
DWARF: Track sequences so that we can handle reordering within one (#2932)
Previously we tracked sequence ends, so if an instruction was marked as the end, we'd keep marking it that way in the output. However, if X, Y, Z form a sequence that is then reordered into Z, Y, X then we need to emit the end on X now. To do that, give a "sequence number" to each debug line. Then when emitting, we can tell if two adjacent lines are in a sequence or not, and emit the end properly. This fixes a large partner testcase, allowing llvm-dwarfdump --verify --debug-line to pass on it. With this change it is easier to remove the hackish handling of prologueEnd that we had before, where we reset it. Instead, just emit it when it is set, and that's all. In particular we can get rid of the // Reset the state and resetAfterLine() calls in emitDiff. That function now just emits a diff, with no side effects, and is marked const. This refactoring moves the needToEmit() check to an earlier place. Instead of noting lines we'll never emit, don't even note them at all. The test diff seems large, but it is all due to one small change that then changes all the later offsets: - 0x00000831: 01 DW_LNS_copy - 0x000000000000086e 43 4 1 0 0 is_stmt + 0x00000831: 00 DW_LNE_end_sequence + 0x000000000000086e 43 4 1 0 0 is_stmt end_sequence Note how we add end_sequence there. We used to have an entry right after it with line 0 that was marked as the end of the sequence. In the new code, we don't emit that unnecessary line (which was previously only emitted for the end sequence!) and instead emit the end sequence on the last valid line.
Diffstat (limited to 'src/asm2wasm.h')
0 files changed, 0 insertions, 0 deletions