diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2016-12-08 01:52:57 -0500 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2016-12-08 01:52:57 -0500 |
| commit | 7d0fb281fee16d9c99f61c5bce090018228ae6df (patch) | |
| tree | 4fe6b845e03cb6b19e399283f5501d444cf2185a /src/ir_print.cpp | |
| parent | a148096e6a2d28e6248eed9b5a4ad40482b74149 (diff) | |
| download | zig-7d0fb281fee16d9c99f61c5bce090018228ae6df.tar.gz zig-7d0fb281fee16d9c99f61c5bce090018228ae6df.zip | |
IR: a bunch of fixes and some additions
* add errorName builtin function
* add assertion for generated memcopy being on correct types
* respect handle_is_ptr for constant values
* fix return codegen to respect sret semantics
* remove ArrayLen IR instruction; we already have StructFieldPtr
with "len" field
* fix gen_const_val for pointers inside aggregates
Diffstat (limited to 'src/ir_print.cpp')
| -rw-r--r-- | src/ir_print.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/ir_print.cpp b/src/ir_print.cpp index 69df7d42cf..55ae7d3143 100644 --- a/src/ir_print.cpp +++ b/src/ir_print.cpp @@ -676,6 +676,12 @@ static void ir_print_compile_err(IrPrint *irp, IrInstructionCompileErr *instruct fprintf(irp->f, ")"); } +static void ir_print_err_name(IrPrint *irp, IrInstructionErrName *instruction) { + fprintf(irp->f, "@errorName("); + ir_print_other_instruction(irp, instruction->value); + fprintf(irp->f, ")"); +} + static void ir_print_instruction(IrPrint *irp, IrInstruction *instruction) { ir_print_prefix(irp, instruction); switch (instruction->id) { @@ -822,6 +828,9 @@ static void ir_print_instruction(IrPrint *irp, IrInstruction *instruction) { case IrInstructionIdCompileErr: ir_print_compile_err(irp, (IrInstructionCompileErr *)instruction); break; + case IrInstructionIdErrName: + ir_print_err_name(irp, (IrInstructionErrName *)instruction); + break; } fprintf(irp->f, "\n"); } |
