| author | |
| committer | |
| log | 5af7ae1dc45a4adafe72a91c1f849d599a6ff3eb |
| tree | edd4dcc8e5cf39fb9d9c85096c9f21b559751172 |
| parent | 6d6cf598475ab8d2c3259002655ba04f1d056b2e |
2 files changed, 14 insertions(+), 8 deletions(-)
src/Air.zig+4-4| ... | ... | @@ -264,10 +264,10 @@ pub const Inst = struct { |
| 264 | 264 | /// Uses the `un_op` field. |
| 265 | 265 | /// Triggers `resolveTypeLayout` on the return type. |
| 266 | 266 | ret, |
| 267 | /// This instruction communicates that the function's result value is inside | |
| 268 | /// the operand, which is a pointer. If the function will pass the result by-ref, | |
| 269 | /// the pointer operand is a `ret_ptr` instruction. Otherwise, this instruction | |
| 270 | /// is equivalent to a `load` on the operand, followed by a `ret` on the loaded value. | |
| 267 | /// This instruction communicates that the function's result value is pointed to by | |
| 268 | /// the operand. If the function will pass the result by-ref, the operand is a | |
| 269 | /// `ret_ptr` instruction. Otherwise, this instruction is equivalent to a `load` | |
| 270 | /// on the operand, followed by a `ret` on the loaded value. | |
| 271 | 271 | /// Result type is always noreturn; no instructions in a block follow this one. |
| 272 | 272 | /// Uses the `un_op` field. |
| 273 | 273 | /// Triggers `resolveTypeLayout` on the return type. |
src/codegen/llvm.zig+10-4| ... | ... | @@ -1490,11 +1490,17 @@ pub const FuncGen = struct { |
| 1490 | 1490 | break :blk ret_ptr; |
| 1491 | 1491 | }; |
| 1492 | 1492 | |
| 1493 | for (args) |arg, i| { | |
| 1494 | const param_ty = fn_info.param_types[i]; | |
| 1495 | if (!param_ty.hasCodeGenBits()) continue; | |
| 1493 | if (fn_info.is_var_args) { | |
| 1494 | for (args) |arg| { | |
| 1495 | try llvm_args.append(try self.resolveInst(arg)); | |
| 1496 | } | |
| 1497 | } else { | |
| 1498 | for (args) |arg, i| { | |
| 1499 | const param_ty = fn_info.param_types[i]; | |
| 1500 | if (!param_ty.hasCodeGenBits()) continue; | |
| 1496 | 1501 | |
| 1497 | try llvm_args.append(try self.resolveInst(arg)); | |
| 1502 | try llvm_args.append(try self.resolveInst(arg)); | |
| 1503 | } | |
| 1498 | 1504 | } |
| 1499 | 1505 | |
| 1500 | 1506 | const call = self.builder.buildCall( |