OSDN Git Service

[WebAssembly] Ignore explicit section names for functions
authorSam Clegg <sbc@chromium.org>
Thu, 14 Jun 2018 18:48:19 +0000 (18:48 +0000)
committerSam Clegg <sbc@chromium.org>
Thu, 14 Jun 2018 18:48:19 +0000 (18:48 +0000)
commit10cde000da8b281e8ab253397ad698bc5c555219
tree2160627e1d60544a2b7a27758f285a9c5cf6fb91
parenta1b4efd4bd8b68cd6bf5df5424c7fc802a3eb34f
[WebAssembly] Ignore explicit section names for functions

WebAssembly doesn't support more than one function per section
and we rely on function sections being unique. This change ignores
the section provided by the function to avoid two functions being
in the same section.

Without this change the object writer produces the following
error for this test:
 LLVM ERROR: section already has a defining function: baz

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@334752 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/TargetLoweringObjectFileImpl.cpp
test/MC/WebAssembly/function-sections.ll [new file with mode: 0644]