[PATCH] D16610: [WebAssembly] Implement byval arguments

Dan Gohman via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 27 12:45:10 PST 2016

sunfish accepted this revision.
This revision is now accepted and ready to land.

Comment at: lib/Target/WebAssembly/WebAssemblyISelLowering.cpp:354
@@ -353,3 +353,1 @@
-  SmallVectorImpl<SDValue> &OutVals = CLI.OutVals;
dschuff wrote:
> This CL makes a new vector with copies of all the non-byval OutVals. Is that necessary, or can I overwrite CLI.OutVals?
I think you can safely overwrite CLI.OutVals if you want to.

Comment at: lib/Target/WebAssembly/WebAssemblyISelLowering.cpp:359
@@ -360,4 +358,3 @@
   SmallVectorImpl<ISD::OutputArg> &Outs = CLI.Outs;
-  for (const ISD::OutputArg &Out : Outs) {
-    if (Out.Flags.isByVal())
-      fail(DL, DAG, "WebAssembly hasn't implemented byval arguments");
+  SmallVector<SDValue, 8> OutVals;
+  for (unsigned i = 0; i < Outs.size(); ++i) {
Although if you don't choose to overwrite CLI.OutVals, please rename this OutVals to something like AdjustedOutVals, so that people who aren't reading the code closely don't assume it's a reference to CLI.OutVals (I did this as I was reading this patch at first and was confused :-)).


More information about the llvm-commits mailing list