diff options
| author | Matthew McAllister <matthew.mcallister.0@gmail.com> | 2019-02-12 21:22:16 -0800 |
|---|---|---|
| committer | Matthew McAllister <matthew.mcallister.0@gmail.com> | 2019-02-16 17:37:47 -0800 |
| commit | 91989e70ba68e3543acffef079d97c9416b5259c (patch) | |
| tree | 71323c9859706b377290c5bbca22c661afaf60dc /src/all_types.hpp | |
| parent | c3c92ca8b1ada4faed14a9770ab7ed6536edaa15 (diff) | |
| download | zig-91989e70ba68e3543acffef079d97c9416b5259c.tar.gz zig-91989e70ba68e3543acffef079d97c9416b5259c.zip | |
Fix lvalue dereference type checking
Previously, if a dereference instruction was an lvalue, it would fail to
typecheck that the value being dereferenced was indeed a pointer.
Although a little clunky, this change obviates the need for redundant
type checks scattered about the analysis.
Diffstat (limited to 'src/all_types.hpp')
| -rw-r--r-- | src/all_types.hpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/all_types.hpp b/src/all_types.hpp index 6fbd987b9e..1304106f08 100644 --- a/src/all_types.hpp +++ b/src/all_types.hpp @@ -2091,6 +2091,11 @@ struct IrBasicBlock { IrInstruction *must_be_comptime_source_instr; }; +enum LVal { + LValNone, + LValPtr, +}; + // These instructions are in transition to having "pass 1" instructions // and "pass 2" instructions. The pass 1 instructions are suffixed with Src // and pass 2 are suffixed with Gen. @@ -2354,6 +2359,7 @@ struct IrInstructionUnOp { IrUnOp op_id; IrInstruction *value; + LVal lval; }; enum IrBinOp { @@ -3090,11 +3096,6 @@ struct IrInstructionTypeName { IrInstruction *type_value; }; -enum LVal { - LValNone, - LValPtr, -}; - struct IrInstructionDeclRef { IrInstruction base; |
