From 7047ed25b3ca34aeddb67d0082a998fec0841372 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Wed, 26 Oct 2016 20:24:09 -0700 Subject: Code pushing (#807) Push code forward, potentially letting it not execute --- src/ast_utils.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/ast_utils.h') diff --git a/src/ast_utils.h b/src/ast_utils.h index 9dfacb972..f10fb40eb 100644 --- a/src/ast_utils.h +++ b/src/ast_utils.h @@ -102,6 +102,11 @@ struct DirectCallGraphAnalyzer : public PostWalker> { EffectAnalyzer() {} EffectAnalyzer(Expression *ast) { + analyze(ast); + } + + void analyze(Expression *ast) { + breakNames.clear(); walk(ast); // if we are left with breaks, they are external if (breakNames.size() > 0) branches = true; @@ -151,6 +156,17 @@ struct EffectAnalyzer : public PostWalker