summaryrefslogtreecommitdiff
path: root/lld/COFF/Symbols.cpp
diff options
context:
space:
mode:
authorRui Ueyama <ruiu@google.com>2015-06-25 23:22:00 +0000
committerRui Ueyama <ruiu@google.com>2015-06-25 23:22:00 +0000
commit68633f1719a55a8d366f22c35233d145dc3658b0 (patch)
treeb2f6173e481bd98bab42e4623742e0dfae953fea /lld/COFF/Symbols.cpp
parent1026b656227e3bd9226a5275712792a00ceebb65 (diff)
downloadllvm-68633f1719a55a8d366f22c35233d145dc3658b0.tar.gz
COFF: Better error message for duplicate symbols.
Now the symbol table prints out not only symbol names but also file names for duplicate symbols. llvm-svn: 240719
Diffstat (limited to 'lld/COFF/Symbols.cpp')
-rw-r--r--lld/COFF/Symbols.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/lld/COFF/Symbols.cpp b/lld/COFF/Symbols.cpp
index cbdc418b0101..6bc9e4ada03a 100644
--- a/lld/COFF/Symbols.cpp
+++ b/lld/COFF/Symbols.cpp
@@ -111,16 +111,24 @@ StringRef DefinedRegular::getName() {
// StringRefs for them (which involves lots of strlen() on the string table)
// is a waste of time.
if (Name.empty())
- COFFFile->getSymbolName(Sym, Name);
+ File->getCOFFObj()->getSymbolName(Sym, Name);
return Name;
}
StringRef DefinedCommon::getName() {
if (Name.empty())
- COFFFile->getSymbolName(Sym, Name);
+ File->getCOFFObj()->getSymbolName(Sym, Name);
return Name;
}
+std::string DefinedRegular::getDebugName() {
+ return (getName() + " " + File->getShortName()).str();
+}
+
+std::string DefinedCommon::getDebugName() {
+ return (getName() + " " + File->getShortName()).str();
+}
+
ErrorOr<std::unique_ptr<InputFile>> Lazy::getMember() {
auto MBRefOrErr = File->getMember(&Sym);
if (auto EC = MBRefOrErr.getError())