[PATCH] D125643: [ARM SEH 1] [llvm-readobj] Fix printing of Windows ARM unwind opcodes, add tests

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun May 15 14:30:00 PDT 2022


mstorsjo created this revision.
mstorsjo added reviewers: efriedma, rnk, zzheng.
Herald added subscribers: rupprecht, kristof.beyls.
Herald added a reviewer: jhenderson.
Herald added a project: All.
mstorsjo requested review of this revision.
Herald added a subscriber: MaskRay.
Herald added a project: LLVM.

The existing code was essentially untested; in some cases, it used
too narrow variable types to fit all the bits, in some cases the
bit manipulation operations were incorrect.

For the "ldr lr, [sp], #x" opcode, there's nothing in the documentation
that says it cannot be used in a prologue. (In practice, it would
probably seldom be used there, but technically there's nothing
stopping it from being used.) The documentation only specifies the
operation to replay for unwinding it, but the corresponding mirror
instruction to be printed for a prologue is "str lr, [sp, #-x]!".

Also improve printing of register masks, by aggregating registers
into ranges where possible, and make the printing of the terminating
branches clearer, as "bx <reg>" and "b.w <target>".


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D125643

Files:
  llvm/test/tools/llvm-readobj/COFF/arm-unwind-opcodes.s
  llvm/tools/llvm-readobj/ARMWinEHPrinter.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D125643.429561.patch
Type: text/x-patch
Size: 14577 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220515/b72beba0/attachment.bin>


More information about the llvm-commits mailing list