aboutsummaryrefslogtreecommitdiff
path: root/src-self-hosted/zir.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2020-08-13 11:03:13 -0700
committerAndrew Kelley <andrew@ziglang.org>2020-08-13 20:32:32 -0700
commitfc402bdbbbb5be2a538f0469f3f213264e7fcc59 (patch)
tree4f3b85c10d1eef73deacfbe961c2c086ca1a65ed /src-self-hosted/zir.zig
parenta9590f3bf863493ed9b15ad8ab0d4fa7991805a5 (diff)
downloadzig-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.zig17
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,