[PATCH] D42327: [WebAssembly] Remove redundant function: addSyntheticUndefinedFunction. NFC.

Sam Clegg via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 19 17:41:13 PST 2018


sbc100 updated this revision to Diff 130733.
sbc100 added a comment.

- revert part of this change to keep it tiny


Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D42327

Files:
  wasm/Driver.cpp
  wasm/SymbolTable.cpp


Index: wasm/SymbolTable.cpp
===================================================================
--- wasm/SymbolTable.cpp
+++ wasm/SymbolTable.cpp
@@ -187,6 +187,7 @@
 
 Symbol *SymbolTable::addUndefinedFunction(StringRef Name,
                                           const WasmSignature *Type) {
+  DEBUG(dbgs() << "addUndefinedFunction: " << Name << "\n");
   Symbol *S;
   bool WasInserted;
   std::tie(S, WasInserted) = insert(Name);
Index: wasm/Driver.cpp
===================================================================
--- wasm/Driver.cpp
+++ wasm/Driver.cpp
@@ -134,14 +134,6 @@
   return None;
 }
 
-// Inject a new undefined symbol into the link.  This will cause the link to
-// fail unless this symbol can be found.
-static void addSyntheticUndefinedFunction(StringRef Name,
-                                          const WasmSignature *Type) {
-  log("injecting undefined func: " + Name);
-  Symtab->addUndefinedFunction(Name, Type);
-}
-
 static void printHelp(const char *Argv0) {
   WasmOptTable().PrintHelp(outs(), Argv0, "LLVM Linker", false);
 }
@@ -293,11 +285,11 @@
   if (!Config->Relocatable) {
     static WasmSignature Signature = {{}, WASM_TYPE_NORESULT};
     if (!Config->Entry.empty())
-      addSyntheticUndefinedFunction(Config->Entry, &Signature);
+      Symtab->addUndefinedFunction(Config->Entry, &Signature);
 
     // Handle the `--undefined <sym>` options.
     for (auto* Arg : Args.filtered(OPT_undefined))
-      addSyntheticUndefinedFunction(Arg->getValue(), nullptr);
+      Symtab->addUndefinedFunction(Arg->getValue(), nullptr);
 
     // Create linker-synthetic symbols
     // __wasm_call_ctors:


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D42327.130733.patch
Type: text/x-patch
Size: 1649 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180120/a0b2dddd/attachment.bin>


More information about the llvm-commits mailing list