[PATCH] D47162: [WebAssembly] Initial support for LTO

Peter Collingbourne via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 21 17:09:05 PDT 2018


pcc added inline comments.


================
Comment at: wasm/Driver.cpp:281
+static Symbol *handleUndefined(StringRef Name) {
+  Symbol *S = Symtab->addUndefinedFunction(Name, 0, nullptr, nullptr);
+
----------------
Should we implement `-u` in the same way as in the ELF linker? With this implementation it doesn't look like it will work correctly for undefined data and globals.


================
Comment at: wasm/InputFiles.cpp:383
+  if (ObjSym.isExecutable())
+    return Symtab->addDefinedFunction(NameRef, 0, &F, nullptr);
+  return Symtab->addDefinedData(NameRef, 0, &F, nullptr, 0, 0);
----------------
I think you also want to copy the symbol's binding here and below.


================
Comment at: wasm/SymbolTable.cpp:200
 
+Symbol *SymbolTable::addBitcode(StringRef Name, InputFile *File) {
+  DEBUG(dbgs() << "addBitcode: " << Name << "\n");
----------------
This function seems to be unused.


Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D47162





More information about the llvm-commits mailing list