[PATCH] D109572: [ELF] Add --why-extract= to query why an archive member/lazy object file is extracted

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 13 11:07:41 PDT 2021


MaskRay added inline comments.


================
Comment at: lld/test/ELF/why-extract.s:14
+# RUN: ld.lld main.o a_b.a b.a -o /dev/null --why-extract=why.txt
+# RUN: FileCheck %s --match-full-lines --strict-whitespace < why.txt
+
----------------
jhenderson wrote:
> I might suggest changing `< why.txt` to `--input-file=why.txt`, but it's entirely up to you. My motivation is that when using the PowerShell termainl, the `<` character is reserved and not used for stdin for some reason, which means you can't copy and paste this sort of line to aid in debugging.
OK, that's why some FileCheck tests use `--input-file=`... 

Most probably just consider this form more verbose than `<`, though...

Particularly in optimization and codegen test directories, `opt <` and `llc <` are really really common.


================
Comment at: lld/test/ELF/why-extract.s:15-17
+#      CHECK:reference	extracted	symbol
+# CHECK-NEXT:main.o	a_b.a(a_b.o)	a
+# CHECK-NEXT:a_b.a(a_b.o)	b.a(b.o)	b()
----------------
jhenderson wrote:
> I'm not entirely sure what the right solution here is, but I think this output needs to be better tabulated, so that the columns line up (possibly with the exception of long names). Possibly alternatively, rather than using tabs to separate, how about some other symbol like `;` or `|`?
I pick `\t` because tsv files are common (awk one-linear just directly work on it without setting the field separator).

`;` or `|` separators are uncommon.

The terminal display probably doesn't matter that much?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D109572/new/

https://reviews.llvm.org/D109572



More information about the llvm-commits mailing list