[lld] r323024 - [WebAssembly] Remove redundant function: addSyntheticUndefinedFunction. NFC.
Sam Clegg via llvm-commits
llvm-commits at lists.llvm.org
Fri Jan 19 17:40:18 PST 2018
Author: sbc
Date: Fri Jan 19 17:40:17 2018
New Revision: 323024
URL: http://llvm.org/viewvc/llvm-project?rev=323024&view=rev
Log:
[WebAssembly] Remove redundant function: addSyntheticUndefinedFunction. NFC.
Differential Revision: https://reviews.llvm.org/D42327
Modified:
lld/trunk/wasm/Driver.cpp
lld/trunk/wasm/SymbolTable.cpp
Modified: lld/trunk/wasm/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/wasm/Driver.cpp?rev=323024&r1=323023&r2=323024&view=diff
==============================================================================
--- lld/trunk/wasm/Driver.cpp (original)
+++ lld/trunk/wasm/Driver.cpp Fri Jan 19 17:40:17 2018
@@ -134,14 +134,6 @@ static Optional<std::string> findFile(St
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 @@ void LinkerDriver::link(ArrayRef<const c
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:
Modified: lld/trunk/wasm/SymbolTable.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/wasm/SymbolTable.cpp?rev=323024&r1=323023&r2=323024&view=diff
==============================================================================
--- lld/trunk/wasm/SymbolTable.cpp (original)
+++ lld/trunk/wasm/SymbolTable.cpp Fri Jan 19 17:40:17 2018
@@ -187,6 +187,7 @@ Symbol *SymbolTable::addDefined(StringRe
Symbol *SymbolTable::addUndefinedFunction(StringRef Name,
const WasmSignature *Type) {
+ DEBUG(dbgs() << "addUndefinedFunction: " << Name << "\n");
Symbol *S;
bool WasInserted;
std::tie(S, WasInserted) = insert(Name);
More information about the llvm-commits
mailing list