[PATCH] D92918: [llvm-link][NFC] Minor cleanup

Sergey Dmitriev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 9 17:51:57 PST 2020


sdmitriev added a comment.

Well, when you use a class you have to know the interface it defines, so this is not about the implementation details, but about the interface provided by the class. `llvm::Linker::linkModules()`, as it is defined today, is a static member of the class, so it does not require an instance of `llvm::Linker` class to be called. Adding an additional parameter to `loadArFile` just in case does not buy as anything at all except unneeded redundancy. And, by the way, this function is called as a static member (i.e. `Linker::linkModules()`) everywhere in LLVM sources except `llvm-link.cpp`:

  llvm/lib/Linker/LinkModules.cpp, line 605
  llvm/tools/bugpoint/BugDriver.cpp, line 149
  llvm/tools/bugpoint/Miscompilation.cpp, lines 233, 396, ...
  llvm/unittests/Linker/LinkModulesTest.cpp, lines 101, 175, 182, ...


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D92918



More information about the llvm-commits mailing list