[all-commits] [llvm/llvm-project] e9b5b8: [NFC][llvm-libtool-darwin] Encapsulate the process...

Shoaib Meenai via All-commits all-commits at lists.llvm.org
Tue Jan 11 14:50:20 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: e9b5b815565b848d07fb7bfa302394af197f7f51
      https://github.com/llvm/llvm-project/commit/e9b5b815565b848d07fb7bfa302394af197f7f51
  Author: Roger Kim <rgr at fb.com>
  Date:   2022-01-11 (Tue, 11 Jan 2022)

  Changed paths:
    M llvm/tools/llvm-libtool-darwin/llvm-libtool-darwin.cpp

  Log Message:
  -----------
  [NFC][llvm-libtool-darwin] Encapsulate the process of adding a new member in a class

Here we are refactoring the code to encapsulate data into classes. This allows
us to avoid passing the same objects through many functions that don't directly
use them. Now, functions that need to access data can do so from the class
state.

Reviewed By: jhenderson, smeenai

Differential Revision: https://reviews.llvm.org/D113127


  Commit: 4993eff3e253a1c04e1a1a2fa5d68f6b33423419
      https://github.com/llvm/llvm-project/commit/4993eff3e253a1c04e1a1a2fa5d68f6b33423419
  Author: Roger Kim <rgr at fb.com>
  Date:   2022-01-11 (Tue, 11 Jan 2022)

  Changed paths:
    M llvm/test/tools/llvm-libtool-darwin/L-and-l.test
    M llvm/test/tools/llvm-libtool-darwin/archive-flattening.test
    M llvm/test/tools/llvm-libtool-darwin/create-static-lib.test
    M llvm/tools/llvm-libtool-darwin/llvm-libtool-darwin.cpp

  Log Message:
  -----------
  [llvm-libtool-darwin] Print a warning if object file names are repeated

Print a warning if `llvm-libtool-darwin` if any of the object
files provided by the user have the same file name.

The tool will now print a warning if there is a name collision across:

* Two object files
* An object file and an object file from within a static library
* Two object files from different static libraries

Here is an example of the error:

```
$ llvm-libtool-darwin -static -o archive.a out.o out.o
error: file 'out.o' was specified multiple times.
in: out.o
in: out.o

$ llvm-libtool-darwin -static -o archive.a out.o
$ llvm-libtool-darwin -static -o combined.a archive.a out.o
error: file 'out.o' was specified multiple times.
in: archive.a
in: out.o
```

This change mimics apple's cctools libtool's behavior which always shows a warning in such cases.

Reviewed By: smeenai

Differential Revision: https://reviews.llvm.org/D113130


Compare: https://github.com/llvm/llvm-project/compare/7ea175d1c6fa...4993eff3e253


More information about the All-commits mailing list