[WebAssembly] Correctly handle va_arg of zero-sized structures
authorGuanzhong Chen <gzchen@google.com>
Thu, 15 Aug 2019 19:33:36 +0000 (19:33 +0000)
committerGuanzhong Chen <gzchen@google.com>
Thu, 15 Aug 2019 19:33:36 +0000 (19:33 +0000)
commit82bfd1d25712f8c1b714614f3df559c773f08988
tree59a24f8d01e797433cbc2225343ef792cc9ba3a5
parent0c476111317cb7aaa9a3e9f75e1c35f83122ee26
[WebAssembly] Correctly handle va_arg of zero-sized structures

Summary:
D66168 passes size 0 structs indirectly, while the wasm backend expects it to
be passed directly. This causes subsequent variadic arguments to be read
incorrectly.

This diff changes it so that size 0 structs are passed directly.

Reviewers: dschuff, tlively, sbc100

Reviewed By: dschuff

Subscribers: jgravelle-google, aheejin, sunfish, cfe-commits

Tags: #clang

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

llvm-svn: 369042
clang/lib/CodeGen/TargetInfo.cpp
clang/test/CodeGen/wasm-varargs.c