summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSam Clegg <sbc@chromium.org>2017-12-06 03:10:39 +0000
committerSam Clegg <sbc@chromium.org>2017-12-06 03:10:39 +0000
commita681a1167eef42e4bbad9cb8226958e61c9923ee (patch)
treefced3dd31469a0cbb625aa2df501bf137a21adb1
parent371e9e8a28517f4da559fed3d44877a5a1b3e785 (diff)
downloadbcm5719-llvm-a681a1167eef42e4bbad9cb8226958e61c9923ee.tar.gz
bcm5719-llvm-a681a1167eef42e4bbad9cb8226958e61c9923ee.zip
[WebAssembly] Remove wasm/Strings.cpp+h
This file contained only a single function that was only really needed in one place, so just inline it. Differential Revision: https://reviews.llvm.org/D40870 llvm-svn: 319876
-rw-r--r--lld/wasm/CMakeLists.txt1
-rw-r--r--lld/wasm/InputFiles.cpp3
-rw-r--r--lld/wasm/Strings.cpp22
-rw-r--r--lld/wasm/Strings.h25
-rw-r--r--lld/wasm/SymbolTable.cpp5
-rw-r--r--lld/wasm/Symbols.cpp7
6 files changed, 8 insertions, 55 deletions
diff --git a/lld/wasm/CMakeLists.txt b/lld/wasm/CMakeLists.txt
index 3e408e80da5..f34e0c4bf95 100644
--- a/lld/wasm/CMakeLists.txt
+++ b/lld/wasm/CMakeLists.txt
@@ -7,7 +7,6 @@ add_lld_library(lldWasm
InputFiles.cpp
InputSegment.cpp
OutputSections.cpp
- Strings.cpp
SymbolTable.cpp
Symbols.cpp
Writer.cpp
diff --git a/lld/wasm/InputFiles.cpp b/lld/wasm/InputFiles.cpp
index bb93620a931..c259bdb8d4f 100644
--- a/lld/wasm/InputFiles.cpp
+++ b/lld/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 @@ void ArchiveFile::addMember(const Archive::Symbol *Sym) {
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 =
diff --git a/lld/wasm/Strings.cpp b/lld/wasm/Strings.cpp
deleted file mode 100644
index dfc3254f73b..00000000000
--- a/lld/wasm/Strings.cpp
+++ /dev/null
@@ -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<std::string> S = demangleItanium(Name))
- return "`" + *S + "'";
- return Name;
-}
diff --git a/lld/wasm/Strings.h b/lld/wasm/Strings.h
deleted file mode 100644
index 5362827321e..00000000000
--- a/lld/wasm/Strings.h
+++ /dev/null
@@ -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 <string>
-
-namespace lld {
-namespace wasm {
-
-std::string displayName(llvm::StringRef Name);
-
-} // namespace wasm
-} // namespace lld
-
-#endif
diff --git a/lld/wasm/SymbolTable.cpp b/lld/wasm/SymbolTable.cpp
index f81afe23faf..c6cbc4c1474 100644
--- a/lld/wasm/SymbolTable.cpp
+++ b/lld/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::addUndefinedFunction(StringRef Name,
}
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 @@ Symbol *SymbolTable::addUndefined(InputFile *F, const WasmSymbol *Sym) {
}
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;
diff --git a/lld/wasm/Symbols.cpp b/lld/wasm/Symbols.cpp
index 9fed8a08ac7..2be2ef91d2d 100644
--- a/lld/wasm/Symbols.cpp
+++ b/lld/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::isWeak() const { return Sym && Sym->isWeak(); }
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<std::string> S = demangleItanium(Sym.getName()))
+ return "`" + *S + "'";
+ return Sym.getName();
}
std::string lld::toString(wasm::Symbol::Kind Kind) {
OpenPOWER on IntegriCloud