mirror of
https://github.com/odin-lang/Odin.git
synced 2026-06-06 02:34:05 +00:00
Make unreachable() a built-in compiler-level procedure
This commit is contained in:
@@ -1,8 +1,5 @@
|
||||
bool is_diverging_stmt(Ast *stmt) {
|
||||
if (stmt->kind != Ast_ExprStmt) {
|
||||
return false;
|
||||
}
|
||||
Ast *expr = unparen_expr(stmt->ExprStmt.expr);
|
||||
bool is_diverging_expr(Ast *expr) {
|
||||
expr = unparen_expr(expr);
|
||||
if (expr->kind != Ast_CallExpr) {
|
||||
return false;
|
||||
}
|
||||
@@ -26,6 +23,12 @@ bool is_diverging_stmt(Ast *stmt) {
|
||||
t = base_type(t);
|
||||
return t != nullptr && t->kind == Type_Proc && t->Proc.diverging;
|
||||
}
|
||||
bool is_diverging_stmt(Ast *stmt) {
|
||||
if (stmt->kind != Ast_ExprStmt) {
|
||||
return false;
|
||||
}
|
||||
return is_diverging_expr(stmt->ExprStmt.expr);
|
||||
}
|
||||
|
||||
bool contains_deferred_call(Ast *node) {
|
||||
if (node->viral_state_flags & ViralStateFlag_ContainsDeferredProcedure) {
|
||||
|
||||
Reference in New Issue
Block a user