[PATCH] D41975: [WebAssembly] Don't allow functions to be named more than once

Sam Clegg via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 12 06:47:40 PST 2018


sbc100 added a comment.

In https://reviews.llvm.org/D41975#974359, @ncw wrote:

> I've just rewritten the name handling in https://reviews.llvm.org/D41955. What I did there was to associate the name with the Function (not the Symbol) since that's conceptually what the "names" section is (the debugger's name for the function body itself).
>
> My solution was to simply iterate over DefinedFunctions when creating the "names" section in LLD. The names are attached to functions, either from their export name, or from their name specified in the names section. Writer::createNameSection is therefore shorter, and makes more sense: the "names" section is really all about iterating over the Functions, not the Symbols.
>
> Another case of two people tackling the same problem at once!


I think are you right.  One thing to note is that the names section can name imported functions, although its seems a lot less useful to do so.    Anyway, if its OK with you I'll land this small change now and your change can build on this.   This change also increases test coverage so you can be come confident when you refactor.


Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D41975





More information about the llvm-commits mailing list