From 71cdbb7fe6c7548e545a1a0938eb2200e1fa339e Mon Sep 17 00:00:00 2001 From: Rui Ueyama Date: Tue, 9 Oct 2018 22:44:53 +0000 Subject: [PATCH] Merge two overloaded functions into one function. NFC. llvm-svn: 344089 --- lld/ELF/SymbolTable.cpp | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/lld/ELF/SymbolTable.cpp b/lld/ELF/SymbolTable.cpp index 642eb1a..61247e3 100644 --- a/lld/ELF/SymbolTable.cpp +++ b/lld/ELF/SymbolTable.cpp @@ -442,12 +442,6 @@ Symbol *SymbolTable::addCommon(StringRef N, uint64_t Size, uint32_t Alignment, return S; } -static void reportDuplicate(Symbol *Sym, InputFile *NewFile) { - if (!Config->AllowMultipleDefinition) - error("duplicate symbol: " + toString(*Sym) + "\n>>> defined in " + - toString(Sym->File) + "\n>>> defined in " + toString(NewFile)); -} - static void reportDuplicate(Symbol *Sym, InputFile *NewFile, InputSectionBase *ErrSec, uint64_t ErrOffset) { if (Config->AllowMultipleDefinition) @@ -455,7 +449,8 @@ static void reportDuplicate(Symbol *Sym, InputFile *NewFile, Defined *D = cast(Sym); if (!D->Section || !ErrSec) { - reportDuplicate(Sym, NewFile); + error("duplicate symbol: " + toString(*Sym) + "\n>>> defined in " + + toString(Sym->File) + "\n>>> defined in " + toString(NewFile)); return; } @@ -544,7 +539,7 @@ Symbol *SymbolTable::addBitcode(StringRef Name, uint8_t Binding, if (Cmp > 0) replaceSymbol(S, &F, Name, Binding, StOther, Type, 0, 0, nullptr); else if (Cmp == 0) - reportDuplicate(S, &F); + reportDuplicate(S, &F, nullptr, 0); return S; } -- 2.7.4