[PATCH] D31011: recommend using llvm-ar when finding undefined references and empty archives

Davide Italiano via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 16 15:46:15 PDT 2017


davide added inline comments.


================
Comment at: ELF/InputFiles.cpp:559-565
+  bool NoSymbols = true;
+  for (const Archive::Symbol &Sym : File->symbols()) {
     Symtab<ELFT>::X->addLazyArchive(this, Sym);
+    NoSymbols = false;
+  }
+
+  if (NoSymbols) Config->ArchiveWithoutSymbolsSeen = true;
----------------
Why do you need two different flags?


================
Comment at: ELF/InputFiles.cpp:565
+
+  if (NoSymbols) Config->ArchiveWithoutSymbolsSeen = true;
 }
----------------
ruiu wrote:
> Format.
> 
> Let's eliminate the local varaible. You could replace `NoSymbols` with `File->symbols().empty()`. `File->symbols()` is cheap so you don't need to save time here.
should live on two different lines, no? (in general, clang-format).


================
Comment at: ELF/Relocations.cpp:621
+              " This can happen when creating archives with a version"
+              " of ar that does not understand the object files in"
+              " the archive. For example, if you are using LLVM"
----------------
I'd say "the bitcode files".


https://reviews.llvm.org/D31011





More information about the llvm-commits mailing list