[PATCH] D66848: [lld-link] implement -start-lib and -end-lib

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 28 01:50:31 PDT 2019


MaskRay added inline comments.


================
Comment at: lld/COFF/InputFiles.cpp:831
+                         std::vector<Symbol *> &&symbols)
+    : InputFile(BitcodeKind, mb), symbols(symbols) {
   std::string path = mb.getBufferIdentifier().str();
----------------
`symbols(std::move(symbols))` to avoid a copy.


================
Comment at: lld/COFF/SymbolTable.cpp:620
 
-  if (Lazy *l = dyn_cast<Lazy>(sym)) {
+  if (LazyArchive *l = dyn_cast<LazyArchive>(sym)) {
     MemoryBufferRef mb = l->getMemberBuffer();
----------------
`auto *` can be used here because the type is obvious from the right hand side. (in lld's code base this idiom is used a lot)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D66848





More information about the llvm-commits mailing list