[PATCH] D68975: [LLD] [COFF] Try to report source locations for duplicate symbols

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 15 03:59:59 PDT 2019


ruiu added a reviewer: thakis.
ruiu added a comment.

This patch looks good to me, but I'd like to get a second opinion from other devs because this could be a big change in UX. Nico, you recently worked on error messages. What do you think of this change?



================
Comment at: lld/COFF/SymbolTable.cpp:523
 
-void SymbolTable::reportDuplicate(Symbol *existing, InputFile *newFile) {
-  std::string msg = "duplicate symbol: " + toString(*existing) + " in " +
-                    toString(existing->getFile()) + " and in " +
-                    toString(newFile);
+static std::string getSourceLocation(BitcodeFile *file) {
+  std::string res("\n>>> defined at ");
----------------
I wouldn't use function overloading if it can be avoided easily. I'd name this getSourceLocationBitcode and the other getSourceLocationObj.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D68975/new/

https://reviews.llvm.org/D68975





More information about the llvm-commits mailing list