Currently strace llvm-dwarfdump x.debug >/tmp/file:
ioctl(1, TCGETS, 0x7ffd64d7f340) = -1 ENOTTY (Inappropriate ioctl for device) write(1, " DW_AT_decl_line\t(89)\n"..., 4096) = 4096 ioctl(1, TCGETS, 0x7ffd64d7f400) = -1 ENOTTY (Inappropriate ioctl for device) ioctl(1, TCGETS, 0x7ffd64d7f410) = -1 ENOTTY (Inappropriate ioctl for device) ioctl(1, TCGETS, 0x7ffd64d7f400) = -1 ENOTTY (Inappropriate ioctl for device)
After this patch:
write(1, "0000000000001102 \"strlen\")\n "..., 4096) = 4096 write(1, "site\n DW_AT_low"..., 4096) = 4096 write(1, "d53)\n\n0x000e4d4d: DW_TAG_G"..., 4096) = 4096
The same speedup can be achieved by --color=0 but that is not much convenient.
After this patch it still uses ioctl for printing DWARF parsing errors.
Maybe raw_ostream &OS could be moved into DIDumpOptions DumpOpts which would somehow make this patch more simple, I can investigate it more and change it upon request.
I can also drop this patch if it looks too hacky.
clang-tidy: warning: invalid case style for function 'GetModeForOS' [readability-identifier-naming]
not useful