[PATCH] D116100: [Utils][LoongArch](5/6) Add a --bits-endian option to extract-section.py
WÁNG Xuěruì via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sat Dec 25 04:02:35 PST 2021
xen0n added inline comments.
================
Comment at: llvm/utils/extract-section.py:64
+ choices=['little', 'big'],
+ help='Print out bits in specified endianness (little or big), default to big')
format_group.add_argument('-h', dest='format', action='store_const', const='hex',
----------------
Fixed grammar and punctuation: `Print out bits in specified endianness (little or big); defaults to big`
================
Comment at: llvm/utils/extract-section.py:72
arg_parser.set_defaults(format='bits', tool_path='llvm-readobj', input_file='-',
- byte_indicator=False, hex_width=4)
+ byte_indicator=False, hex_width=4, endian='big')
args = arg_parser.parse_args()
----------------
This probably should be `bits_endian` to agree with the addition above; while looking at the surrounding it seems `tool_path` should be `readobj_path` too. I'm not entirely sure though.
================
Comment at: llvm/utils/extract-section.py:88-90
+ offsets = (24,16,8,0)
+ if args.endian == 'little':
+ offsets = (0,8,16,24)
----------------
While we're at it, add a space after every comma for general PEP8 cleanness?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D116100/new/
https://reviews.llvm.org/D116100
More information about the llvm-commits
mailing list