| ... | ... | @@ -20328,8 +20328,13 @@ fn resolveExportOptions( |
| 20328 | 20328 | const linkage_val = try sema.resolveConstValue(block, linkage_src, linkage_operand, "linkage of exported value must be comptime-known"); |
| 20329 | 20329 | const linkage = linkage_val.toEnum(std.builtin.GlobalLinkage); |
| 20330 | 20330 | |
| 20331 | | const section = try sema.fieldVal(block, src, options, "section", section_src); |
| 20332 | | const section_val = try sema.resolveConstValue(block, section_src, section, "linksection of exported value must be comptime-known"); |
| 20331 | const section_operand = try sema.fieldVal(block, src, options, "section", section_src); |
| 20332 | const section_opt_val = try sema.resolveConstValue(block, section_src, section_operand, "linksection of exported value must be comptime-known"); |
| 20333 | const section_ty = Type.initTag(.const_slice_u8); |
| 20334 | const section = if (section_opt_val.optionalValue()) |section_val| |
| 20335 | try section_val.toAllocatedBytes(section_ty, sema.arena, sema.mod) |
| 20336 | else |
| 20337 | null; |
| 20333 | 20338 | |
| 20334 | 20339 | const visibility_operand = try sema.fieldVal(block, src, options, "visibility", visibility_src); |
| 20335 | 20340 | const visibility_val = try sema.resolveConstValue(block, visibility_src, visibility_operand, "visibility of exported value must be comptime-known"); |
| ... | ... | @@ -20345,14 +20350,10 @@ fn resolveExportOptions( |
| 20345 | 20350 | }); |
| 20346 | 20351 | } |
| 20347 | 20352 | |
| 20348 | | if (!section_val.isNull()) { |
| 20349 | | return sema.fail(block, section_src, "TODO: implement exporting with linksection", .{}); |
| 20350 | | } |
| 20351 | | |
| 20352 | 20353 | return std.builtin.ExportOptions{ |
| 20353 | 20354 | .name = name, |
| 20354 | 20355 | .linkage = linkage, |
| 20355 | | .section = null, // TODO |
| 20356 | .section = section, |
| 20356 | 20357 | .visibility = visibility, |
| 20357 | 20358 | }; |
| 20358 | 20359 | } |