[PATCH] D52104: lld-link: print demangled symbol names for "undefined symbol" diagnostics

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 14 10:50:23 PDT 2018


ruiu added inline comments.


================
Comment at: libcxxabi/src/demangle/Utility.h:173
 
+inline bool initializeOutputStream(char *Buf, size_t *N, OutputStream &S,
+                                   size_t InitSize) {
----------------
Looks like there are two patterns how to use this function -- one way is to pass `nullptr, nullptr` as first two arguments, and the other is to pass an actual buffer. Can you separate that as two functions?

It looks like the latter use case is used only once, so you might be able to inline it.


================
Comment at: lld/COFF/SymbolTable.cpp:69
 
 // Returns the name of the symbol in SC whose value is <= Addr that is closest
 // to Addr. This is generally the name of the global variable or function whose
----------------
Update comment.


================
Comment at: lld/COFF/SymbolTable.cpp:84-86
   if (!Candidate)
-    return "";
-  return Candidate->getName();
+    return nullptr;
+  return Candidate;
----------------
You can just return Candidate.


https://reviews.llvm.org/D52104





More information about the llvm-commits mailing list