[PATCH] D21550: [lld] support --trace-symbol (alias -y) option

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 22 19:42:49 PDT 2016


ruiu added a comment.

Thank you for making the changes. Almost looking good, a few nits.

Do you have a commit access?


================
Comment at: ELF/Driver.cpp:513
@@ -509,1 +512,3 @@
 
+  Symtab.traceDefined();
+
----------------
What this function does is similar to scan* functions, so move this after scanVersionScript.

================
Comment at: ELF/InputFiles.cpp:321
@@ +320,3 @@
+  if (!Config->TraceSymbol.empty() && Config->TraceSymbol.count(Name))
+    outs() << getFilename(this) << ": reference to " << Name.str() << "\n";
+}
----------------
outs() knows how to print out StringRefs, so remove `.str()`.

================
Comment at: ELF/SymbolTable.cpp:548
@@ +547,3 @@
+  for (const auto &symbol : Config->TraceSymbol) {
+    if (SymbolBody *L = find(symbol.getKey()))
+      if (L->isDefined() || L->isCommon())
----------------
Let's name `B` instead of `L` since it is a sort of convention in LLD.


http://reviews.llvm.org/D21550





More information about the llvm-commits mailing list