[lld] r354539 - [WebAssembly] Remove redundant code added in rL354538. NFC.
Sam Clegg via llvm-commits
llvm-commits at lists.llvm.org
Wed Feb 20 17:33:26 PST 2019
Author: sbc
Date: Wed Feb 20 17:33:26 2019
New Revision: 354539
URL: http://llvm.org/viewvc/llvm-project?rev=354539&view=rev
Log:
[WebAssembly] Remove redundant code added in rL354538. NFC.
The code for encoding the symbols signature into its name
was not actually being used in the final version of this change.
Differential Revision: https://reviews.llvm.org/D58482
Modified:
lld/trunk/wasm/SymbolTable.cpp
Modified: lld/trunk/wasm/SymbolTable.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/wasm/SymbolTable.cpp?rev=354539&r1=354538&r2=354539&view=diff
==============================================================================
--- lld/trunk/wasm/SymbolTable.cpp (original)
+++ lld/trunk/wasm/SymbolTable.cpp Wed Feb 20 17:33:26 2019
@@ -26,38 +26,6 @@ using namespace lld::wasm;
SymbolTable *lld::wasm::Symtab;
-static char encodeValType(ValType Type) {
- switch (Type) {
- case ValType::I32:
- return 'i';
- case ValType::I64:
- return 'j';
- case ValType::F32:
- return 'f';
- case ValType::F64:
- return 'd';
- case ValType::V128:
- return 'V';
- case ValType::EXCEPT_REF:
- return 'e';
- }
- llvm_unreachable("invalid wasm type");
-}
-
-static std::string encodeSignature(const WasmSignature &Sig) {
- std::string S = ":";
- for (ValType Type : Sig.Returns)
- S += encodeValType(Type);
- S += ':';
- for (ValType Type : Sig.Params)
- S += encodeValType(Type);
- return S;
-}
-
-static StringRef getVariantName(StringRef BaseName, const WasmSignature &Sig) {
- return Saver.save(BaseName + encodeSignature(Sig));
-}
-
void SymbolTable::addFile(InputFile *File) {
log("Processing: " + toString(File));
if (Config->Trace)
@@ -514,7 +482,6 @@ bool SymbolTable::addComdat(StringRef Na
bool SymbolTable::getFunctionVariant(Symbol* Sym, const WasmSignature *Sig,
const InputFile *File, Symbol **Out) {
LLVM_DEBUG(dbgs() << "getFunctionVariant: " << Sym->getName() << " -> "
- << getVariantName(Sym->getName(), *Sig)
<< " " << toString(*Sig) << "\n");
Symbol *Variant = nullptr;
@@ -626,11 +593,12 @@ void SymbolTable::handleSymbolVariants()
std::vector<Symbol *> &Variants = Pair.second;
#ifndef NDEBUG
- dbgs() << "symbol with (" << Variants.size()
- << ") variants: " << SymName << "\n";
+ LLVM_DEBUG(dbgs() << "symbol with (" << Variants.size()
+ << ") variants: " << SymName << "\n");
for (auto *S: Variants) {
auto *F = cast<FunctionSymbol>(S);
- dbgs() << " variant: " + F->getName() << " " << toString(*F->Signature) << "\n";
+ LLVM_DEBUG(dbgs() << " variant: " + F->getName() << " "
+ << toString(*F->Signature) << "\n");
}
#endif
More information about the llvm-commits
mailing list