This is an archive of the discontinued LLVM Phabricator instance.

[WebAssembly] Fix function return type printing
ClosedPublic

Authored by dschuff on Nov 11 2015, 3:40 PM.

Details

Summary

Previously return type information for a function was derived from
return dag nodes. But this didn't work for dags with != return node. So
instead compute it directly from the LLVM function as is done for imports.

Diff Detail

Event Timeline

dschuff updated this revision to Diff 39984.Nov 11 2015, 3:40 PM
dschuff retitled this revision from to [WebAssembly] Fix function return type printing.
dschuff updated this object.
dschuff added a reviewer: sunfish.
dschuff added subscribers: jfb, llvm-commits.
sunfish accepted this revision.Nov 11 2015, 6:00 PM
sunfish edited edge metadata.

Looks good. This kind of begs the question of whether we should do this for the params too (and maybe further refactor the logic about multiple results after lowering), but I'm ok leaving that for later here.

lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp
202

LLVM style puts the reference by the var, rather than the type.

lib/Target/WebAssembly/WebAssemblyMachineFunctionInfo.h
42

You can delete the Results field itself too.

This revision is now accepted and ready to land.Nov 11 2015, 6:00 PM
dschuff updated this revision to Diff 40328.Nov 16 2015, 1:14 PM
dschuff marked 2 inline comments as done.
dschuff edited edge metadata.

Rebase, address comments

This revision was automatically updated to reflect the committed changes.