[PATCH] D13286: [ELF2] Add --[no-]whole-archive command line switches

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 30 10:39:48 PDT 2015


ruiu added inline comments.

================
Comment at: ELF/InputFiles.cpp:223-224
@@ +222,4 @@
+std::vector<MemoryBufferRef> ArchiveFile::getMembers() {
+  assert(nullptr != File && "File isn't opened, call parse() first");
+
+  std::vector<MemoryBufferRef> Result;
----------------
We don't have this assertion at other places in this file, so we shouldn't have this one as well. Also, nullptr != something looks inconsistent.

================
Comment at: ELF/SymbolTable.cpp:31
@@ -30,3 +30,3 @@
 void SymbolTable::addFile(std::unique_ptr<InputFile> File) {
   File->parse();
   InputFile *FileP = File.release();
----------------
You want to avoid calling parse() on an archive file if Config->WholeArchive to keep the existing behavior of parse().


http://reviews.llvm.org/D13286





More information about the llvm-commits mailing list