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

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 14 00:04:52 PDT 2021


jhenderson accepted this revision.
jhenderson added a comment.
This revision is now accepted and ready to land.

LGTM, but please wait for someone else too.



================
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
+
----------------
MaskRay wrote:
> 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.
Fortunately, I don't work with `opt` or `llc` very often :)


================
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()
----------------
MaskRay wrote:
> 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?
It's mostly about making the table pretty, because as things stand, the columns will regularly not line up. However, if you think the machine parsing support is more useful, that's fine by me.


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