aboutsummaryrefslogtreecommitdiff
path: root/src/Zir.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2022-06-06 11:31:54 -0700
committerAndrew Kelley <andrew@ziglang.org>2022-06-06 11:31:54 -0700
commit41bf81dc3231eb763c93eb95b152e7ab8d3c5af8 (patch)
tree6610d43dfab44f104e7894f3d31991ff38821512 /src/Zir.zig
parent1bdc2b777bc247c52942189666bc484d8e740b16 (diff)
downloadzig-41bf81dc3231eb763c93eb95b152e7ab8d3c5af8.tar.gz
zig-41bf81dc3231eb763c93eb95b152e7ab8d3c5af8.zip
Revert "Treat blocks with "return" as "noreturn""
This reverts commit 135b91aecd9be1f6f5806b667e07e383dd481198. "endsWithBreak()" is not a meaningful question to ask and should not be used this way. A simple example that defeats this logic is: ```zig export fn entry() void { outer: { { break :outer; } return; } } ```
Diffstat (limited to 'src/Zir.zig')
-rw-r--r--src/Zir.zig13
1 files changed, 0 insertions, 13 deletions
diff --git a/src/Zir.zig b/src/Zir.zig
index bad7b91488..f09f2015e0 100644
--- a/src/Zir.zig
+++ b/src/Zir.zig
@@ -1250,19 +1250,6 @@ pub const Inst = struct {
};
}
- /// Returns whether the instruction is a "break". This differs from
- /// isNoReturn because a "break" in a block statement is not a
- /// "noreturn" for the outer scope, whereas the other "noreturn"
- /// instructions are.
- pub fn isBreak(tag: Tag) bool {
- return switch (tag) {
- .@"break",
- .break_inline,
- => true,
- else => false,
- };
- }
-
/// AstGen uses this to find out if `Ref.void_value` should be used in place
/// of the result of a given instruction. This allows Sema to forego adding
/// the instruction to the map after analysis.