[PATCH] D58482: [WebAssembly] Remove redundant code added in rL354538. NFC.
Sam Clegg via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Feb 20 17:20:29 PST 2019
sbc100 created this revision.
Herald added subscribers: llvm-commits, sunfish, aheejin, jgravelle-google, dschuff.
Herald added a project: LLVM.
The code for encoding the symbols signature into its name
was not actually being used in the final version of this change.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D58482
Files:
lld/wasm/SymbolTable.cpp
Index: lld/wasm/SymbolTable.cpp
===================================================================
--- lld/wasm/SymbolTable.cpp
+++ lld/wasm/SymbolTable.cpp
@@ -26,38 +26,6 @@
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::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 @@
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D58482.187699.patch
Type: text/x-patch
Size: 2099 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190221/2d1932ad/attachment.bin>
More information about the llvm-commits
mailing list