[WebAssembly] Always emit functype directives for defined functions
authorAlex Bradbury <asb@igalia.com>
Tue, 22 Mar 2022 09:11:46 +0000 (09:11 +0000)
committerAlex Bradbury <asb@igalia.com>
Tue, 22 Mar 2022 09:24:58 +0000 (09:24 +0000)
commit86cc731f4c50370b2ea715adcf1d07dd3db49207
treef707a11ad3740cfb1dcfb0cd2a2018ba6486dc4d
parentf42b1954a0e85fadd421d5e345cb8343c410b34d
[WebAssembly] Always emit functype directives for defined functions

This fixes bug <https://github.com/llvm/llvm-project/issues/54022>. For
now this means that defined functions will have two .functype directives
emitted. Given discussion in that bug has suggested interest in moving
towards using something other than .functype to mark the beginning of a
function (which would, as a side-effect, solve this issue), this patch
doesn't attempt to avoid that duplication.

Some test cases that used CHECK-LABEL: foo rather than CHECK-LABEL: foo:
are broken by this change. This patch updates those test cases to always
have a colon at the end of the CHECK-LABEL string.

Differential Revision: https://reviews.llvm.org/D122134
llvm/lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp
llvm/lib/Target/WebAssembly/WebAssemblyAsmPrinter.h
llvm/test/CodeGen/WebAssembly/byval.ll
llvm/test/CodeGen/WebAssembly/cfg-stackify-eh.ll
llvm/test/CodeGen/WebAssembly/function-pointer64.ll
llvm/test/CodeGen/WebAssembly/functype-emission.ll
llvm/test/CodeGen/WebAssembly/inlineasm-output-template.ll
llvm/test/CodeGen/WebAssembly/multi-return.ll
llvm/test/CodeGen/WebAssembly/stack-protector.ll
llvm/test/MC/WebAssembly/stack-ptr-mclower.ll