[PATCH] D44316: [WebAssembly] Demangle symbol names for use by the browser debugger

Sam Clegg via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 13 12:06:43 PDT 2018


sbc100 added inline comments.


================
Comment at: wasm/Driver.cpp:246
+        Saver.save("undefined function " +
+                   (SymName ? StringRef(*SymName) : Sym->getName()));
     SyntheticFunction *Func = make<SyntheticFunction>(Sig, StubName);
----------------
ncw wrote:
> sbc100 wrote:
> > Why this change?   
> To make it consistent - here we're demangling a symbol name and putting it in the "name" section, and in Writer.cpp we're also demangling a symbol name and putting it in a name section.
> 
> In Writer, you agreed we wanted to demangle, regardless of whether `Config->Demangle` was set... so here we should also be demangling regardless of whether the config option is set.
> 
> I've added this condition to the test, to make it clearer that it's part of the same change, and is tested in the same place.
It looks like what you are doing here is creating a new function, with a given name.  Function name should be mangled shouldn't they?  They only get demangled when you make the name section.  Don't you want the stub function to have the same name as the symbol?  I'm still confused why you demangle here.


Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D44316





More information about the llvm-commits mailing list