[WebAssembly] Support imports from custom module names

Fixes: https://bugs.llvm.org/show_bug.cgi?id=37168

This is only a first pass at supporting these custom import
modules.  In the long run we most likely want to treat these
kinds of symbols very differently.  For example, it should not
be possible to resolve such as symbol at static link type.

Differential Revision: https://reviews.llvm.org/D45796

llvm-svn: 352828
diff --git a/lld/wasm/SymbolTable.cpp b/lld/wasm/SymbolTable.cpp
index f490d4c..e45dc6b 100644
--- a/lld/wasm/SymbolTable.cpp
+++ b/lld/wasm/SymbolTable.cpp
@@ -315,8 +315,8 @@
   return S;
 }
 
-Symbol *SymbolTable::addUndefinedFunction(StringRef Name, uint32_t Flags,
-                                          InputFile *File,
+Symbol *SymbolTable::addUndefinedFunction(StringRef Name, StringRef Module,
+                                          uint32_t Flags, InputFile *File,
                                           const WasmSignature *Sig) {
   LLVM_DEBUG(dbgs() << "addUndefinedFunction: " << Name <<
              " [" << (Sig ? toString(*Sig) : "none") << "]\n");
@@ -326,7 +326,7 @@
   std::tie(S, WasInserted) = insert(Name, File);
 
   if (WasInserted)
-    replaceSymbol<UndefinedFunction>(S, Name, Flags, File, Sig);
+    replaceSymbol<UndefinedFunction>(S, Name, Module, Flags, File, Sig);
   else if (auto *Lazy = dyn_cast<LazySymbol>(S))
     Lazy->fetch();
   else