Index: wasm/CMakeLists.txt =================================================================== --- wasm/CMakeLists.txt +++ wasm/CMakeLists.txt @@ -7,7 +7,6 @@ InputFiles.cpp InputSegment.cpp OutputSections.cpp - Strings.cpp SymbolTable.cpp Symbols.cpp Writer.cpp Index: wasm/InputFiles.cpp =================================================================== --- wasm/InputFiles.cpp +++ wasm/InputFiles.cpp @@ -11,7 +11,6 @@ #include "Config.h" #include "InputSegment.h" -#include "Strings.h" #include "SymbolTable.h" #include "lld/Common/ErrorHandler.h" #include "lld/Common/Memory.h" @@ -245,7 +244,7 @@ if (!Seen.insert(C.getChildOffset()).second) return; - DEBUG(dbgs() << "loading lazy: " << displayName(Sym->getName()) << "\n"); + DEBUG(dbgs() << "loading lazy: " << Sym->getName() << "\n"); DEBUG(dbgs() << "from archive: " << toString(this) << "\n"); MemoryBufferRef MB = Index: wasm/Strings.h =================================================================== --- wasm/Strings.h +++ wasm/Strings.h @@ -1,25 +0,0 @@ -//===- Strings.h ------------------------------------------------*- C++ -*-===// -// -// The LLVM Linker -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -#ifndef LLD_WASM_STRINGS_H -#define LLD_WASM_STRINGS_H - -#include "llvm/ADT/Optional.h" -#include "llvm/ADT/StringRef.h" -#include - -namespace lld { -namespace wasm { - -std::string displayName(llvm::StringRef Name); - -} // namespace wasm -} // namespace lld - -#endif Index: wasm/Strings.cpp =================================================================== --- wasm/Strings.cpp +++ wasm/Strings.cpp @@ -1,22 +0,0 @@ -//===- Strings.cpp -------------------------------------------------------===// -// -// The LLVM Linker -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -#include "Strings.h" -#include "Config.h" -#include "lld/Common/Strings.h" -#include "llvm/ADT/StringRef.h" - -using namespace llvm; - -std::string lld::wasm::displayName(StringRef Name) { - if (Config->Demangle) - if (Optional S = demangleItanium(Name)) - return "`" + *S + "'"; - return Name; -} Index: wasm/SymbolTable.cpp =================================================================== --- wasm/SymbolTable.cpp +++ wasm/SymbolTable.cpp @@ -10,7 +10,6 @@ #include "SymbolTable.h" #include "Config.h" -#include "Strings.h" #include "WriterUtils.h" #include "lld/Common/ErrorHandler.h" #include "lld/Common/Memory.h" @@ -201,7 +200,7 @@ } Symbol *SymbolTable::addUndefined(InputFile *F, const WasmSymbol *Sym) { - DEBUG(dbgs() << "addUndefined: " << displayName(Sym->Name) << "\n"); + DEBUG(dbgs() << "addUndefined: " << Sym->Name << "\n"); Symbol *S; bool WasInserted; Symbol::Kind Kind = Symbol::UndefinedFunctionKind; @@ -225,7 +224,7 @@ } void SymbolTable::addLazy(ArchiveFile *F, const Archive::Symbol *Sym) { - DEBUG(dbgs() << "addLazy: " << displayName(Sym->getName()) << "\n"); + DEBUG(dbgs() << "addLazy: " << Sym->getName() << "\n"); StringRef Name = Sym->getName(); Symbol *S; bool WasInserted; Index: wasm/Symbols.cpp =================================================================== --- wasm/Symbols.cpp +++ wasm/Symbols.cpp @@ -12,8 +12,8 @@ #include "Config.h" #include "InputFiles.h" #include "InputSegment.h" -#include "Strings.h" #include "lld/Common/ErrorHandler.h" +#include "lld/Common/Strings.h" #define DEBUG_TYPE "lld" @@ -84,7 +84,10 @@ bool Symbol::isHidden() const { return Sym && Sym->isHidden(); } std::string lld::toString(const wasm::Symbol &Sym) { - return wasm::displayName(Sym.getName()); + if (Config->Demangle) + if (Optional S = demangleItanium(Sym.getName())) + return "`" + *S + "'"; + return Sym.getName(); } std::string lld::toString(wasm::Symbol::Kind Kind) {