[PATCH] D88827: [llvm-objcopy][NFC] Move core implementation of llvm-objcopy into separate library.

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 13 20:21:39 PST 2022


MaskRay added a comment.

llvm-objcopy has its own data models for some binary format specific things, so placing it under the `llvm::object` namespace may lead to some conflicts. Placing it into a sub-namespace does not avoid the conflict.
If it keeps using the `llvm::objcopy` namespace, then placing it under `lib/Object` may cause some confusion. A separate directory looks good to me.

---

An archive is a quite different container format. So I get the point that there is a question about whether it fits into `lib/Object`.
On the other hand, an archive is sometimes an input file type and used nearly indistinguishable with other file typed in syntax (ld.lld, llvm-readelf, ...). Having it in `lib/Object` seems fine to me...

---

By placing some less associated code in the same library, there is a risk that dependencies tend to become mixed.
Layered component design has some advantages but in practice it is easy to run into a situation that for all of {a,b,c}.cpp to include all of {a,b,c}.h...
Different `lib/*` directories tend to force developers to think harder on the layering.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D88827



More information about the llvm-commits mailing list