diff options
| -rw-r--r-- | lld/ELF/SymbolTable.cpp | 16 | ||||
| -rw-r--r-- | lld/ELF/SymbolTable.h | 1 |
2 files changed, 7 insertions, 10 deletions
diff --git a/lld/ELF/SymbolTable.cpp b/lld/ELF/SymbolTable.cpp index 60a212b4182..a017df35024 100644 --- a/lld/ELF/SymbolTable.cpp +++ b/lld/ELF/SymbolTable.cpp @@ -227,6 +227,13 @@ std::pair<Symbol *, bool> SymbolTable<ELFT>::insert(StringRef &Name) { return {Sym, IsNew}; } +// Construct a string in the form of "Sym in File1 and File2". +// Used to construct an error message. +static std::string conflictMsg(SymbolBody *Existing, InputFile *NewFile) { + return maybeDemangle(Existing->getName()) + " in " + + getFilename(Existing->File) + " and " + getFilename(NewFile); +} + // Find an existing symbol or create and insert a new one, then apply the given // attributes. template <class ELFT> @@ -251,15 +258,6 @@ SymbolTable<ELFT>::insert(StringRef &Name, uint8_t Type, uint8_t Visibility, return {S, WasInserted}; } -// Construct a string in the form of "Sym in File1 and File2". -// Used to construct an error message. -template <typename ELFT> -std::string SymbolTable<ELFT>::conflictMsg(SymbolBody *Existing, - InputFile *NewFile) { - return maybeDemangle(Existing->getName()) + " in " + - getFilename(Existing->File) + " and " + getFilename(NewFile); -} - template <class ELFT> Symbol *SymbolTable<ELFT>::addUndefined(StringRef Name) { return addUndefined(Name, STB_GLOBAL, STV_DEFAULT, /*Type*/ 0, /*CanOmitFromDynSym*/ false, /*File*/ nullptr); diff --git a/lld/ELF/SymbolTable.h b/lld/ELF/SymbolTable.h index 797355ffc8e..f95ff12377a 100644 --- a/lld/ELF/SymbolTable.h +++ b/lld/ELF/SymbolTable.h @@ -97,7 +97,6 @@ private: uint8_t Visibility, bool CanOmitFromDynSym, InputFile *File); - std::string conflictMsg(SymbolBody *Existing, InputFile *NewFile); void reportDuplicate(SymbolBody *Existing, InputFile *NewFile); std::map<std::string, std::vector<SymbolBody *>> getDemangledSyms(); |

