From 73c04954fa52addb709d7de3f2364ec3082c408b Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Mon, 16 Oct 2017 12:40:04 -0700 Subject: Use the type system to check if something is flowed out of (#1224) now that the type system has a proper unreachable, we don't need obviouslyDoesNotFlowOut --- src/ast_utils.h | 12 ------------ 1 file changed, 12 deletions(-) (limited to 'src/ast_utils.h') diff --git a/src/ast_utils.h b/src/ast_utils.h index dfa233f26..6e5251860 100644 --- a/src/ast_utils.h +++ b/src/ast_utils.h @@ -55,18 +55,6 @@ struct ExpressionAnalyzer { return !curr->condition && !curr->value; } - // Checks if an expression does not flow out in an obvious way. - // We return true if it cannot flow out. If it can flow out, we - // might still return true, as the analysis here is simple and fast. - static bool obviouslyDoesNotFlowOut(Expression* curr) { - if (auto* br = curr->dynCast()) { - if (!br->condition) return true; - } else if (auto* block = curr->dynCast()) { - if (block->list.size() > 0 && obviouslyDoesNotFlowOut(block->list.back()) && !BranchUtils::BranchSeeker::hasReachable(block, block->name)) return true; - } - return false; - } - using ExprComparer = std::function; static bool flexibleEqual(Expression* left, Expression* right, ExprComparer comparer); -- cgit v1.2.3