[PATCH] D148795: [ELF] Support --remap-inputs and --remap-inputs-file

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 20 16:57:46 PDT 2023


MaskRay added a comment.

In D148795#4283846 <https://reviews.llvm.org/D148795#4283846>, @peter.smith wrote:

> I don't have a strong opinion on this one. I prefer the more general approachof this patch than the previous patch of filtering out files.



> One thing we may want to be careful of is the use of wildcards. IIUC the only valid use is in the pattern and not the replacement, so we end up with many to one mappings. I can see these being OK for /dev/null and libraries but many to one for an object file would likely cause multiply defined symbol errors. Not entirely sure what we can do about that given we're looking at names.

Yes, and the performance is important. I have fixed some performance issue by checking whether wildcard is used 49279ca160183c1567e2637f88f3e92eb458c3e7 <https://reviews.llvm.org/rG49279ca160183c1567e2637f88f3e92eb458c3e7>.

I think patterns without a wildcard need to optimized when we add `--thinlto-index=` and can use an unordered map. Patterns with a wildcard can use a `SmallVector<xxx, 0>`.

I am inclined that we add just one option, not two. shell process substitution may be handy, e.g. `--remap-inputs-file=<(printf 'NO-MATCH\t/dev/null')`

See D148859 <https://reviews.llvm.org/D148859> :)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D148795



More information about the llvm-commits mailing list