aboutsummaryrefslogtreecommitdiff
path: root/src/ir_print.cpp
diff options
context:
space:
mode:
authorLemonBoy <thatlemon@gmail.com>2020-01-09 10:36:51 +0100
committerAndrew Kelley <andrew@ziglang.org>2020-01-09 13:43:06 -0500
commit5ab5de89c03bf9b3f08dfaa78d3b0fe41a72cdea (patch)
treec93dcfb6b6dad6d52d8d03e1d1a4601da5f04a3c /src/ir_print.cpp
parent4613e4d15f85406d23f91134a9ec5854da33965f (diff)
downloadzig-5ab5de89c03bf9b3f08dfaa78d3b0fe41a72cdea.tar.gz
zig-5ab5de89c03bf9b3f08dfaa78d3b0fe41a72cdea.zip
New @export() handling
Use a struct as second parameter to be future proof (and also allows to specify default values for the parameters) Closes #2679 as it was just a matter of a few lines of code.
Diffstat (limited to 'src/ir_print.cpp')
-rw-r--r--src/ir_print.cpp20
1 files changed, 5 insertions, 15 deletions
diff --git a/src/ir_print.cpp b/src/ir_print.cpp
index 6c7f216219..3b90e7c80b 100644
--- a/src/ir_print.cpp
+++ b/src/ir_print.cpp
@@ -1893,21 +1893,11 @@ static void ir_print_enum_tag_type(IrPrint *irp, IrInstructionTagType *instructi
}
static void ir_print_export(IrPrint *irp, IrInstructionExport *instruction) {
- if (instruction->linkage == nullptr) {
- fprintf(irp->f, "@export(");
- ir_print_other_instruction(irp, instruction->name);
- fprintf(irp->f, ",");
- ir_print_other_instruction(irp, instruction->target);
- fprintf(irp->f, ")");
- } else {
- fprintf(irp->f, "@exportWithLinkage(");
- ir_print_other_instruction(irp, instruction->name);
- fprintf(irp->f, ",");
- ir_print_other_instruction(irp, instruction->target);
- fprintf(irp->f, ",");
- ir_print_other_instruction(irp, instruction->linkage);
- fprintf(irp->f, ")");
- }
+ fprintf(irp->f, "@export(");
+ ir_print_other_instruction(irp, instruction->target);
+ fprintf(irp->f, ",");
+ ir_print_other_instruction(irp, instruction->options);
+ fprintf(irp->f, ")");
}
static void ir_print_error_return_trace(IrPrint *irp, IrInstructionErrorReturnTrace *instruction) {