diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2016-11-21 03:08:24 -0500 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2016-11-21 03:08:24 -0500 |
| commit | 71d95c6597bbca6ef44ba8a2a401c28c19a32bbb (patch) | |
| tree | 01285870db232a793bb25ffbce594515d653fa6f /src/all_types.hpp | |
| parent | b47e2fa0604a5c785d9ed7d16c8086ecf99357f7 (diff) | |
| download | zig-71d95c6597bbca6ef44ba8a2a401c28c19a32bbb.tar.gz zig-71d95c6597bbca6ef44ba8a2a401c28c19a32bbb.zip | |
IR: support unwrap maybe operation
Diffstat (limited to 'src/all_types.hpp')
| -rw-r--r-- | src/all_types.hpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/all_types.hpp b/src/all_types.hpp index b28099ba2f..5212576c71 100644 --- a/src/all_types.hpp +++ b/src/all_types.hpp @@ -1453,6 +1453,8 @@ enum IrInstructionId { IrInstructionIdAsm, IrInstructionIdCompileVar, IrInstructionIdSizeOf, + IrInstructionIdTestNull, + IrInstructionIdUnwrapMaybe, }; struct IrInstruction { @@ -1749,6 +1751,21 @@ struct IrInstructionSizeOf { IrInstruction *type_value; }; +// returns true if nonnull, returns false if null +// this is so that `zeroes` sets maybe values to null +struct IrInstructionTestNull { + IrInstruction base; + + IrInstruction *value; +}; + +struct IrInstructionUnwrapMaybe { + IrInstruction base; + + IrInstruction *value; + bool safety_check_on; +}; + enum LValPurpose { LValPurposeNone, LValPurposeAssign, @@ -1758,4 +1775,7 @@ enum LValPurpose { static const size_t slice_ptr_index = 0; static const size_t slice_len_index = 1; +static const size_t maybe_child_index = 0; +static const size_t maybe_null_index = 1; + #endif |
