[PATCH] D12874: [LLD/ELF2] Initial support for local symbols in symtab

Rafael Ávila de Espíndola via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 16 13:14:16 PDT 2015


rafael accepted this revision.
rafael added a comment.
This revision is now accepted and ready to land.

LGTM with a nit.


================
Comment at: ELF/InputFiles.cpp:67
@@ +66,3 @@
+    error("Invalid sh_info in symbol table");
+  if (!Local)
+    return llvm::make_range(Syms.begin() + FirstNonLocal, Syms.end());
----------------
We normally put {} in both the if and the else or in neither.


================
Comment at: ELF/InputFiles.cpp:72
@@ +71,3 @@
+    // No local symbols.
+    if (FirstNonLocal == 1)
+      return Elf_Sym_Range(nullptr, nullptr);
----------------
You don't need this special case. The line bellow becomes

 return llvm::make_range(Syms.begin() + 1, Syms.begin() + 1);

Which is a valid empty range.

With that you can also drop the {


http://reviews.llvm.org/D12874





More information about the llvm-commits mailing list