class Savi::Compiler::Flow::Visitor

Defined in:

savi/compiler/flow.cr

Constructors

Instance Method Summary

Instance methods inherited from class Savi::AST::Visitor

visit(ctx : Compiler::Context, node : Node) visit, visit_any?(ctx : Compiler::Context, node : Node) visit_any?, visit_children?(ctx : Compiler::Context, node : Node) visit_children?, visit_pre(ctx : Compiler::Context, node : Node) visit_pre

Constructor Detail

def self.new(func : Program::Function, analysis : Savi::Compiler::Flow::Analysis) #

[View source]

Instance Method Detail

def analysis : Analysis #

[View source]
def current_jump_target_for(kind : AST::Jump::Kind) #

We track a stack of jump targets for each kind of jump, so that when such a jump is encountered, we can mark it as a predecessor for the given jump target block, tracking that relationship.


[View source]
def deep_visit_call(ctx, node : AST::Call) : Bool #

[View source]
def deep_visit_choice(ctx, node : AST::Choice) #

[View source]
def deep_visit_loop(ctx, node : AST::Loop) #

[View source]
def deep_visit_try(ctx, node : AST::Try) #

[View source]
def finish_analysis #

[View source]
def pop_jump_target(kind : AST::Jump::Kind) #

[View source]
def push_jump_target(kind : AST::Jump::Kind, block : Block) #

[View source]
def visit(ctx, node) #

This visitor never replaces nodes, it just observes them and returns them. If we observe a Jump node, we also take some special control flow action.


[View source]
def visit_call(ctx, node : AST::Call) #

[View source]
def visit_children?(ctx, node : AST::Node) #

[View source]
def visit_deferred_child(ctx, node, block : Savi::Compiler::Flow::Block) #

[View source]
def visit_jump(ctx, node : AST::Jump) #

[View source]
def with_jump_target(kind : AST::Jump::Kind, block : Block, &) #

[View source]