diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2020-08-13 11:03:13 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2020-08-13 20:32:32 -0700 |
| commit | fc402bdbbbb5be2a538f0469f3f213264e7fcc59 (patch) | |
| tree | 4f3b85c10d1eef73deacfbe961c2c086ca1a65ed /src-self-hosted/zir.zig | |
| parent | a9590f3bf863493ed9b15ad8ab0d4fa7991805a5 (diff) | |
| download | zig-fc402bdbbbb5be2a538f0469f3f213264e7fcc59.tar.gz zig-fc402bdbbbb5be2a538f0469f3f213264e7fcc59.zip | |
stage2: zir_sema for loops
Also remove the "repeat" instruction and make it implied to be at the
end of a Loop body.
Diffstat (limited to 'src-self-hosted/zir.zig')
| -rw-r--r-- | src-self-hosted/zir.zig | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/src-self-hosted/zir.zig b/src-self-hosted/zir.zig index 2e638b0755..974e6f9ef6 100644 --- a/src-self-hosted/zir.zig +++ b/src-self-hosted/zir.zig @@ -151,7 +151,8 @@ pub const Inst = struct { isnonnull, /// Return a boolean true if an optional is null. `x == null` isnull, - /// A labeled block of code that loops forever. + /// A labeled block of code that loops forever. At the end of the body it is implied + /// to repeat; no explicit "repeat" instruction terminates loop bodies. loop, /// Ambiguously remainder division or modulus. If the computation would possibly have /// a different value depending on whether the operation is remainder division or modulus, @@ -175,8 +176,6 @@ pub const Inst = struct { /// the memory location is in the stack frame, local to the scope containing the /// instruction. ref, - /// Sends control flow back to the loop block operand. - repeat, /// Obtains a pointer to the return value. ret_ptr, /// Obtains the return type of the in-scope function. @@ -294,7 +293,6 @@ pub const Inst = struct { .compileerror => CompileError, .loop => Loop, .@"const" => Const, - .repeat => Repeat, .str => Str, .int => Int, .inttype => IntType, @@ -390,7 +388,6 @@ pub const Inst = struct { .breakvoid, .condbr, .compileerror, - .repeat, .@"return", .returnvoid, .unreach_nocheck, @@ -587,16 +584,6 @@ pub const Inst = struct { kw_args: struct {}, }; - pub const Repeat = struct { - pub const base_tag = Tag.repeat; - base: Inst, - - positionals: struct { - loop: *Loop, - }, - kw_args: struct {}, - }; - pub const Str = struct { pub const base_tag = Tag.str; base: Inst, |
