]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
gas: scfi: make gen_scfi_ops more readable users/ibhagat/try-sframe-scfi-next
authorIndu Bhagat <indu.bhagat@oracle.com>
Tue, 11 Jun 2024 00:26:46 +0000 (17:26 -0700)
committerIndu Bhagat <indu.bhagat@oracle.com>
Tue, 25 Jun 2024 17:10:06 +0000 (10:10 -0700)
commit31aacdb73abe8ebd2fb7007ebc57f62a7c2c3572
treea4df9b6584f5a81c0eb4c1d1c6a38a18d728b8f5
parentab2b4d34452cc14b75052d3416c433b25543df35
gas: scfi: make gen_scfi_ops more readable

Replace the scattered and repeated uses of verbose expressions with
variables:
  ginsn_get_src_reg (src1)  -> src1_reg
  ginsn_get_src_type (src1) -> src1_type
etc.

This hopefully makes the logic more readable.  While at it, make some of
the checks more precise:
  - When getting imm value, ensure the src type is GINSN_SRC_IMM,
  - When getting reg, ensure the src type is checked too (GINSN_SRC_REG
    or GINSN_SRC_INDIRECT as appropriate).

ChangeLog:

        * gas/scfi.c (gen_scfi_ops): Add new local vars and reuse them.
Make some conditionals more precise.
gas/scfi.c